45 lines
1.2 KiB
Nix
45 lines
1.2 KiB
Nix
{ pkgs, ... }:
|
|
|
|
{
|
|
users.users.chris = {
|
|
uid = 1000;
|
|
isNormalUser = true;
|
|
hashedPasswordFile = "/persist/passwords/chris";
|
|
shell = pkgs.zsh;
|
|
extraGroups = [
|
|
"chris"
|
|
"wheel"
|
|
"networkmanager"
|
|
"docker"
|
|
];
|
|
};
|
|
users.users.test = {
|
|
uid = 1001;
|
|
isNormalUser = true;
|
|
# hashedPasswordFile = "/persist/passwords/chris";
|
|
initialPassword = "changeme123";
|
|
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
|
|
'';
|
|
};
|
|
};
|
|
}
|