about summary refs log tree commit diff
path: root/config/gnupg/module.nix
diff options
context:
space:
mode:
Diffstat (limited to 'config/gnupg/module.nix')
-rw-r--r--config/gnupg/module.nix23
1 files changed, 23 insertions, 0 deletions
diff --git a/config/gnupg/module.nix b/config/gnupg/module.nix
new file mode 100644
index 000000000000..d134443df70f
--- /dev/null
+++ b/config/gnupg/module.nix
@@ -0,0 +1,23 @@
+{ pkgs, lib, ... }:
+
+let
+  inherit (pkgs) callPackage writeText;
+  inherit (lib) concatStringsSep mapAttrsToList;
+
+  configs = {
+    "gpg.conf" = ./gpg.conf;
+    "gpg-agent.conf" = writeText "gpg-agent.conf"
+                         (callPackage ./gpg-agent.conf.nix {});
+    "dirmngr.conf" = ./dirmngr.conf;
+  };
+
+in
+  {
+    home.qyliss.dirs."state/gnupg".activationScripts.config = ''
+      ${concatStringsSep "\n" (mapAttrsToList (name: path: ''
+        ln -sf ${path} ${name}
+      '') configs)}
+    '';
+
+    environment.systemPackages = with pkgs.pkgsConfigured; [ gnupg ];
+  }