Update files
This commit is contained in:
1
initial-configs/passwords/chris
Normal file
1
initial-configs/passwords/chris
Normal file
@@ -0,0 +1 @@
|
||||
$6$MCVd.EUOYYB0A1eS$S1/gSfAq1c2dBCofvJp9RtW.o5mLi78h0Y39LABIeIauPRjlEny/1R5aXEA7uPrZ3TPxhnYOYxTdbCi0imFZp.
|
||||
@@ -4,7 +4,7 @@
|
||||
users.users.chris = {
|
||||
uid = 1000;
|
||||
isNormalUser = true;
|
||||
initialPassword = "changeme123";
|
||||
hashedPasswordFile = "/persist/passwords/chris";
|
||||
shell = pkgs.zsh;
|
||||
extraGroups = [
|
||||
"chris"
|
||||
@@ -13,4 +13,20 @@
|
||||
"docker"
|
||||
];
|
||||
};
|
||||
system.activationScripts = {
|
||||
setupInitialPassword = {
|
||||
supportsDryRun = true;
|
||||
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
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user