modified: installer.nix
This commit is contained in:
+18
-10
@@ -97,20 +97,28 @@ users.users.root = {
|
|||||||
# environment.etc."home/nixos/.bashrc".mode = "0644";
|
# environment.etc."home/nixos/.bashrc".mode = "0644";
|
||||||
|
|
||||||
# Write .bashrc into the user's home directory
|
# Write .bashrc into the user's home directory
|
||||||
environment.etc."bashrc-nixos".source = pkgs.writeText "bashrc-nixos" ''
|
# environment.etc."bashrc-nixos".source = pkgs.writeText "bashrc-nixos" ''
|
||||||
|
# if [ -n "$PS1" ] && [ ! -e ~/.auto_install_ran ]; then
|
||||||
|
# sudo /etc/auto-install.sh
|
||||||
|
# touch ~/.auto_install_ran
|
||||||
|
# fi
|
||||||
|
# '';
|
||||||
|
|
||||||
|
system.activationScripts.installBashProfile = {
|
||||||
|
text = ''
|
||||||
|
mkdir -p /home/nixos
|
||||||
|
cp -f ${config.environment.etc."bash_profile-nixos".source} /home/nixos/.bash_profile
|
||||||
|
chown nixos:nixos /home/nixos/.bash_profile
|
||||||
|
chmod 644 /home/nixos/.bash_profile
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
environment.etc."bash_profile-nixos".source = pkgs.writeText "bash_profile-nixos" ''
|
||||||
if [ -n "$PS1" ] && [ ! -e ~/.auto_install_ran ]; then
|
if [ -n "$PS1" ] && [ ! -e ~/.auto_install_ran ]; then
|
||||||
sudo /etc/auto-install.sh
|
sudo /etc/auto-install.sh
|
||||||
touch ~/.auto_install_ran
|
touch ~/.auto_install_ran
|
||||||
fi
|
fi
|
||||||
'';
|
'';
|
||||||
|
|
||||||
system.activationScripts.installBashrc = {
|
|
||||||
text = ''
|
|
||||||
mkdir -p /home/nixos
|
|
||||||
cp -f ${config.environment.etc."bashrc-nixos".source} /home/nixos/.bashrc
|
|
||||||
chown nixos:nixos /home/nixos/.bashrc
|
|
||||||
chmod 644 /home/nixos/.bashrc
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user