Move pass/agent.nix to pass/service.nix

Add password-store-sync service
Fix passwors store directory setting by using nix variables
This commit is contained in:
Evie Litherland-Smith 2023-09-05 17:44:23 +01:00
parent 2d8b935e22
commit 5a7cbee56d
4 changed files with 23 additions and 19 deletions

View file

@ -3,7 +3,7 @@
{ {
imports = [ imports = [
./accounts/service.nix ./accounts/service.nix
./pass/agent.nix ./pass/service.nix
./git/default.nix ./git/default.nix
./ssh/default.nix ./ssh/default.nix
./tui/default.nix ./tui/default.nix

View file

@ -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
'';
};
}

View file

@ -1,4 +1,4 @@
{ pkgs, ... }: { config, pkgs, ... }:
{ {
programs = { programs = {
@ -6,7 +6,8 @@
password-store = { password-store = {
enable = true; enable = true;
package = pkgs.pass.withExtensions (exts: [ exts.pass-otp ]); 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 = git.extraConfig.credential.helper =
"${pkgs.gitFull}/bin/git-credential-libsecret"; "${pkgs.gitFull}/bin/git-credential-libsecret";

19
home/pass/service.nix Normal file
View file

@ -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;
};
}