Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions modules/programs/gpg.nix
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,12 @@ in {
source = "${keyringFiles}/pubring.kbx";
};

home.activation = mkIf (cfg.publicKeys != [ ]) {
home.activation = {
createGpgHomedir =
hm.dag.entryBetween [ "linkGeneration" ] [ "writeBoundary" ] ''
$DRY_RUN_CMD mkdir -m700 -p $VERBOSE_ARG ${escapeShellArg cfg.homedir}
'';

importGpgKeys = let
gpg = "${cfg.package}/bin/gpg";

Expand Down Expand Up @@ -313,7 +318,8 @@ in {
unset GNUPGHOME QUIET_ARG keyId importTrust
'' ++ optional (!cfg.mutableTrust && anyTrust) ''
install -m 0700 ${keyringFiles}/trustdb.gpg "${cfg.homedir}/trustdb.gpg"'');
in lib.hm.dag.entryAfter [ "linkGeneration" ] block;
in mkIf (cfg.publicKeys != [ ])
(lib.hm.dag.entryAfter [ "linkGeneration" ] block);
};
};
}