Skip to content

Commit

Permalink
Disable default channel installation
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerschtli committed May 19, 2020
1 parent 4a3097b commit e1bd91c
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 5 deletions.
1 change: 0 additions & 1 deletion .github/workflows/test.yml
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion action.yml
Expand Up @@ -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'
Expand Down
5 changes: 4 additions & 1 deletion 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]}")

Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/main.js
Expand Up @@ -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();
2 changes: 1 addition & 1 deletion src/main.ts
Expand Up @@ -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();

0 comments on commit e1bd91c

Please sign in to comment.