From e5aef16a975c378ef6f752e32647fd91240a0933 Mon Sep 17 00:00:00 2001 From: transcaffeine Date: Mon, 2 Dec 2024 22:45:50 +0100 Subject: [PATCH] feat(home-manager): manage gpg.conf with configuration from upstream dotfile repository --- users/transcaffeine/home-manager/default.nix | 1 + users/transcaffeine/home-manager/gnupg.nix | 24 ++++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 users/transcaffeine/home-manager/gnupg.nix diff --git a/users/transcaffeine/home-manager/default.nix b/users/transcaffeine/home-manager/default.nix index bb4f6e5..b5850ec 100644 --- a/users/transcaffeine/home-manager/default.nix +++ b/users/transcaffeine/home-manager/default.nix @@ -1,6 +1,7 @@ { lib, pkgs, ... }: { imports = [ ./git.nix + ./gnupg.nix ]; home.stateVersion = "24.11"; services.darkman = { diff --git a/users/transcaffeine/home-manager/gnupg.nix b/users/transcaffeine/home-manager/gnupg.nix new file mode 100644 index 0000000..567bee9 --- /dev/null +++ b/users/transcaffeine/home-manager/gnupg.nix @@ -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; + }; +}