Files
nixos/system/users.nix
2026-03-22 21:25:04 +00:00

32 lines
866 B
Nix

{ pkgs, ... }:
{
users.users.chris = {
uid = 1000;
isNormalUser = true;
hashedPasswordFile = "/persist/passwords/chris";
shell = pkgs.zsh;
extraGroups = [
"chris"
"wheel"
"networkmanager"
"docker"
];
};
system.activationScripts = {
setupInitialPassword = {
text = ''
# Ensure the directory exists
mkdir -p /persist/passwords
# Copy the initial hash if the file is missing
if [ ! -f /persist/passwords/chris ]; then
cp ${../initial-configs/passwords/chris} /persist/passwords/chris
chmod 600 /persist/passwords/chris
chown root:root /persist/passwords/chris
fi
'';
};
};
}