feat(home-manager): manage gpg.conf with configuration from upstream dotfile repository

This commit is contained in:
transcaffeine 2024-12-02 22:45:50 +01:00
parent 20cc8bee1b
commit e5aef16a97
Signed by: transcaffeine
GPG Key ID: 03624C433676E465
2 changed files with 25 additions and 0 deletions

View File

@ -1,6 +1,7 @@
{ lib, pkgs, ... }: { { lib, pkgs, ... }: {
imports = [ imports = [
./git.nix ./git.nix
./gnupg.nix
]; ];
home.stateVersion = "24.11"; home.stateVersion = "24.11";
services.darkman = { services.darkman = {

View File

@ -0,0 +1,24 @@
{ lib, ... }: {
programs.gpg = let
repo = (builtins.fetchGit {
url = "https://git.finally.coffee/transcaffeine/dotfiles.git";
ref = "main";
shallow = true;
});
gpgconf = builtins.listToAttrs (
map (entry: {
name = toString (lib.sublist 0 1 (lib.splitString " " entry));
value = toString (lib.sublist 1 100 (lib.splitString " " entry));
}) (
builtins.filter (value: value != "") (
lib.splitString "\n" (
lib.readFile (repo.outPath + "/config/gnupg/gpg.conf")
)
)
)
);
in {
enable = true;
settings = gpgconf;
};
}