Compare commits
No commits in common. "cfb95bbedc617340dc50834ce530bf0888c4190f" and "e5aef16a975c378ef6f752e32647fd91240a0933" have entirely different histories.
cfb95bbedc
...
e5aef16a97
@ -1,14 +1,10 @@
|
||||
{ lib, ... }:
|
||||
|
||||
let
|
||||
{ lib, ... }: {
|
||||
programs.gpg = let
|
||||
repo = (builtins.fetchGit {
|
||||
url = "https://git.finally.coffee/transcaffeine/dotfiles.git";
|
||||
ref = "main";
|
||||
shallow = true;
|
||||
});
|
||||
utils = import ../../../utils { inherit lib; };
|
||||
in {
|
||||
programs.gpg = let
|
||||
gpgconf = builtins.listToAttrs (
|
||||
map (entry: {
|
||||
name = toString (lib.sublist 0 1 (lib.splitString " " entry));
|
||||
@ -25,32 +21,4 @@ in {
|
||||
enable = true;
|
||||
settings = gpgconf;
|
||||
};
|
||||
services.gpg-agent = let
|
||||
gpg_agent_config = builtins.listToAttrs (
|
||||
map (entry: let
|
||||
val = toString (lib.sublist 1 100 (lib.splitString " " entry));
|
||||
emptyStringToTrue = (x: if lib.isBool x then x else if x == "" then true else x);
|
||||
in {
|
||||
name = toString (lib.sublist 0 1 (lib.splitString " " entry));
|
||||
value = emptyStringToTrue val;
|
||||
}) (
|
||||
builtins.filter (v: v != "") (
|
||||
lib.splitString "\n" (
|
||||
lib.readFile (repo.outPath + "/config/gnupg/gpg-agent.conf")
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
in {
|
||||
enable = true;
|
||||
enableSshSupport = gpg_agent_config."enable-ssh-support";
|
||||
defaultCacheTtl = gpg_agent_config."default-cache-ttl";
|
||||
maxCacheTtl = gpg_agent_config."max-cache-ttl";
|
||||
defaultCacheTtlSsh = gpg_agent_config."default-cache-ttl-ssh";
|
||||
maxCacheTtlSsh = gpg_agent_config."max-cache-ttl-ssh";
|
||||
extraConfig = utils.attrsToConfig {
|
||||
"ignore-cache-for-signing" = gpg_agent_config."ignore-cache-for-signing";
|
||||
"no-allow-external-cache" = gpg_agent_config."no-allow-external-cache";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
@ -1,14 +0,0 @@
|
||||
{ lib, ...}:
|
||||
|
||||
rec {
|
||||
_tupleToEntry = x: x.name + (if lib.isBool x.value then "" else (" " + x.value));
|
||||
attrsToConfig = attrs: (
|
||||
lib.concatStringsSep "\n" (
|
||||
map (_tupleToEntry) (
|
||||
builtins.filter (e: e.value != false) (
|
||||
lib.attrsToList attrs
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
Loading…
Reference in New Issue
Block a user