From e3febc262f4417cdd810c01df163b89133441426 Mon Sep 17 00:00:00 2001 From: John Lago <750845+Lagoja@users.noreply.github.com> Date: Thu, 11 Sep 2025 16:40:34 -0700 Subject: [PATCH 01/12] Try moving to Nix Experimental installer --- action.yml | 2 +- experimental-nix-installer-action.yml | 130 ++++++++++++++++++++++++++ 2 files changed, 131 insertions(+), 1 deletion(-) create mode 100644 experimental-nix-installer-action.yml diff --git a/action.yml b/action.yml index 181f930..511a671 100644 --- a/action.yml +++ b/action.yml @@ -144,7 +144,7 @@ runs: - name: Install nix if: inputs.skip-nix-installation == 'false' - uses: DeterminateSystems/nix-installer-action@90bb610b90bf290cad97484ba341453bd1cbefea # v19 + uses: ./experimental-nix-installer-action.yml with: logger: pretty extra-conf: experimental-features = ca-derivations fetch-closure diff --git a/experimental-nix-installer-action.yml b/experimental-nix-installer-action.yml new file mode 100644 index 0000000..ad9ca1a --- /dev/null +++ b/experimental-nix-installer-action.yml @@ -0,0 +1,130 @@ +name: 'Experimental Nix Installer' +description: 'Install Nix using the experimental installer' +branding: + icon: 'box' + color: 'blue' + +inputs: + extra-conf: + description: 'Extra configuration to add to nix.conf' + default: '' + logger: + description: 'Logger format (compact, full, pretty)' + default: 'pretty' + nix-build-user-count: + description: 'Number of build users to create' + default: '32' + nix-build-group-name: + description: 'Name of the build group' + default: 'nixbld' + nix-build-group-id: + description: 'GID of the build group' + default: '30000' + nix-package-url: + description: 'URL to download Nix package from' + default: '' + proxy: + description: 'Proxy URL for downloads' + default: '' + ssl-cert-file: + description: 'Path to SSL certificate file' + default: '' + modify-profile: + description: 'Modify user profile to set up environment' + default: 'true' + daemon: + description: 'Use daemon mode' + default: 'true' + init: + description: 'Init mode for installation' + default: 'systemd' + start-daemon: + description: 'Start the Nix daemon after installation' + default: 'true' + trust-runner-user: + description: 'Add runner user to trusted users' + default: 'true' + flake-registry: + description: 'Flake registry URL' + default: '' + channels: + description: 'Nix channels to add' + default: 'nixpkgs=https://nixos.org/channels/nixpkgs-unstable' + +outputs: + nix-version: + description: 'The version of Nix that was installed' + value: ${{ steps.nix-install.outputs.nix-version }} + +runs: + using: "composite" + steps: + - name: Download and install experimental Nix installer + id: nix-install + shell: bash + env: + NIX_INSTALLER_EXTRA_CONF: ${{ inputs.extra-conf }} + NIX_INSTALLER_LOGGER: ${{ inputs.logger }} + NIX_INSTALLER_NIX_BUILD_USER_COUNT: ${{ inputs.nix-build-user-count }} + NIX_INSTALLER_NIX_BUILD_GROUP_NAME: ${{ inputs.nix-build-group-name }} + NIX_INSTALLER_NIX_BUILD_GROUP_ID: ${{ inputs.nix-build-group-id }} + NIX_INSTALLER_NIX_PACKAGE_URL: ${{ inputs.nix-package-url }} + NIX_INSTALLER_PROXY: ${{ inputs.proxy }} + NIX_INSTALLER_SSL_CERT_FILE: ${{ inputs.ssl-cert-file }} + NIX_INSTALLER_MODIFY_PROFILE: ${{ inputs.modify-profile }} + NIX_INSTALLER_DAEMON: ${{ inputs.daemon }} + NIX_INSTALLER_INIT: ${{ inputs.init }} + NIX_INSTALLER_START_DAEMON: ${{ inputs.start-daemon }} + NIX_INSTALLER_TRUST_RUNNER_USER: ${{ inputs.trust-runner-user }} + NIX_INSTALLER_FLAKE_REGISTRY: ${{ inputs.flake-registry }} + NIX_INSTALLER_CHANNELS: ${{ inputs.channels }} + run: | + echo "Installing Nix using experimental installer..." + + # Download and run the experimental installer + curl --proto '=https' --tlsv1.2 -sSf -L https://artifacts.nixos.org/experimental-installer | \ + sh -s -- install + + # Source the nix profile to make nix available in current shell + if [ -f ~/.nix-profile/etc/profile.d/nix.sh ]; then + source ~/.nix-profile/etc/profile.d/nix.sh + elif [ -f /etc/profile.d/nix.sh ]; then + source /etc/profile.d/nix.sh + fi + + # Get Nix version and set output + NIX_VERSION=$(nix --version | awk '{print $NF}') + echo "nix-version=$NIX_VERSION" >> $GITHUB_OUTPUT + echo "Installed Nix version: $NIX_VERSION" + + # Verify installation + nix --version + nix-env --version + + - name: Add extra configuration + if: inputs.extra-conf != '' + shell: bash + run: | + echo "Adding extra Nix configuration..." + mkdir -p ~/.config/nix + echo "${{ inputs.extra-conf }}" >> ~/.config/nix/nix.conf + echo "Extra configuration added to nix.conf" + + - name: Configure GitHub access token + if: github.server_url == 'https://github.com' + shell: bash + run: | + echo "Configuring GitHub access token for Nix..." + mkdir -p ~/.config/nix + echo "access-tokens = github.com=${{ github.token }}" >> ~/.config/nix/nix.conf + echo "GitHub access token configured" + + - name: Verify Nix installation + shell: bash + run: | + echo "Verifying Nix installation..." + echo "Nix version: $(nix --version)" + echo "Nix store info:" + nix store info || echo "Store info not available" + echo "Nix channels:" + nix-channel --list || echo "No channels configured" From c8e141c4224a7f56d560bfc77e8c3a655257fe1f Mon Sep 17 00:00:00 2001 From: John Lago <750845+Lagoja@users.noreply.github.com> Date: Thu, 11 Sep 2025 16:44:40 -0700 Subject: [PATCH 02/12] Fix action directory structure --- action.yml | 2 +- experimental-nix-installer/action.yml | 130 ++++++++++++++++++++++++++ 2 files changed, 131 insertions(+), 1 deletion(-) create mode 100644 experimental-nix-installer/action.yml diff --git a/action.yml b/action.yml index 511a671..f2b320a 100644 --- a/action.yml +++ b/action.yml @@ -144,7 +144,7 @@ runs: - name: Install nix if: inputs.skip-nix-installation == 'false' - uses: ./experimental-nix-installer-action.yml + uses: ./experimental-nix-installer with: logger: pretty extra-conf: experimental-features = ca-derivations fetch-closure diff --git a/experimental-nix-installer/action.yml b/experimental-nix-installer/action.yml new file mode 100644 index 0000000..ad9ca1a --- /dev/null +++ b/experimental-nix-installer/action.yml @@ -0,0 +1,130 @@ +name: 'Experimental Nix Installer' +description: 'Install Nix using the experimental installer' +branding: + icon: 'box' + color: 'blue' + +inputs: + extra-conf: + description: 'Extra configuration to add to nix.conf' + default: '' + logger: + description: 'Logger format (compact, full, pretty)' + default: 'pretty' + nix-build-user-count: + description: 'Number of build users to create' + default: '32' + nix-build-group-name: + description: 'Name of the build group' + default: 'nixbld' + nix-build-group-id: + description: 'GID of the build group' + default: '30000' + nix-package-url: + description: 'URL to download Nix package from' + default: '' + proxy: + description: 'Proxy URL for downloads' + default: '' + ssl-cert-file: + description: 'Path to SSL certificate file' + default: '' + modify-profile: + description: 'Modify user profile to set up environment' + default: 'true' + daemon: + description: 'Use daemon mode' + default: 'true' + init: + description: 'Init mode for installation' + default: 'systemd' + start-daemon: + description: 'Start the Nix daemon after installation' + default: 'true' + trust-runner-user: + description: 'Add runner user to trusted users' + default: 'true' + flake-registry: + description: 'Flake registry URL' + default: '' + channels: + description: 'Nix channels to add' + default: 'nixpkgs=https://nixos.org/channels/nixpkgs-unstable' + +outputs: + nix-version: + description: 'The version of Nix that was installed' + value: ${{ steps.nix-install.outputs.nix-version }} + +runs: + using: "composite" + steps: + - name: Download and install experimental Nix installer + id: nix-install + shell: bash + env: + NIX_INSTALLER_EXTRA_CONF: ${{ inputs.extra-conf }} + NIX_INSTALLER_LOGGER: ${{ inputs.logger }} + NIX_INSTALLER_NIX_BUILD_USER_COUNT: ${{ inputs.nix-build-user-count }} + NIX_INSTALLER_NIX_BUILD_GROUP_NAME: ${{ inputs.nix-build-group-name }} + NIX_INSTALLER_NIX_BUILD_GROUP_ID: ${{ inputs.nix-build-group-id }} + NIX_INSTALLER_NIX_PACKAGE_URL: ${{ inputs.nix-package-url }} + NIX_INSTALLER_PROXY: ${{ inputs.proxy }} + NIX_INSTALLER_SSL_CERT_FILE: ${{ inputs.ssl-cert-file }} + NIX_INSTALLER_MODIFY_PROFILE: ${{ inputs.modify-profile }} + NIX_INSTALLER_DAEMON: ${{ inputs.daemon }} + NIX_INSTALLER_INIT: ${{ inputs.init }} + NIX_INSTALLER_START_DAEMON: ${{ inputs.start-daemon }} + NIX_INSTALLER_TRUST_RUNNER_USER: ${{ inputs.trust-runner-user }} + NIX_INSTALLER_FLAKE_REGISTRY: ${{ inputs.flake-registry }} + NIX_INSTALLER_CHANNELS: ${{ inputs.channels }} + run: | + echo "Installing Nix using experimental installer..." + + # Download and run the experimental installer + curl --proto '=https' --tlsv1.2 -sSf -L https://artifacts.nixos.org/experimental-installer | \ + sh -s -- install + + # Source the nix profile to make nix available in current shell + if [ -f ~/.nix-profile/etc/profile.d/nix.sh ]; then + source ~/.nix-profile/etc/profile.d/nix.sh + elif [ -f /etc/profile.d/nix.sh ]; then + source /etc/profile.d/nix.sh + fi + + # Get Nix version and set output + NIX_VERSION=$(nix --version | awk '{print $NF}') + echo "nix-version=$NIX_VERSION" >> $GITHUB_OUTPUT + echo "Installed Nix version: $NIX_VERSION" + + # Verify installation + nix --version + nix-env --version + + - name: Add extra configuration + if: inputs.extra-conf != '' + shell: bash + run: | + echo "Adding extra Nix configuration..." + mkdir -p ~/.config/nix + echo "${{ inputs.extra-conf }}" >> ~/.config/nix/nix.conf + echo "Extra configuration added to nix.conf" + + - name: Configure GitHub access token + if: github.server_url == 'https://github.com' + shell: bash + run: | + echo "Configuring GitHub access token for Nix..." + mkdir -p ~/.config/nix + echo "access-tokens = github.com=${{ github.token }}" >> ~/.config/nix/nix.conf + echo "GitHub access token configured" + + - name: Verify Nix installation + shell: bash + run: | + echo "Verifying Nix installation..." + echo "Nix version: $(nix --version)" + echo "Nix store info:" + nix store info || echo "Store info not available" + echo "Nix channels:" + nix-channel --list || echo "No channels configured" From f596b086681a1c77692d2788b0dcacee99b223bf Mon Sep 17 00:00:00 2001 From: John Lago <750845+Lagoja@users.noreply.github.com> Date: Thu, 11 Sep 2025 16:46:25 -0700 Subject: [PATCH 03/12] run --no-interactive --- experimental-nix-installer/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/experimental-nix-installer/action.yml b/experimental-nix-installer/action.yml index ad9ca1a..5e05277 100644 --- a/experimental-nix-installer/action.yml +++ b/experimental-nix-installer/action.yml @@ -83,7 +83,7 @@ runs: # Download and run the experimental installer curl --proto '=https' --tlsv1.2 -sSf -L https://artifacts.nixos.org/experimental-installer | \ - sh -s -- install + sh -s -- install --no-confirm # Source the nix profile to make nix available in current shell if [ -f ~/.nix-profile/etc/profile.d/nix.sh ]; then From ad937bd4a30ed9896089e6d29154f0b8870395c4 Mon Sep 17 00:00:00 2001 From: John Lago <750845+Lagoja@users.noreply.github.com> Date: Thu, 11 Sep 2025 16:48:56 -0700 Subject: [PATCH 04/12] Remove Nix Package URL --- experimental-nix-installer/action.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/experimental-nix-installer/action.yml b/experimental-nix-installer/action.yml index 5e05277..58993fe 100644 --- a/experimental-nix-installer/action.yml +++ b/experimental-nix-installer/action.yml @@ -20,9 +20,6 @@ inputs: nix-build-group-id: description: 'GID of the build group' default: '30000' - nix-package-url: - description: 'URL to download Nix package from' - default: '' proxy: description: 'Proxy URL for downloads' default: '' @@ -68,8 +65,7 @@ runs: NIX_INSTALLER_NIX_BUILD_USER_COUNT: ${{ inputs.nix-build-user-count }} NIX_INSTALLER_NIX_BUILD_GROUP_NAME: ${{ inputs.nix-build-group-name }} NIX_INSTALLER_NIX_BUILD_GROUP_ID: ${{ inputs.nix-build-group-id }} - NIX_INSTALLER_NIX_PACKAGE_URL: ${{ inputs.nix-package-url }} - NIX_INSTALLER_PROXY: ${{ inputs.proxy }} + NI_INSTALLER_PROXY: ${{ inputs.proxy }} NIX_INSTALLER_SSL_CERT_FILE: ${{ inputs.ssl-cert-file }} NIX_INSTALLER_MODIFY_PROFILE: ${{ inputs.modify-profile }} NIX_INSTALLER_DAEMON: ${{ inputs.daemon }} From 7b21e628a3590756f6928f163d64929b85f1cef2 Mon Sep 17 00:00:00 2001 From: John Lago <750845+Lagoja@users.noreply.github.com> Date: Thu, 11 Sep 2025 16:51:23 -0700 Subject: [PATCH 05/12] Remove unused values --- experimental-nix-installer/action.yml | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/experimental-nix-installer/action.yml b/experimental-nix-installer/action.yml index 58993fe..ae351d1 100644 --- a/experimental-nix-installer/action.yml +++ b/experimental-nix-installer/action.yml @@ -20,12 +20,6 @@ inputs: nix-build-group-id: description: 'GID of the build group' default: '30000' - proxy: - description: 'Proxy URL for downloads' - default: '' - ssl-cert-file: - description: 'Path to SSL certificate file' - default: '' modify-profile: description: 'Modify user profile to set up environment' default: 'true' @@ -41,9 +35,6 @@ inputs: trust-runner-user: description: 'Add runner user to trusted users' default: 'true' - flake-registry: - description: 'Flake registry URL' - default: '' channels: description: 'Nix channels to add' default: 'nixpkgs=https://nixos.org/channels/nixpkgs-unstable' @@ -65,14 +56,10 @@ runs: NIX_INSTALLER_NIX_BUILD_USER_COUNT: ${{ inputs.nix-build-user-count }} NIX_INSTALLER_NIX_BUILD_GROUP_NAME: ${{ inputs.nix-build-group-name }} NIX_INSTALLER_NIX_BUILD_GROUP_ID: ${{ inputs.nix-build-group-id }} - NI_INSTALLER_PROXY: ${{ inputs.proxy }} - NIX_INSTALLER_SSL_CERT_FILE: ${{ inputs.ssl-cert-file }} NIX_INSTALLER_MODIFY_PROFILE: ${{ inputs.modify-profile }} - NIX_INSTALLER_DAEMON: ${{ inputs.daemon }} NIX_INSTALLER_INIT: ${{ inputs.init }} NIX_INSTALLER_START_DAEMON: ${{ inputs.start-daemon }} NIX_INSTALLER_TRUST_RUNNER_USER: ${{ inputs.trust-runner-user }} - NIX_INSTALLER_FLAKE_REGISTRY: ${{ inputs.flake-registry }} NIX_INSTALLER_CHANNELS: ${{ inputs.channels }} run: | echo "Installing Nix using experimental installer..." From 8a67f303852a299d1b5caa3c853d32fec4ac1b3f Mon Sep 17 00:00:00 2001 From: John Lago <750845+Lagoja@users.noreply.github.com> Date: Thu, 11 Sep 2025 17:02:51 -0700 Subject: [PATCH 06/12] Add flakes and nix command by default --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index f2b320a..ccf79d7 100644 --- a/action.yml +++ b/action.yml @@ -147,7 +147,7 @@ runs: uses: ./experimental-nix-installer with: logger: pretty - extra-conf: experimental-features = ca-derivations fetch-closure + extra-conf: experimental-features = ca-derivations fetch-closure nix-command flakes - name: Get nix version shell: bash From 219b7e17e2e804ef16f25d01285d63ac05b795ea Mon Sep 17 00:00:00 2001 From: John Lago <750845+Lagoja@users.noreply.github.com> Date: Thu, 11 Sep 2025 20:33:51 -0700 Subject: [PATCH 07/12] Remove dupe file --- experimental-nix-installer-action.yml | 130 -------------------------- 1 file changed, 130 deletions(-) delete mode 100644 experimental-nix-installer-action.yml diff --git a/experimental-nix-installer-action.yml b/experimental-nix-installer-action.yml deleted file mode 100644 index ad9ca1a..0000000 --- a/experimental-nix-installer-action.yml +++ /dev/null @@ -1,130 +0,0 @@ -name: 'Experimental Nix Installer' -description: 'Install Nix using the experimental installer' -branding: - icon: 'box' - color: 'blue' - -inputs: - extra-conf: - description: 'Extra configuration to add to nix.conf' - default: '' - logger: - description: 'Logger format (compact, full, pretty)' - default: 'pretty' - nix-build-user-count: - description: 'Number of build users to create' - default: '32' - nix-build-group-name: - description: 'Name of the build group' - default: 'nixbld' - nix-build-group-id: - description: 'GID of the build group' - default: '30000' - nix-package-url: - description: 'URL to download Nix package from' - default: '' - proxy: - description: 'Proxy URL for downloads' - default: '' - ssl-cert-file: - description: 'Path to SSL certificate file' - default: '' - modify-profile: - description: 'Modify user profile to set up environment' - default: 'true' - daemon: - description: 'Use daemon mode' - default: 'true' - init: - description: 'Init mode for installation' - default: 'systemd' - start-daemon: - description: 'Start the Nix daemon after installation' - default: 'true' - trust-runner-user: - description: 'Add runner user to trusted users' - default: 'true' - flake-registry: - description: 'Flake registry URL' - default: '' - channels: - description: 'Nix channels to add' - default: 'nixpkgs=https://nixos.org/channels/nixpkgs-unstable' - -outputs: - nix-version: - description: 'The version of Nix that was installed' - value: ${{ steps.nix-install.outputs.nix-version }} - -runs: - using: "composite" - steps: - - name: Download and install experimental Nix installer - id: nix-install - shell: bash - env: - NIX_INSTALLER_EXTRA_CONF: ${{ inputs.extra-conf }} - NIX_INSTALLER_LOGGER: ${{ inputs.logger }} - NIX_INSTALLER_NIX_BUILD_USER_COUNT: ${{ inputs.nix-build-user-count }} - NIX_INSTALLER_NIX_BUILD_GROUP_NAME: ${{ inputs.nix-build-group-name }} - NIX_INSTALLER_NIX_BUILD_GROUP_ID: ${{ inputs.nix-build-group-id }} - NIX_INSTALLER_NIX_PACKAGE_URL: ${{ inputs.nix-package-url }} - NIX_INSTALLER_PROXY: ${{ inputs.proxy }} - NIX_INSTALLER_SSL_CERT_FILE: ${{ inputs.ssl-cert-file }} - NIX_INSTALLER_MODIFY_PROFILE: ${{ inputs.modify-profile }} - NIX_INSTALLER_DAEMON: ${{ inputs.daemon }} - NIX_INSTALLER_INIT: ${{ inputs.init }} - NIX_INSTALLER_START_DAEMON: ${{ inputs.start-daemon }} - NIX_INSTALLER_TRUST_RUNNER_USER: ${{ inputs.trust-runner-user }} - NIX_INSTALLER_FLAKE_REGISTRY: ${{ inputs.flake-registry }} - NIX_INSTALLER_CHANNELS: ${{ inputs.channels }} - run: | - echo "Installing Nix using experimental installer..." - - # Download and run the experimental installer - curl --proto '=https' --tlsv1.2 -sSf -L https://artifacts.nixos.org/experimental-installer | \ - sh -s -- install - - # Source the nix profile to make nix available in current shell - if [ -f ~/.nix-profile/etc/profile.d/nix.sh ]; then - source ~/.nix-profile/etc/profile.d/nix.sh - elif [ -f /etc/profile.d/nix.sh ]; then - source /etc/profile.d/nix.sh - fi - - # Get Nix version and set output - NIX_VERSION=$(nix --version | awk '{print $NF}') - echo "nix-version=$NIX_VERSION" >> $GITHUB_OUTPUT - echo "Installed Nix version: $NIX_VERSION" - - # Verify installation - nix --version - nix-env --version - - - name: Add extra configuration - if: inputs.extra-conf != '' - shell: bash - run: | - echo "Adding extra Nix configuration..." - mkdir -p ~/.config/nix - echo "${{ inputs.extra-conf }}" >> ~/.config/nix/nix.conf - echo "Extra configuration added to nix.conf" - - - name: Configure GitHub access token - if: github.server_url == 'https://github.com' - shell: bash - run: | - echo "Configuring GitHub access token for Nix..." - mkdir -p ~/.config/nix - echo "access-tokens = github.com=${{ github.token }}" >> ~/.config/nix/nix.conf - echo "GitHub access token configured" - - - name: Verify Nix installation - shell: bash - run: | - echo "Verifying Nix installation..." - echo "Nix version: $(nix --version)" - echo "Nix store info:" - nix store info || echo "Store info not available" - echo "Nix channels:" - nix-channel --list || echo "No channels configured" From b71faa2c81f5a617a376d801e84ef498d3a015a2 Mon Sep 17 00:00:00 2001 From: John Lago <750845+Lagoja@users.noreply.github.com> Date: Fri, 12 Sep 2025 14:00:07 -0700 Subject: [PATCH 08/12] fix subdir --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index ccf79d7..ad11762 100644 --- a/action.yml +++ b/action.yml @@ -144,7 +144,7 @@ runs: - name: Install nix if: inputs.skip-nix-installation == 'false' - uses: ./experimental-nix-installer + uses: ${GITHUB_ACTION_PATH}/experimental-nix-installer with: logger: pretty extra-conf: experimental-features = ca-derivations fetch-closure nix-command flakes From cda181e4639be69305fcb752eaa776cc5862807e Mon Sep 17 00:00:00 2001 From: John Lago <750845+Lagoja@users.noreply.github.com> Date: Fri, 12 Sep 2025 14:11:16 -0700 Subject: [PATCH 09/12] undo change --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index ad11762..ccf79d7 100644 --- a/action.yml +++ b/action.yml @@ -144,7 +144,7 @@ runs: - name: Install nix if: inputs.skip-nix-installation == 'false' - uses: ${GITHUB_ACTION_PATH}/experimental-nix-installer + uses: ./experimental-nix-installer with: logger: pretty extra-conf: experimental-features = ca-derivations fetch-closure nix-command flakes From 5b8159da4d5c3fbc4a510303930b52db1249e9f5 Mon Sep 17 00:00:00 2001 From: John Lago <750845+Lagoja@users.noreply.github.com> Date: Fri, 12 Sep 2025 14:25:29 -0700 Subject: [PATCH 10/12] Inline the nix install steps --- action.yml | 44 +++++++++++++++++++++++++++++++++++++++----- 1 file changed, 39 insertions(+), 5 deletions(-) diff --git a/action.yml b/action.yml index ccf79d7..a37ce00 100644 --- a/action.yml +++ b/action.yml @@ -142,12 +142,46 @@ runs: mkdir -p ~/.config/nix echo "${{ inputs.extra-nix-config }}" >> ~/.config/nix/nix.conf - - name: Install nix + - name: Download and install experimental Nix installer if: inputs.skip-nix-installation == 'false' - uses: ./experimental-nix-installer - with: - logger: pretty - extra-conf: experimental-features = ca-derivations fetch-closure nix-command flakes + shell: bash + run: | + echo "Installing Nix using experimental installer..." + + # Download and run the experimental installer + curl --proto '=https' --tlsv1.2 -sSf -L https://artifacts.nixos.org/experimental-installer | \ + sh -s -- install --no-confirm + + # Source the nix profile to make nix available in current shell + if [ -f ~/.nix-profile/etc/profile.d/nix.sh ]; then + source ~/.nix-profile/etc/profile.d/nix.sh + elif [ -f /etc/profile.d/nix.sh ]; then + source /etc/profile.d/nix.sh + fi + + # Verify installation + nix --version + nix-env --version + + - name: Add experimental Nix configuration + if: inputs.skip-nix-installation == 'false' + shell: bash + run: | + echo "Adding experimental Nix configuration..." + mkdir -p ~/.config/nix + echo "experimental-features = ca-derivations fetch-closure nix-command flakes" >> ~/.config/nix/nix.conf + echo "Experimental configuration added to nix.conf" + + - name: Verify Nix installation + if: inputs.skip-nix-installation == 'false' + shell: bash + run: | + echo "Verifying Nix installation..." + echo "Nix version: $(nix --version)" + echo "Nix store info:" + nix store info || echo "Store info not available" + echo "Nix channels:" + nix-channel --list || echo "No channels configured" - name: Get nix version shell: bash From a0ed4fc875ba2e0169617f170e9998866cfee5ce Mon Sep 17 00:00:00 2001 From: John Lago <750845+Lagoja@users.noreply.github.com> Date: Fri, 12 Sep 2025 14:56:30 -0700 Subject: [PATCH 11/12] Add Environment Variables --- action.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/action.yml b/action.yml index a37ce00..c7e1490 100644 --- a/action.yml +++ b/action.yml @@ -145,6 +145,11 @@ runs: - name: Download and install experimental Nix installer if: inputs.skip-nix-installation == 'false' shell: bash + env: + NIX_INSTALLER_LOGGER: pretty + NIX_INSTALLER_TRUST_RUNNER_USER: true + NIX_INSTALLER_MODIFY_PROFILE: true + NIX_INSTALLER_START_DAEMON: true run: | echo "Installing Nix using experimental installer..." From 3bbb7a8d727c680a2c715eef1b885468c4042636 Mon Sep 17 00:00:00 2001 From: John Lago <750845+Lagoja@users.noreply.github.com> Date: Fri, 12 Sep 2025 15:04:11 -0700 Subject: [PATCH 12/12] Pull in all variables --- action.yml | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/action.yml b/action.yml index c7e1490..8357f88 100644 --- a/action.yml +++ b/action.yml @@ -146,10 +146,16 @@ runs: if: inputs.skip-nix-installation == 'false' shell: bash env: + NIX_INSTALLER_EXTRA_CONF: experimental-features = ca-derivations fetch-closure nix-command flakes NIX_INSTALLER_LOGGER: pretty - NIX_INSTALLER_TRUST_RUNNER_USER: true + NIX_INSTALLER_NIX_BUILD_USER_COUNT: 32 + NIX_INSTALLER_NIX_BUILD_GROUP_NAME: nixbld + NIX_INSTALLER_NIX_BUILD_GROUP_ID: 30000 NIX_INSTALLER_MODIFY_PROFILE: true + NIX_INSTALLER_INIT: systemd NIX_INSTALLER_START_DAEMON: true + NIX_INSTALLER_TRUST_RUNNER_USER: true + NIX_INSTALLER_CHANNELS: nixpkgs=https://nixos.org/channels/nixpkgs-unstable run: | echo "Installing Nix using experimental installer..." @@ -168,15 +174,6 @@ runs: nix --version nix-env --version - - name: Add experimental Nix configuration - if: inputs.skip-nix-installation == 'false' - shell: bash - run: | - echo "Adding experimental Nix configuration..." - mkdir -p ~/.config/nix - echo "experimental-features = ca-derivations fetch-closure nix-command flakes" >> ~/.config/nix/nix.conf - echo "Experimental configuration added to nix.conf" - - name: Verify Nix installation if: inputs.skip-nix-installation == 'false' shell: bash