[NixOS] Fix environment variables in gpg import

This commit is contained in:
Kat Huang 2023-08-23 04:25:37 +00:00
parent cfbb4474c6
commit ebb5e20364

View File

@ -23,8 +23,9 @@
RestartSec = 5;
Restart = "onfailure";
ExecStart =
let path = config.age.secrets.gpg-keys.path;
passphrasePath = config.age.secrets.gpg-passphrase.path;
let replace = builtins.replaceStrings [ "$XDG_RUNTIME_DIR" ] [ "\${XDG_RUNTIME_DIR}" ];
path = replace config.age.secrets.gpg-keys.path;
passphrasePath = replace config.age.secrets.gpg-passphrase.path;
in "${pkgs.gnupg}/bin/gpg --pinentry-mode loopback --passphrase-file ${passphrasePath} --import ${path}";
};
};