From 3934d5303306c05953c2f11b05ebf4a8c5a9b2ca Mon Sep 17 00:00:00 2001 From: beatzaplenty Date: Mon, 21 Jul 2025 13:11:30 +1000 Subject: [PATCH] modified: installer.nix --- installer.nix | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/installer.nix b/installer.nix index ae8d0ec..3f02902 100644 --- a/installer.nix +++ b/installer.nix @@ -53,15 +53,15 @@ environment.etc."git-credentials".text = ''; environment.etc."auto-install.sh".mode = "0755"; -environment.etc."nixos/.bash_profile".text = '' - if [[ $- == *i* ]]; then - echo "Launching installer script..." - sudo /etc/auto-install.sh - mv ~/.bash_profile ~/.bash_profile.done 2>/dev/null || true - exit - fi -''; -environment.etc."nixos/.bash_profile".mode = "0755"; + # Trigger the script from nixos user's shell + environment.etc."nixos/.bashrc".text = '' + # Run installer only once + if [ -n "$PS1" ] && [ ! -e ~/.auto_install_ran ]; then + sudo /etc/auto-install.sh + touch ~/.auto_install_ran + fi + ''; + environment.etc."nixos/.bashrc".mode = "0755"; # systemd.services.autoInstallInteractive = { # description = "Interactive NixOS installer on tty1";