gpg: make homedir configurable

This commit is contained in:
fricklerhandwerk 2019-10-25 17:12:40 +02:00 committed by Robert Helgesson
parent 0a6227d667
commit 348b5a5a69
No known key found for this signature in database
GPG key ID: 36BDAA14C2797E89
6 changed files with 95 additions and 9 deletions

View file

@ -35,6 +35,13 @@ in
<link xlink:href="https://gnupg.org/documentation/manpage.html"/>.
'';
};
homedir = mkOption {
type = types.path;
example = literalExample "${config.xdg.dataHome}/gnupg";
default = "${config.home.homeDirectory}/.gnupg";
description = "Directory to store keychains and configuration.";
};
};
config = mkIf cfg.enable {
@ -60,7 +67,10 @@ in
};
home.packages = [ pkgs.gnupg ];
home.sessionVariables = {
GNUPGHOME = cfg.homedir;
};
home.file.".gnupg/gpg.conf".text = cfgText;
home.file."${cfg.homedir}/gpg.conf".text = cfgText;
};
}