Files
nixos/system/users.nix

45 lines
1.2 KiB
Nix
Raw Normal View History

2026-03-09 21:43:40 +00:00
{ pkgs, ... }:
{
users.users.chris = {
uid = 1000;
isNormalUser = true;
2026-03-22 21:48:00 +00:00
hashedPasswordFile = "/persist/passwords/chris";
shell = pkgs.zsh;
extraGroups = [
"chris"
"wheel"
"networkmanager"
"docker"
];
};
users.users.test = {
uid = 1001;
isNormalUser = true;
2026-03-22 21:36:40 +00:00
# hashedPasswordFile = "/persist/passwords/chris";
initialPassword = "changeme123";
2026-03-09 21:43:40 +00:00
shell = pkgs.zsh;
extraGroups = [
"chris"
2026-03-12 23:38:13 +00:00
"wheel"
"networkmanager"
2026-03-21 17:28:54 +00:00
"docker"
2026-03-09 21:43:40 +00:00
];
};
2026-03-22 21:23:48 +00:00
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
'';
};
};
2026-03-09 21:43:40 +00:00
}