From a8a88c53b353205be0cb9b6cba87700b2dc971a9 Mon Sep 17 00:00:00 2001
From: sinanmohd <sinan@sinanmohd.com>
Date: Wed, 26 Jun 2024 15:05:28 +0530
Subject: home/pc/pass: setup gnupg

---
 home/pc/modules/pass.nix | 24 +++++++++++++++++-------
 1 file changed, 17 insertions(+), 7 deletions(-)

diff --git a/home/pc/modules/pass.nix b/home/pc/modules/pass.nix
index 9117c3a..3387861 100644
--- a/home/pc/modules/pass.nix
+++ b/home/pc/modules/pass.nix
@@ -1,10 +1,20 @@
-{ pkgs, ... }: {
-  home.packages = with pkgs; [
-    (pass.withExtensions (exts: [ exts.pass-otp ]))
-  ];
+{ config, pkgs, lib, ... }: let
+  passStore = config.xdg.dataHome + "/pass";
+  GNUPGHome = config.xdg.dataHome + "/gnupg";
+in {
+  home = {
+    file."${GNUPGHome}/gpg-agent.conf".text = ''
+      pinentry-program ${lib.getExe pkgs.pinentry-bemenu}
+    '';
 
-  services.gpg-agent = {
-    enable = true;
-    pinentryPackage = pkgs.pinentry-bemenu;
+    packages = with pkgs; [
+      pinentry-bemenu
+      (pass.withExtensions (exts: [ exts.pass-otp ]))
+    ];
+
+    sessionVariables = {
+      PASSWORD_STORE_DIR = passStore;
+      GNUPGHOME = GNUPGHome;
+    };
   };
 }
-- 
cgit v1.2.3