Recreated nix files
This commit is contained in:
+304
-301
File diff suppressed because it is too large
Load Diff
@@ -929,9 +929,14 @@ let
|
|||||||
script = pkgs.writeShellScriptBin "startScript" ''
|
script = pkgs.writeShellScriptBin "startScript" ''
|
||||||
#!${pkgs.bash}/bin/bash
|
#!${pkgs.bash}/bin/bash
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
export HOME=$(getent passwd henrov | cut -d: -f6)
|
# Get the home directory of the user who ran 'nixos-rebuild switch' (usually root, so use SUDO_USER)
|
||||||
cd "$HOME"
|
USER_HOME=$(getent passwd "$SUDO_USER" | cut -d: -f6)
|
||||||
${userScript}/bin/bash -c "./start_script.sh"
|
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
|
in
|
||||||
{
|
{
|
||||||
@@ -941,8 +946,6 @@ in
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
** end_script.nix.nix
|
** end_script.nix.nix
|
||||||
|
|||||||
@@ -9,9 +9,14 @@ let
|
|||||||
script = pkgs.writeShellScriptBin "startScript" ''
|
script = pkgs.writeShellScriptBin "startScript" ''
|
||||||
#!${pkgs.bash}/bin/bash
|
#!${pkgs.bash}/bin/bash
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
export HOME=$(getent passwd henrov | cut -d: -f6)
|
# Get the home directory of the user who ran 'nixos-rebuild switch' (usually root, so use SUDO_USER)
|
||||||
cd "$HOME"
|
USER_HOME=$(getent passwd "$SUDO_USER" | cut -d: -f6)
|
||||||
${userScript}/bin/bash -c "./start_script.sh"
|
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
|
in
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user