about summary refs log tree commit diff
diff options
context:
space:
mode:
authorsefidel <contact@sefidel.net>2022-02-14 23:59:17 +0900
committersefidel <contact@sefidel.net>2022-02-14 23:59:17 +0900
commit46715ed381535bdd38e516467e8af4ec74d977d9 (patch)
tree4bf82cdc10050e398526cafa894d6e9e4364455f
parent579ba4120118effb79d6d37dd34b620cb0af34e2 (diff)
downloadnixrc-46715ed381535bdd38e516467e8af4ec74d977d9.tar.gz
nixrc-46715ed381535bdd38e516467e8af4ec74d977d9.zip
feat: setup pam-gnupg
-rw-r--r--home/profiles/base/default.nix7
-rw-r--r--nixos/alpha/configuration.nix12
2 files changed, 19 insertions, 0 deletions
diff --git a/home/profiles/base/default.nix b/home/profiles/base/default.nix
index 539823c..c27a861 100644
--- a/home/profiles/base/default.nix
+++ b/home/profiles/base/default.nix
@@ -250,6 +250,9 @@ in
         defaultCacheTtlSsh = 3600;
         maxCacheTtl = 86400;
         maxCacheTtlSsh = 86400;
+        extraConfig = ''
+          allow-preset-passphrase
+        '';
       };
 
       swayidle = {
@@ -275,5 +278,9 @@ in
         longitude = "127.2";
       };
     };
+
+    home.file.".pam-gnupg".text = ''
+      77FE99210D6D1175076B284229CE8818A7112C9B
+    '';
   };
 }
diff --git a/nixos/alpha/configuration.nix b/nixos/alpha/configuration.nix
index 79b3e81..9f770b4 100644
--- a/nixos/alpha/configuration.nix
+++ b/nixos/alpha/configuration.nix
@@ -8,6 +8,18 @@
     doas.enable = true;
     doas.wheelNeedsPassword = false;
     sudo.wheelNeedsPassword = false;
+
+    pam.services = {
+      login.gnupg.enable = true;
+      login.gnupg.storeOnly = true;
+
+      greetd.gnupg.enable = true;
+      greetd.gnupg.storeOnly = true;
+
+      swaylock.gnupg.enable = true;
+      i3lock.gnupg.enable = true;
+      i3lock-color.gnupg.enable = true;
+    };
   };
 
   boot.kernelPackages = pkgs.linuxPackages_5_15;