@@ -271,21 +271,20 @@ jobs:
271271
272272 case "$dep" in
273273 nix)
274- # Install Nix
274+ # Install Nix using pkgforge devscripts
275275 if ! command -v nix &>/dev/null; then
276- curl -fsSL https://nixos.org/nix/install | sh -s -- --daemon --yes
276+ curl -qfsSL "https://raw.githubusercontent.com/pkgforge/devscripts/refs/heads/main/Linux/install_nix.sh" -o "/tmp/install_nix.sh"
277+ chmod +x "/tmp/install_nix.sh"
278+ bash "/tmp/install_nix.sh"
279+ rm -f "/tmp/install_nix.sh"
277280 fi
278281 # Source nix environment
279- if [[ -f /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh ]]; then
280- source / nix/var/ nix/profiles/default/ etc/profile.d/nix-daemon .sh
281- fi
282+ [[ -f "${HOME}/.bash_profile" ]] && source "${HOME}/.bash_profile"
283+ [[ -f "${HOME}/. nix-profile/etc/profile.d/ nix.sh" ]] && source "${HOME}/.nix-profile/ etc/profile.d/nix.sh"
284+ [[ -f /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh ]] && source /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
282285 # Add nix to PATH for subsequent steps
283286 echo "/nix/var/nix/profiles/default/bin" >> "$GITHUB_PATH"
284287 echo "${HOME}/.nix-profile/bin" >> "$GITHUB_PATH"
285- # Symlink nix binaries to /usr/local/bin for child processes
286- for bin in /nix/var/nix/profiles/default/bin/*; do
287- sudo ln -sf "$bin" /usr/local/bin/ 2>/dev/null || true
288- done
289288 # Configure nix
290289 echo "access-tokens = github.com=${GITHUB_TOKEN}" | sudo tee -a /etc/nix/nix.conf
291290 # Set environment variables
@@ -294,6 +293,8 @@ jobs:
294293 echo "NIXPKGS_ALLOW_INSECURE=1" >> "$GITHUB_ENV"
295294 echo "NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM=1" >> "$GITHUB_ENV"
296295 echo "NIX_INSTALLED=true" >> "$GITHUB_ENV"
296+ # Export full PATH with nix for child processes
297+ echo "PATH=/nix/var/nix/profiles/default/bin:${HOME}/.nix-profile/bin:${PATH}" >> "$GITHUB_ENV"
297298 nix --version
298299 ;;
299300
@@ -399,14 +400,6 @@ jobs:
399400 run : |
400401 set +e # Don't exit on error, we want to capture the result
401402
402- # Source nix if installed
403- if [[ "${NIX_INSTALLED:-}" == "true" ]]; then
404- if [[ -f /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh ]]; then
405- source /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
406- fi
407- export PATH="/nix/var/nix/profiles/default/bin:${HOME}/.nix-profile/bin:$PATH"
408- fi
409-
410403 SBUILD="${SYSTMP}/sbuild"
411404 if [[ "${QEMU_MODE:-}" == "true" ]]; then
412405 SBUILD="${SYSTMP}/sbuild-riscv64"
0 commit comments