If you are looking at this, you know who you are Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
21 lines
585 B
Nix
21 lines
585 B
Nix
{ user, home }:
|
|
{ config, inputs, ... }:
|
|
{
|
|
environment.persistence."/persist/state"."${home}/.config/sops-nix/key.txt" = { };
|
|
|
|
home-manager.users.${user} =
|
|
let
|
|
sopsKeyFile =
|
|
if config.environment.impermanence.enable then
|
|
config.environment.persistence."/persist/state"."${home}/.config/sops-nix/key.txt".source
|
|
else
|
|
"${home}/.config/sops-nix/key.txt";
|
|
in
|
|
{
|
|
imports = [ inputs.sops-nix.homeManagerModules.sops ];
|
|
|
|
sops.age.keyFile = sopsKeyFile;
|
|
home.sessionVariables.SOPS_AGE_KEY_FILE = sopsKeyFile;
|
|
};
|
|
}
|