diff --git a/modules/programs/gpg.nix b/modules/programs/gpg.nix index f81002c8..51686024 100644 --- a/modules/programs/gpg.nix +++ b/modules/programs/gpg.nix @@ -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: + . + ''; + }; + 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; }; }