system: only set initialPassword if mutable users

This commit is contained in:
NullBite 2024-07-03 18:54:13 -04:00
parent 8f7e6a72c1
commit b61e2acb4f
Signed by: nullbite
GPG Key ID: 6C4D545385D4925A
2 changed files with 5 additions and 2 deletions

View File

@ -107,7 +107,6 @@ in {
users.mutableUsers = false;
users.users.nullbite.hashedPasswordFile = "/persist/passfile/nullbite";
users.users.nullbite.initialPassword = null;
users.users.root.hashedPasswordFile = "/persist/passfile/root";
};
}

View File

@ -16,8 +16,12 @@ in
packages = with pkgs; [
keychain
];
initialPassword = lib.mkDefault "changeme";
shell = pkgs.zsh;
# this should only be configured if mutableUsers is enabled, otherwise it
# behaves the same as `password` and takes precedence over
# `hashedPasswordFile`, which is undesirable.
initialPassword = lib.mkIf config.users.mutableUsers (lib.mkDefault "changeme");
};
users.groups.nullbite.gid = 1000;