Split gpg-agent and mbsync service into separate files

This commit is contained in:
Evie Litherland-Smith 2023-09-02 06:20:36 +01:00
parent b4e5fecf4c
commit df557003e2
6 changed files with 33 additions and 26 deletions

View file

@ -2,11 +2,12 @@
{ {
imports = [ imports = [
./pass/default.nix ./pass/agent.nix
./git/default.nix ./git/default.nix
./ssh/default.nix ./ssh/default.nix
./tui/default.nix ./tui/default.nix
./tmux/default.nix ./tmux/default.nix
./mail/service.nix
./hyprland/default.nix ./hyprland/default.nix
./alacritty/default.nix ./alacritty/default.nix
./firefox/default.nix ./firefox/default.nix

View file

@ -153,5 +153,4 @@
''; '';
}; };
}; };
services.mbsync.enable = true;
} }

6
home/mail/service.nix Normal file
View file

@ -0,0 +1,6 @@
{ ... }:
{
imports = [ ./default.nix ];
services.mbsync.enable = true;
}

16
home/pass/agent.nix Normal file
View file

@ -0,0 +1,16 @@
{ ... }:
{
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

@ -11,15 +11,4 @@
git.extraConfig.credential.helper = git.extraConfig.credential.helper =
"${pkgs.gitFull}/bin/git-credential-libsecret"; "${pkgs.gitFull}/bin/git-credential-libsecret";
}; };
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,14 +1,16 @@
{ pkgs, user, shell ? "zsh", ... }: { lib, pkgs, user, shell ? "zsh", ... }:
let homeDirectory = "/Users/${user}"; let homeDirectory = "/Users/${user}";
in { in {
imports = [ imports = [
../../home/shell/${shell}.nix ../../home/shell/${shell}.nix
../../home/git ../../home/pass/default.nix
../../home/ssh ../../home/git/default.nix
../../home/tui ../../home/ssh/default.nix
../../home/tmux ../../home/tui/default.nix
../../home/alacritty ../../home/tmux/default.nix
../../home/emacs ../../home/mail/default.nix
../../home/alacritty/default.nix
../../home/emacs/default.nix
]; ];
home = { home = {
inherit homeDirectory; inherit homeDirectory;
@ -25,12 +27,6 @@ in {
''; '';
}; };
emacs.package = pkgs.emacs29; emacs.package = pkgs.emacs29;
gpg.enable = true;
password-store = {
enable = true;
package = pkgs.pass.withExtensions (exts: [ exts.pass-otp ]);
settings.PASSWORD_STORE_DIR = "$HOME/.password-store";
};
}; };
services.syncthing.enable = true; services.syncthing.enable = true;
} }