1
0
Fork 0
mirror of https://github.com/Mic92/sops-nix.git synced 2024-12-14 11:57:52 +00:00
Commit graph

32 commits

Author SHA1 Message Date
jobs62
8d13626351 try fixing templates on home-manager
Update pkgs/sops-install-secrets/main.go
2024-12-02 09:29:15 +01:00
Jörg Thalheim
6b85086bcc reformat code base with nixfmt 2024-11-17 12:22:59 +01:00
Jörg Thalheim
a7b8f0feb7 define templates for home-manager 2024-11-17 11:06:56 +00:00
Jeremy Fleischman
eee831aadb Do not render templates when decrypting neededForUsers secrets
This fixes https://github.com/Mic92/sops-nix/issues/659

In https://github.com/Mic92/sops-nix/pull/649, we started rendering
templates twice:

1. When rendering `neededForUsers` secrets (if there are any
   `neededForUsers` secrets).
2. When decrypting "regular" secrets.

This alone was weird and wrong, but didn't cause issues
for people until https://github.com/Mic92/sops-nix/pull/655, which
triggered https://github.com/Mic92/sops-nix/issues/659. The cause is not
super obvious:

1. When rendering `neededForUsers` secrets, we'd generate templates in
   `/run/secrets-for-users/rendered`.
2. However, the `path` for these templates is in
   `/run/secrets/rendered`, which is not inside of the
   `/run/secrets-for-users` directory we're dealing with, so we'd
   generate a symlink from `/run/secrets/rendered/<foo>` to
   `/run/secrets-for-users/rendered/<foo>`, which required making
   the parent directory of the symlink (`/run/secrets/rendered/`).
3. This breaks sops-nix's assumption that `/run/secrets` either doesn't
   exist, or is a symlink, and you get the symptoms described in
   <https://github.com/Mic92/sops-nix/issues/659>.

Reproducing this in a test was straightforward: just expand our existing
template test to also have a `neededForUsers` secret.

Fixing this was also straightforward: don't render templates during the
`neededForUsers` phase (if we want to add support for `neededForUsers`
templates in the future, that would be straightforward to do, but I
opted not do that here).
2024-11-17 06:19:41 +00:00
Wael Nasreddine
f1675e3b0e
home-manager: Add support for Split GPG on Qubes OS (#657)
Co-authored-by: Jörg Thalheim <Mic92@users.noreply.github.com>
2024-11-10 05:32:29 +01:00
liyangau
c5ae1e214f fix missing lib in mkOption 2024-11-06 09:50:27 +01:00
thomaslepoix
f21c31dadf Emit plain file when key is empty
Co-Authored-By: Slaier <slaier@users.noreply.github.com>
2024-11-06 05:57:58 +00:00
Sizhe Zhao
b2211d1a53 fix(home-manager/sops): fix setting unit env
The Environment option should be set in Service section.
2024-10-26 08:38:45 +00:00
Sizhe Zhao
78a0e634fc fix(home-manager/sops): fix setting systemd unit environment 2024-10-24 13:07:55 +00:00
Mark Sisson
d089e742fb feat(home-manager/sops): add environment variable configuration
Added support for configuring environment variables before calling
`sops-install-secrets`. Introduced a new `environment` option which
allows specifying environment variables. Modified systemd service
and launchd agent to use the specified environment variables.
2024-10-23 14:55:20 +00:00
Sandro Jäckel
26642e8f19 Add some missing literalExpression 2024-10-22 09:03:27 +00:00
A. Manzer
5876a12ff6 Allow sops-nix to be restarted when systemd is degraded
If Systemd is running, but with even a single failed unit, it'll enter Degraded state.  Restart sops-nix anyway.
2024-09-27 09:35:55 +02:00
Jörg Thalheim
ab2d1ffeb5 {nixos,home-manager}: shell escape age key paths 2024-08-12 09:20:04 +00:00
Sebastian Sellmeier
4371a1301c home-manager: minor oversight cleanup 2024-04-22 10:39:12 +02:00
Jörg Thalheim
e31339a204 home-manager: fix implicit dependency on coreutils
fixes https://github.com/Mic92/sops-nix/issues/542
2024-04-19 08:18:56 +00:00
Jörg Thalheim
58b9a13a37 home-manager: fix key store path check for strings
fixes https://github.com/Mic92/sops-nix/issues/535
2024-04-18 13:12:29 +02:00
Sebastian Sellmeier
a9795d1959 home-manager: Change defaultSymlinkPath to "<xdg-config-home>/sops-nix/secrets" 2024-04-18 08:22:30 +00:00
the-furry-hubofeverything
74f03c1a51 Refuse age keyfile paths that are in the nix store 2024-04-18 08:17:46 +00:00
Sebastian Sellmeier
dacc9519f5 home-manager: Include home.activation-script for linux similar to macos 2024-04-18 08:02:04 +00:00
Sirio Balmelli
48afd3264e home-manager/darwin: run sops-nix-user _once_ on login or activation
Correct a bug where 'KeepAlive' in the launchd service
'org.nix-community.home.sops-nix.plist'
re-runs 'sops-nix-user' every few seconds.

This should run:

- once at boot
- once at home-manager profile activation

Signed-off-by: Sirio Balmelli <sirio@b-ad.ch>
2024-02-13 17:36:42 +01:00
Jörg Thalheim
4d284ca58c nixos: fix typo in assertion message when no key source is configured 2023-09-18 19:13:37 +02:00
Kilian Mio
d9c5dc41c4 fix: systemd unit file
Make sure passwords are ready for services part of graphical-session.target
2023-08-30 15:08:19 +01:00
Physics Enthusiast
32603de0dc
Configure the systemd user service to start with graphical session if use of a passphrase is detected (#346)
* Update sops.nix systemd user service target

* Use conditional to detect if gnupg.home is set before setting the WantedBy to graphical-session.target
2023-08-13 09:38:40 +01:00
MidAutumnMoon
37400a275d HM: make secretsMountPoint and symlinkPath configurable 2023-04-17 18:30:23 +02:00
pogobanane
e4b99135e5
Home-maager: support init and dotenv
Co-authored-by: Jörg Thalheim <Mic92@users.noreply.github.com>
2023-02-03 10:30:30 +01:00
Matthew Toohey
c4ff0f37ef Save launchd logs 2023-02-02 12:07:00 +01:00
Matthew Toohey
c3d2a46e44 Disable systemd service outside of Linux 2023-02-02 12:07:00 +01:00
Pogobanane
466d039190 darwin/home-manager: %r dir 2023-02-02 12:07:00 +01:00
Anil Anar
5e580b4bdd Fix missing spaces in script 2023-02-02 11:38:03 +01:00
Janne Heß
7f38c98162 More review fixups 2023-02-02 11:38:03 +01:00
Janne Heß
8b4048123e Add a launchd service to the home-manager module 2023-02-02 11:38:03 +01:00
Janne Heß
acaf36a1bf Implement home-manager support
Closes #62
Closes #163
2023-02-02 11:38:03 +01:00