Recreated nix files
This commit is contained in:
@@ -929,9 +929,14 @@ let
|
||||
script = pkgs.writeShellScriptBin "startScript" ''
|
||||
#!${pkgs.bash}/bin/bash
|
||||
set -euo pipefail
|
||||
export HOME=$(getent passwd henrov | cut -d: -f6)
|
||||
cd "$HOME"
|
||||
${userScript}/bin/bash -c "./start_script.sh"
|
||||
# Get the home directory of the user who ran 'nixos-rebuild switch' (usually root, so use SUDO_USER)
|
||||
USER_HOME=$(getent passwd "$SUDO_USER" | cut -d: -f6)
|
||||
if [ -z "$USER_HOME" ]; then
|
||||
# Fallback: use the first user in /home
|
||||
USER_HOME=$(ls -d /home/* | head -n 1)
|
||||
fi
|
||||
cd "$USER_HOME"
|
||||
${userScript}
|
||||
'';
|
||||
in
|
||||
{
|
||||
@@ -941,8 +946,6 @@ in
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
#+end_src
|
||||
|
||||
** end_script.nix.nix
|
||||
|
||||
Reference in New Issue
Block a user