diff options
author | Tim Keller <tjk@tjkeller.xyz> | 2025-07-18 14:47:10 -0500 |
---|---|---|
committer | Tim Keller <tjk@tjkeller.xyz> | 2025-07-18 14:47:10 -0500 |
commit | 19ecf4423b5e7ba8f4d22a776315bf65a23ce8df (patch) | |
tree | d18ed5985d4e0f40d2666a3996f7d8781b304fd3 /modules/root/normaluser.nix | |
parent | 842e31b4acbb591dc413f30fce139f1e51a26d3e (diff) | |
download | nixos-19ecf4423b5e7ba8f4d22a776315bf65a23ce8df.tar.xz nixos-19ecf4423b5e7ba8f4d22a776315bf65a23ce8df.zip |
cleanup secrets
Diffstat (limited to 'modules/root/normaluser.nix')
-rw-r--r-- | modules/root/normaluser.nix | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/modules/root/normaluser.nix b/modules/root/normaluser.nix index ec266c4..50e9236 100644 --- a/modules/root/normaluser.nix +++ b/modules/root/normaluser.nix @@ -4,13 +4,20 @@ }; config = { - users.users.root = lib.mkIf config.users.setPassword.enable { - hashedPasswordFile = config.sops.secrets.hashed-root-password.path; + # Load hashed root password secret + sops.secrets.hashed-root-password = lib.mkIf config.users.setPassword.enable { + sopsFile = ./resources/secrets/hashed-root-password.yaml; + neededForUsers = true; }; + + # Set hashed password file if the setPassword option is enabled + users.users.root.hashedPasswordFile = lib.mkIf config.users.setPassword.enable config.sops.secrets.hashed-root-password.path; + + # Setup normal user users.users.${userDetails.username} = { + home = userDetails.home; description = userDetails.fullname; isNormalUser = true; - hashedPasswordFile = lib.mkIf config.users.setPassword.enable config.sops.secrets.hashed-root-password.path; extraGroups = [ "i2c" "libvirtd" @@ -18,6 +25,7 @@ "video" "wheel" ]; + hashedPasswordFile = lib.mkIf config.users.setPassword.enable config.sops.secrets.hashed-root-password.path; }; }; } |