diff --git a/home/default.nix b/home/default.nix index a8309e55..67c8acbc 100644 --- a/home/default.nix +++ b/home/default.nix @@ -3,7 +3,7 @@ { imports = [ ./accounts/service.nix - ./pass/agent.nix + ./pass/service.nix ./git/default.nix ./ssh/default.nix ./tui/default.nix diff --git a/home/pass/agent.nix b/home/pass/agent.nix deleted file mode 100644 index 8f82c17d..00000000 --- a/home/pass/agent.nix +++ /dev/null @@ -1,16 +0,0 @@ -{ ... }: - -{ - imports = [ ./default.nix ]; - services.gpg-agent = { - enable = true; - defaultCacheTtl = 7200; - defaultCacheTtlSsh = 7200; - pinentryFlavor = "gtk2"; - extraConfig = '' - no-allow-external-cache - allow-emacs-pinentry - allow-loopback-pinentry - ''; - }; -} diff --git a/home/pass/default.nix b/home/pass/default.nix index 2e0d955f..2c7daf8e 100644 --- a/home/pass/default.nix +++ b/home/pass/default.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: +{ config, pkgs, ... }: { programs = { @@ -6,7 +6,8 @@ password-store = { enable = true; package = pkgs.pass.withExtensions (exts: [ exts.pass-otp ]); - settings.PASSWORD_STORE_DIR = "$HOME/.password-store"; + settings.PASSWORD_STORE_DIR = with config.home; + "${homeDirectory}/.password-store"; }; git.extraConfig.credential.helper = "${pkgs.gitFull}/bin/git-credential-libsecret"; diff --git a/home/pass/service.nix b/home/pass/service.nix new file mode 100644 index 00000000..f4ad3cfa --- /dev/null +++ b/home/pass/service.nix @@ -0,0 +1,19 @@ +{ ... }: + +{ + imports = [ ./default.nix ]; + services = { + gpg-agent = { + enable = true; + defaultCacheTtl = 7200; + defaultCacheTtlSsh = 7200; + pinentryFlavor = "gtk2"; + extraConfig = '' + no-allow-external-cache + allow-emacs-pinentry + allow-loopback-pinentry + ''; + }; + password-store-sync.enable = true; + }; +}