diff options
| author | Rodion Goritskov <rodion@goritskov.com> | 2026-08-30 15:22:28 +0200 |
|---|---|---|
| committer | Nguyễn Gia Phong <cnx@loang.net> | 2026-08-31 10:42:46 +0900 |
| commit | 5c01b37207a5af060ddf5c04bec89babfc14b67f (patch) | |
| tree | 50ce226bed38c1b27cbee7a967d8272fa2cf946b | |
| parent | e521059a432c92c5fa8a24c12d8311768a1e76bf (diff) | |
home: services: gnupg: Expand HOME in runtime.
Previously getenv was used, leading to reconfigure user's home being
used for GNUPGHOME variable, so we end up with root's home directory
when running guix home as part of system reconfiguration.
* gnu/home/services/gnupg.scm (home-gpg-agent-envrionment-variables):
Use environment variable expansion instead of getenv.
Merges: https://codeberg.org/guix/guix/pulls/10916
Reviewed-by: Ada Stevenson <adanskana@gmail.com>
Signed-off-by: Nguyễn Gia Phong <cnx@loang.net>
| -rw-r--r-- | gnu/home/services/gnupg.scm | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/gnu/home/services/gnupg.scm b/gnu/home/services/gnupg.scm index 38fa58e2fab..65adf9fe519 100644 --- a/gnu/home/services/gnupg.scm +++ b/gnu/home/services/gnupg.scm | |||
| @@ -157,12 +157,11 @@ agent, with support for handling OpenSSH material.")))) | |||
| 157 | 157 | ||
| 158 | (define (home-gpg-agent-environment-variables config) | 158 | (define (home-gpg-agent-environment-variables config) |
| 159 | "Return GnuPG environment variables needed for @var{config}." | 159 | "Return GnuPG environment variables needed for @var{config}." |
| 160 | (let ((home (getenv "HOME")) | 160 | (let ((gnupghome (home-gpg-agent-configuration-home config))) |
| 161 | (gnupghome (home-gpg-agent-configuration-home config))) | ||
| 162 | `(,@(if (home-gpg-agent-configuration-ssh-support? config) | 161 | `(,@(if (home-gpg-agent-configuration-ssh-support? config) |
| 163 | '(("SSH_AUTH_SOCK" . "$XDG_RUNTIME_DIR/gnupg/S.gpg-agent.ssh")) | 162 | '(("SSH_AUTH_SOCK" . "$XDG_RUNTIME_DIR/gnupg/S.gpg-agent.ssh")) |
| 164 | '()) | 163 | '()) |
| 165 | ("GNUPGHOME" . ,(in-vicinity home gnupghome))))) | 164 | ("GNUPGHOME" . ,(in-vicinity "$HOME" gnupghome))))) |
| 166 | 165 | ||
| 167 | (define (gpg-agent-activation config) | 166 | (define (gpg-agent-activation config) |
| 168 | (with-imported-modules (source-module-closure | 167 | (with-imported-modules (source-module-closure |
