diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8031ffaf..519708f9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,7 +10,6 @@ jobs: matrix: os: [ubuntu-18.04, macos-latest] nixPath: - - - nixpkgs=channel:nixos-unstable - nixpkgs=https://github.com/NixOS/nixpkgs/archive/master.tar.gz diff --git a/action.yml b/action.yml index e1781981..1e558caf 100644 --- a/action.yml +++ b/action.yml @@ -4,7 +4,7 @@ author: 'Domen Kožar' inputs: NIX_PATH: description: 'Set NIX_PATH environment variable' - required: false + required: true branding: color: 'blue' icon: 'sun' diff --git a/lib/install-nix.sh b/lib/install-nix.sh index 23756e65..a3b1322c 100755 --- a/lib/install-nix.sh +++ b/lib/install-nix.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash set -euo pipefail -nixPath="${1:-/nix/var/nix/profiles/per-user/root/channels}" +nixPath="${1}" export here=$(dirname "${BASH_SOURCE[0]}") @@ -28,6 +28,9 @@ nixConf # Needed due to multi-user being too defensive export ALLOW_PREEXISTING_INSTALLATION=1 +# Disable installation of default channel +export NIX_INSTALLER_NO_CHANNEL_ADD=1 + sh <(curl -L https://nixos.org/nix/install) --daemon # write nix.conf again as installation overwrites it diff --git a/lib/main.js b/lib/main.js index 7f74cf4e..54943e55 100644 --- a/lib/main.js +++ b/lib/main.js @@ -26,6 +26,6 @@ function awaitSocket() { }); }); } -child_process_1.execFileSync(`${__dirname}/install-nix.sh`, [core_1.getInput('NIX_PATH')], { stdio: 'inherit' }); +child_process_1.execFileSync(`${__dirname}/install-nix.sh`, [core_1.getInput('NIX_PATH', { required: true })], { stdio: 'inherit' }); // nc doesn't work correctly on macOS :( awaitSocket(); diff --git a/src/main.ts b/src/main.ts index 82ff3ea4..d3d54b4f 100644 --- a/src/main.ts +++ b/src/main.ts @@ -15,7 +15,7 @@ async function awaitSocket() { }); } -execFileSync(`${__dirname}/install-nix.sh`, [getInput('NIX_PATH')], { stdio: 'inherit' }); +execFileSync(`${__dirname}/install-nix.sh`, [getInput('NIX_PATH', { required: true })], { stdio: 'inherit' }); // nc doesn't work correctly on macOS :( awaitSocket(); \ No newline at end of file