{ user ? throw "user argument is required", }: { config, inputs, lib, ... }: let sopsKeyPath = ".config/sops-nix/key.txt"; in { home-manager.users.${user.name} = { imports = [ inputs.sops-nix.homeManagerModules.sops ]; sops.age.keyFile = "/persist${user.home}/${sopsKeyPath}"; home = { persistence."/persist${user.home}".files = [ sopsKeyPath ]; sessionVariables.SOPS_AGE_KEY_FILE = "${user.home}/${sopsKeyPath}"; }; }; }