Compare commits
17 Commits
Author | SHA1 | Date | |
---|---|---|---|
5f45af07a1 | |||
489b4a2f78 | |||
b93cdea694 | |||
783053eda6 | |||
c664ef3126 | |||
74ef8ad2cf | |||
53fb0300a7 | |||
e776d8288c | |||
98f3210e45 | |||
8026a8b63f | |||
825ca3e533 | |||
fe464fe88d | |||
896dc80fef | |||
3e0e991ad2 | |||
d04e8d60ba | |||
791347c66b | |||
3e073d0e89 |
27
.github/workflows/test.yml
vendored
27
.github/workflows/test.yml
vendored
@ -12,7 +12,7 @@ jobs:
|
||||
os: [ubuntu-latest, macos-latest]
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2.3.4
|
||||
- uses: actions/checkout@v2.4.0
|
||||
- run: yarn install --frozen-lockfile
|
||||
- run: yarn build
|
||||
- name: Install Nix
|
||||
@ -31,7 +31,7 @@ jobs:
|
||||
os: [ubuntu-latest, macos-latest]
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2.3.4
|
||||
- uses: actions/checkout@v2.4.0
|
||||
- run: yarn install --frozen-lockfile
|
||||
- run: yarn build
|
||||
- name: Install Nix
|
||||
@ -47,7 +47,7 @@ jobs:
|
||||
os: [ubuntu-latest, macos-latest]
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2.3.4
|
||||
- uses: actions/checkout@v2.4.0
|
||||
- run: yarn install --frozen-lockfile
|
||||
- run: yarn build
|
||||
- name: Install Nix
|
||||
@ -65,7 +65,7 @@ jobs:
|
||||
os: [ubuntu-latest, macos-latest]
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2.3.4
|
||||
- uses: actions/checkout@v2.4.0
|
||||
- run: yarn install --frozen-lockfile
|
||||
- run: yarn build
|
||||
- name: Install Nix
|
||||
@ -74,7 +74,6 @@ jobs:
|
||||
install_url: https://nixos-nix-install-tests.cachix.org/serve/i6laym9jw3wg9mw6ncyrk6gjx4l34vvx/install
|
||||
install_options: '--tarball-url-prefix https://nixos-nix-install-tests.cachix.org/serve'
|
||||
extra_nix_config: |
|
||||
experimental-features = nix-command flakes
|
||||
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
|
||||
- run: nix flake show github:NixOS/nixpkgs
|
||||
|
||||
@ -84,7 +83,7 @@ jobs:
|
||||
os: [ubuntu-latest, macos-latest]
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v2.4.0
|
||||
- run: yarn install --frozen-lockfile
|
||||
- run: yarn build
|
||||
- name: Install Nix
|
||||
@ -94,3 +93,19 @@ jobs:
|
||||
install_url: https://nixos-nix-install-tests.cachix.org/serve/i6laym9jw3wg9mw6ncyrk6gjx4l34vvx/install
|
||||
install_options: '--tarball-url-prefix https://nixos-nix-install-tests.cachix.org/serve'
|
||||
- run: nix-build test.nix
|
||||
|
||||
oldest-supported-installer:
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, macos-latest]
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2.3.5
|
||||
- run: yarn install --frozen-lockfile
|
||||
- run: yarn build
|
||||
- name: Install Nix
|
||||
uses: ./
|
||||
with:
|
||||
nix_path: nixpkgs=channel:nixos-21.05
|
||||
install_url: https://releases.nixos.org/nix/nix-2.3.5/install
|
||||
- run: nix-build test.nix
|
||||
|
10
README.md
10
README.md
@ -14,10 +14,11 @@ or [pin nixpkgs yourself](https://nix.dev/reference/pinning-nixpkgs.html)
|
||||
- Quick installation (~4s on Linux, ~20s on macOS)
|
||||
- Multi-User installation (with sandboxing enabled only on Linux)
|
||||
- [Self-hosted github runner](https://docs.github.com/en/actions/hosting-your-own-runners/about-self-hosted-runners) support
|
||||
- Allows specifying Nix installation URL via `install_url`
|
||||
- Allows specifying Nix installation URL via `install_url` (the oldest supported Nix version is 2.3.5)
|
||||
- Allows specifying extra Nix configration options via `extra_nix_config`
|
||||
- Allows specifying `$NIX_PATH` and channels via `nix_path`
|
||||
- Share `/nix/store` between builds using [cachix-action](https://github.com/cachix/cachix-action) for simple binary cache setup to speed up your builds and share binaries with your team
|
||||
- Enables `flakes` and `nix-command` experimental features by default (to disable, set ``experimental-features` via `extra_nix_config`)
|
||||
|
||||
## Usage
|
||||
|
||||
@ -33,7 +34,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2.3.4
|
||||
- uses: cachix/install-nix-action@v13
|
||||
- uses: cachix/install-nix-action@v14.1
|
||||
with:
|
||||
nix_path: nixpkgs=channel:nixos-unstable
|
||||
- run: nix-build
|
||||
@ -52,12 +53,11 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2.3.4
|
||||
- uses: cachix/install-nix-action@v13
|
||||
- uses: cachix/install-nix-action@v14.1
|
||||
with:
|
||||
install_url: https://nixos-nix-install-tests.cachix.org/serve/i6laym9jw3wg9mw6ncyrk6gjx4l34vvx/install
|
||||
install_url: https://nixos-nix-install-tests.cachix.org/serve/vij683ly7sl95nnhb67bdjjfabclr85m/install
|
||||
install_options: '--tarball-url-prefix https://nixos-nix-install-tests.cachix.org/serve'
|
||||
extra_nix_config: |
|
||||
experimental-features = nix-command flakes
|
||||
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
|
||||
- run: nix build
|
||||
- run: nix flake check
|
||||
|
@ -1,4 +0,0 @@
|
||||
test('nothing', async() => {
|
||||
});
|
||||
|
||||
// TODO: hopefully github actions will support integration tests
|
@ -1,11 +0,0 @@
|
||||
module.exports = {
|
||||
clearMocks: true,
|
||||
moduleFileExtensions: ['js', 'ts'],
|
||||
testEnvironment: 'node',
|
||||
testMatch: ['**/*.test.ts'],
|
||||
testRunner: 'jest-circus/runner',
|
||||
transform: {
|
||||
'^.+\\.ts$': 'ts-jest'
|
||||
},
|
||||
verbose: true
|
||||
}
|
@ -18,6 +18,9 @@ add_config "trusted-users = root $USER"
|
||||
if [[ $INPUT_EXTRA_NIX_CONFIG != "" ]]; then
|
||||
add_config "$INPUT_EXTRA_NIX_CONFIG"
|
||||
fi
|
||||
if [[ ! $INPUT_EXTRA_NIX_CONFIG =~ "experimental-features" ]]; then
|
||||
add_config "experimental-features = nix-command flakes"
|
||||
fi
|
||||
|
||||
# Nix installer flags
|
||||
installer_options=(
|
||||
@ -35,8 +38,7 @@ if [[ $OSTYPE =~ darwin || -e /run/systemd/system ]]; then
|
||||
else
|
||||
# "fix" the following error when running nix*
|
||||
# error: the group 'nixbld' specified in 'build-users-group' does not exist
|
||||
mkdir -m 0755 /etc/nix
|
||||
echo "build-users-group =" > /etc/nix/nix.conf
|
||||
add_config "build-users-group ="
|
||||
fi
|
||||
|
||||
if [[ $INPUT_INSTALL_OPTIONS != "" ]]; then
|
||||
@ -45,12 +47,17 @@ if [[ $INPUT_INSTALL_OPTIONS != "" ]]; then
|
||||
fi
|
||||
|
||||
echo "installer options: ${installer_options[@]}"
|
||||
sh <(curl --retry 5 --retry-connrefused -L "${INPUT_INSTALL_URL:-https://nixos.org/nix/install}") "${installer_options[@]}"
|
||||
|
||||
# There is --retry-on-errors, but only newer curl versions support that
|
||||
until curl -o /tmp/install -v --fail --retry 5 --retry-connrefused -L "${INPUT_INSTALL_URL:-https://nixos.org/nix/install}"
|
||||
do
|
||||
sleep 1
|
||||
done
|
||||
|
||||
chmod +x /tmp/install
|
||||
sh /tmp/install "${installer_options[@]}"
|
||||
|
||||
if [[ $OSTYPE =~ darwin ]]; then
|
||||
# Disable spotlight indexing of /nix to speed up performance
|
||||
sudo mdutil -i off /nix
|
||||
|
||||
# macOS needs certificates hints
|
||||
cert_file=/nix/var/nix/profiles/default/etc/ssl/certs/ca-bundle.crt
|
||||
echo "NIX_SSL_CERT_FILE=$cert_file" >> "$GITHUB_ENV"
|
||||
|
@ -3307,9 +3307,9 @@ throat@^4.0.0:
|
||||
integrity sha1-iQN8vJLFarGJJua6TLsgDhVnKmo=
|
||||
|
||||
tmpl@1.0.x:
|
||||
version "1.0.4"
|
||||
resolved "https://registry.yarnpkg.com/tmpl/-/tmpl-1.0.4.tgz#23640dd7b42d00433911140820e5cf440e521dd1"
|
||||
integrity sha1-I2QN17QtAEM5ERQIIOXPRA5SHdE=
|
||||
version "1.0.5"
|
||||
resolved "https://registry.yarnpkg.com/tmpl/-/tmpl-1.0.5.tgz#8683e0b902bb9c20c4f726e3c0b69f36518c07cc"
|
||||
integrity sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw==
|
||||
|
||||
to-fast-properties@^2.0.0:
|
||||
version "2.0.0"
|
||||
|
Reference in New Issue
Block a user