1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-12-24 10:49:48 +01:00

gpg: can configure scdaemon.conf (#1960)

This commit is contained in:
Cole Mickens 2021-04-28 11:39:58 -07:00 committed by GitHub
parent 18ad12d52b
commit c0ba8c526d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -15,6 +15,11 @@ let
listsAsDuplicateKeys = true;
} cfg.settings;
scdaemonCfgText = generators.toKeyValue {
inherit mkKeyValue;
listsAsDuplicateKeys = true;
} cfg.scdaemonSettings;
primitiveType = types.oneOf [ types.str types.bool ];
in
{
@ -44,6 +49,20 @@ in
'';
};
scdaemonSettings = mkOption {
type = types.attrsOf (types.either primitiveType (types.listOf types.str));
example = literalExample ''
{
disable-ccid = true;
}
'';
description = ''
SCdaemon configuration options. Available options are described
in the gpg scdaemon manpage:
<link xlink:href="https://www.gnupg.org/documentation/manuals/gnupg/Scdaemon-Options.html"/>.
'';
};
homedir = mkOption {
type = types.path;
example = literalExample "\"\${config.xdg.dataHome}/gnupg\"";
@ -75,11 +94,17 @@ in
use-agent = mkDefault true;
};
programs.gpg.scdaemonSettings = {
# no defaults for scdaemon
};
home.packages = [ cfg.package ];
home.sessionVariables = {
GNUPGHOME = cfg.homedir;
};
home.file."${cfg.homedir}/gpg.conf".text = cfgText;
home.file."${cfg.homedir}/scdaemon.conf".text = scdaemonCfgText;
};
}