fix(#5): Separate gpg keygrip from keyID
pam-gnupg wants the keygrip, git wants the keyID
This commit is contained in:
parent
c94b93726a
commit
9cd372c4f3
2 changed files with 26 additions and 12 deletions
|
@ -1,13 +1,13 @@
|
|||
{ config, lib, ... }:
|
||||
let
|
||||
inherit (config) jhome;
|
||||
inherit (cfg.defaultIdentity) gpgKey;
|
||||
inherit (cfg.defaultIdentity) signingKey;
|
||||
|
||||
cfg = jhome.user;
|
||||
hasConfig = jhome.enable && cfg != null;
|
||||
hasKey = gpgKey != null;
|
||||
hasKey = signingKey != null;
|
||||
gpgHome = config.programs.gpg.homedir;
|
||||
unlockKey = hasConfig && cfg.unlockGpgKeyOnLogin && hasKey;
|
||||
unlockKey = hasConfig && cfg.gpg.unlockKeys != [ ];
|
||||
in
|
||||
{
|
||||
config = lib.mkMerge [
|
||||
|
@ -16,15 +16,14 @@ in
|
|||
programs.git.userEmail = cfg.defaultIdentity.email;
|
||||
programs.git.signing = lib.mkIf hasKey {
|
||||
signByDefault = true;
|
||||
key = gpgKey;
|
||||
key = signingKey;
|
||||
};
|
||||
})
|
||||
(lib.mkIf unlockKey {
|
||||
xdg.configFile.pam-gnupg.text = ''
|
||||
${gpgHome}
|
||||
|
||||
${gpgKey}
|
||||
'';
|
||||
'' + (lib.strings.concatLines cfg.gpg.unlockKeys);
|
||||
})
|
||||
];
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue