diff --git a/modules/home/caem/core/security.nix b/modules/home/caem/core/security.nix new file mode 100644 index 0000000..86f15c3 --- /dev/null +++ b/modules/home/caem/core/security.nix @@ -0,0 +1,8 @@ +{ config, ... }: + +{ + programs.gpg = { + enable = true; + homedir = "${config.xdg.dataHome}"; + }; +} diff --git a/modules/nixos/core/security.nix b/modules/nixos/core/security.nix index 81112ec..3b183e0 100644 --- a/modules/nixos/core/security.nix +++ b/modules/nixos/core/security.nix @@ -1,4 +1,4 @@ -{ ... }: +{ username, config, ... }: { programs.gnupg.agent = { @@ -31,4 +31,11 @@ }; sops.age.keyFile = "/nix/config/keys.txt"; + + environment.persistence."/nix/persist" = { + users."${username}".directories = [ + ".ssh" + "${config.xdg.dataHome}/gnupg" + ]; + }; } diff --git a/modules/nixos/user/caem.nix b/modules/nixos/user/caem.nix index cff0e3b..77f681f 100644 --- a/modules/nixos/user/caem.nix +++ b/modules/nixos/user/caem.nix @@ -16,6 +16,7 @@ "videos" "programming" ".ssh" + ".local/gnupg" ]; }; };