1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-12-07 09:31:04 +01:00

gpg-agent: pinentryPackage -> pinentry.package and add pinentry.program`

Alternative option for allowing a user to automatically configure what
binary to use from a `pinentry` package. Previously, we always used
`meta.mainProgram` but, there are packages that provide multiple
binaries and this would allow flexibility for a user to override the
default program used.
This commit is contained in:
Austin Horstman 2025-04-23 14:02:42 -05:00
parent 1ad1232399
commit a4c3ce44fc
3 changed files with 60 additions and 15 deletions

View file

@ -1,6 +1,7 @@
{
config,
lib,
options,
pkgs,
...
}:
@ -10,6 +11,20 @@ lib.mkIf pkgs.stdenv.isLinux {
services.gpg-agent.pinentryPackage = pkgs.pinentry-gnome3;
programs.gpg.enable = true;
test.asserts.warnings.expected =
let
renamed = {
pinentryPackage = "pinentry.package";
};
in
lib.mapAttrsToList (
old: new:
builtins.replaceStrings [ "\n" ] [ " " ] ''
The option `services.gpg-agent.${old}' defined in
${lib.showFiles options.services.gpg-agent.${old}.files}
has been renamed to `services.gpg-agent.${new}'.''
) renamed;
nmt.script = ''
in="${config.systemd.user.sockets.gpg-agent.Socket.ListenStream}"
if [[ $in != "%t/gnupg/S.gpg-agent" ]]

View file

@ -5,7 +5,6 @@ let
in
{
services.gpg-agent.enable = true;
services.gpg-agent.pinentryPackage = null; # Don't build pinentry package.
programs.gpg = {
enable = true;
homedir = "/path/to/hash";