From 9db659d54ed221edc583974352e77541b868873e Mon Sep 17 00:00:00 2001 From: beatzaplenty Date: Sun, 19 Jul 2026 13:29:35 +1000 Subject: [PATCH] updated --- common.nix | 13 +++++++++++++ installer.nix | 8 -------- proxmox-lxc.nix | 8 -------- 3 files changed, 13 insertions(+), 16 deletions(-) diff --git a/common.nix b/common.nix index 7891f85..3cdb883 100644 --- a/common.nix +++ b/common.nix @@ -27,6 +27,19 @@ environment.etc."git-credentials".text = "https://beatzaplenty:294be99829703536e02fdeed893137f1d8d96b76@gitea.lan.ddnsgeek.com"; + # Run the installer on first login. Previously this copied an /etc file + # into the nixos user's ~/.bash_profile via an activation script that + # got dropped in a refactor (and only ever worked for that one user + # anyway) — loginShellInit is NixOS's native hook for this, applies to + # any user's login shell (root included), and needs no home-directory + # file-copying/chown. + programs.bash.loginShellInit = '' + if [ -n "$PS1" ] && [ ! -e "$HOME/.auto_install_ran" ]; then + sudo /etc/auto-install.sh + touch "$HOME/.auto_install_ran" + fi + ''; + services.openssh.enable = true; diff --git a/installer.nix b/installer.nix index 8bb839e..cf9ff05 100644 --- a/installer.nix +++ b/installer.nix @@ -12,12 +12,4 @@ # boot.kernelParams = [ # "console=ttyS0,19200n8" # ]; - - # Run installer when logging in (same pattern as proxmox-lxc.nix) - environment.etc."bash_profile-nixos".text = '' - if [ -n "$PS1" ] && [ ! -e ~/.auto_install_ran ]; then - sudo /etc/auto-install.sh - touch ~/.auto_install_ran - fi - ''; } \ No newline at end of file diff --git a/proxmox-lxc.nix b/proxmox-lxc.nix index 0e665dd..23c0884 100644 --- a/proxmox-lxc.nix +++ b/proxmox-lxc.nix @@ -20,13 +20,5 @@ # mode = "0755"; # }; - - # Run installer when logging in - environment.etc."bash_profile-nixos".text = '' - if [ -n "$PS1" ] && [ ! -e ~/.auto_install_ran ]; then - sudo /etc/auto-install.sh - touch ~/.auto_install_ran - fi - ''; # networking.useDHCP = true; } \ No newline at end of file