Compare commits
20 Commits
flakes-fix
...
update-ins
Author | SHA1 | Date | |
---|---|---|---|
1ffdfddb1b | |||
c5dad0de4e | |||
36ed3fe72b | |||
0b249633ac | |||
0bd2cdca25 | |||
20d5bae58c | |||
0598b739d8 | |||
2e56a105a6 | |||
3349b09732 | |||
b516682d84 | |||
2e278dead1 | |||
e6685eaf1d | |||
96aea9869b | |||
f43909d7a0 | |||
54ce86db4c | |||
fa64b9ec04 | |||
ef4324316b | |||
68043fd3c3 | |||
575d5faa90 | |||
07da2520ee |
31
.github/workflows/test.yml
vendored
31
.github/workflows/test.yml
vendored
@ -12,7 +12,7 @@ jobs:
|
|||||||
os: [ubuntu-latest, macos-latest]
|
os: [ubuntu-latest, macos-latest]
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2.3.4
|
||||||
- run: yarn install --frozen-lockfile
|
- run: yarn install --frozen-lockfile
|
||||||
- run: yarn build
|
- run: yarn build
|
||||||
- name: Install Nix
|
- name: Install Nix
|
||||||
@ -31,7 +31,7 @@ jobs:
|
|||||||
os: [ubuntu-latest, macos-latest]
|
os: [ubuntu-latest, macos-latest]
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2.3.4
|
||||||
- run: yarn install --frozen-lockfile
|
- run: yarn install --frozen-lockfile
|
||||||
- run: yarn build
|
- run: yarn build
|
||||||
- name: Install Nix
|
- name: Install Nix
|
||||||
@ -47,7 +47,7 @@ jobs:
|
|||||||
os: [ubuntu-latest, macos-latest]
|
os: [ubuntu-latest, macos-latest]
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2.3.4
|
||||||
- run: yarn install --frozen-lockfile
|
- run: yarn install --frozen-lockfile
|
||||||
- run: yarn build
|
- run: yarn build
|
||||||
- name: Install Nix
|
- name: Install Nix
|
||||||
@ -65,16 +65,31 @@ jobs:
|
|||||||
os: [ubuntu-latest, macos-latest]
|
os: [ubuntu-latest, macos-latest]
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2.3.4
|
||||||
with:
|
|
||||||
# Nix Flakes doesn't work on shallow clones
|
|
||||||
fetch-depth: 0
|
|
||||||
- run: yarn install --frozen-lockfile
|
- run: yarn install --frozen-lockfile
|
||||||
- run: yarn build
|
- run: yarn build
|
||||||
- name: Install Nix
|
- name: Install Nix
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
install_url: https://github.com/numtide/nix-flakes-installer/releases/download/nix-2.4pre20201221_9fab14a/install
|
install_url: https://nixos-nix-install-tests.cachix.org/serve/lb41az54kzk6j12p81br4bczary7m145/install
|
||||||
|
install_options: '--tarball-url-prefix https://nixos-nix-install-tests.cachix.org/serve'
|
||||||
extra_nix_config: |
|
extra_nix_config: |
|
||||||
experimental-features = nix-command flakes
|
experimental-features = nix-command flakes
|
||||||
- run: nix flake show github:NixOS/nixpkgs
|
- run: nix flake show github:NixOS/nixpkgs
|
||||||
|
|
||||||
|
installer-options:
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
os: [ubuntu-latest, macos-latest]
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- run: yarn install --frozen-lockfile
|
||||||
|
- run: yarn build
|
||||||
|
- name: Install Nix
|
||||||
|
uses: ./
|
||||||
|
with:
|
||||||
|
nix_path: nixpkgs=channel:nixos-20.03
|
||||||
|
install_url: https://nixos-nix-install-tests.cachix.org/serve/lb41az54kzk6j12p81br4bczary7m145/install
|
||||||
|
install_options: '--tarball-url-prefix https://nixos-nix-install-tests.cachix.org/serve'
|
||||||
|
- run: nix-build test.nix
|
||||||
|
45
README.md
45
README.md
@ -17,6 +17,7 @@ or [pin nixpkgs yourself](https://nix.dev/reference/pinning-nixpkgs.html)
|
|||||||
- Allows specifying Nix installation URL via `install_url`
|
- Allows specifying Nix installation URL via `install_url`
|
||||||
- Allows specifying extra Nix configration options via `extra_nix_config`
|
- Allows specifying extra Nix configration options via `extra_nix_config`
|
||||||
- Allows specifying `$NIX_PATH` and channels via `nix_path`
|
- 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
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
@ -31,16 +32,13 @@ jobs:
|
|||||||
tests:
|
tests:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2.3.4
|
||||||
- uses: cachix/install-nix-action@v11
|
- uses: cachix/install-nix-action@v12
|
||||||
with:
|
with:
|
||||||
nix_path: nixpkgs=channel:nixos-unstable
|
nix_path: nixpkgs=channel:nixos-unstable
|
||||||
- run: nix-build
|
- run: nix-build
|
||||||
```
|
```
|
||||||
|
|
||||||
See also [cachix-action](https://github.com/cachix/cachix-action) for
|
|
||||||
simple binary cache setup to speed up your builds and share binaries
|
|
||||||
with developers.
|
|
||||||
|
|
||||||
## Usage with Flakes
|
## Usage with Flakes
|
||||||
|
|
||||||
@ -53,18 +51,18 @@ jobs:
|
|||||||
tests:
|
tests:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2.3.4
|
||||||
|
- uses: cachix/install-nix-action@v12
|
||||||
with:
|
with:
|
||||||
# Nix Flakes doesn't work on shallow clones
|
install_url: https://nixos-nix-install-tests.cachix.org/serve/lb41az54kzk6j12p81br4bczary7m145/install
|
||||||
fetch-depth: 0
|
install_options: '--tarball-url-prefix https://nixos-nix-install-tests.cachix.org/serve'
|
||||||
- uses: cachix/install-nix-action@v11
|
|
||||||
with:
|
|
||||||
install_url: https://github.com/numtide/nix-flakes-installer/releases/download/nix-3.0pre20201007_5257a25/install
|
|
||||||
extra_nix_config: |
|
extra_nix_config: |
|
||||||
experimental-features = nix-command flakes
|
experimental-features = nix-command flakes
|
||||||
- run: nix-build
|
- run: nix-build
|
||||||
```
|
```
|
||||||
|
|
||||||
|
To install Nix from any commit, go to [the corresponding installer_test action](https://github.com/NixOS/nix/runs/2219534360) and click on "Run cachix/install-nix-action@XX" step and expand the first line.
|
||||||
|
|
||||||
## Inputs (specify using `with:`)
|
## Inputs (specify using `with:`)
|
||||||
|
|
||||||
- `install_url`: specify URL to install Nix from (useful for testing non-stable releases or pinning Nix for example https://releases.nixos.org/nix/nix-2.3.7/install)
|
- `install_url`: specify URL to install Nix from (useful for testing non-stable releases or pinning Nix for example https://releases.nixos.org/nix/nix-2.3.7/install)
|
||||||
@ -77,15 +75,30 @@ jobs:
|
|||||||
|
|
||||||
## FAQ
|
## FAQ
|
||||||
|
|
||||||
### Is it possible to run NixOS tests / Qemu+KVM with GitHub Actions?
|
### How do I print nixpkgs version I have configured?
|
||||||
|
|
||||||
[Currently GitHub Actions are not running on Azure instance types that support nested virtualization](https://github.com/actions/virtual-environments/issues/183#issuecomment-610723516).
|
|
||||||
|
|
||||||
### How do I print nixpkgs version with the channel I have configured?
|
|
||||||
|
|
||||||
|
|
||||||
```nix-instantiate --eval -E '(import <nixpkgs> {}).lib.version'```
|
```nix-instantiate --eval -E '(import <nixpkgs> {}).lib.version'```
|
||||||
|
|
||||||
|
### How can I run NixOS tests?
|
||||||
|
|
||||||
|
With the following inputs:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
- uses: cachix/install-nix-action@vXX
|
||||||
|
with:
|
||||||
|
extra_nix_config: "system-features = nixos-test benchmark big-parallel kvm"
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
[Note that there's no hardware acceleration on GitHub Actions.](https://github.com/actions/virtual-environments/issues/183#issuecomment-610723516).
|
||||||
|
|
||||||
|
### How can I install packages via nix-env from the specified `nix_path`?
|
||||||
|
|
||||||
|
```
|
||||||
|
nix-env -i mypackage -f '<nixpkgs>'
|
||||||
|
```
|
||||||
|
|
||||||
## Hacking
|
## Hacking
|
||||||
|
|
||||||
Install the dependencies
|
Install the dependencies
|
||||||
|
@ -3,7 +3,9 @@ description: 'Installs Nix on GitHub Actions for the supported platforms: Linux
|
|||||||
author: 'Domen Kožar'
|
author: 'Domen Kožar'
|
||||||
inputs:
|
inputs:
|
||||||
install_url:
|
install_url:
|
||||||
description: 'Installation URL that will contain a script to install Nix'
|
description: 'Installation URL that will contain a script to install Nix.'
|
||||||
|
install_options:
|
||||||
|
description: 'Additional installer flags passed to the installer script.'
|
||||||
nix_path:
|
nix_path:
|
||||||
description: 'Set NIX_PATH environment variable.'
|
description: 'Set NIX_PATH environment variable.'
|
||||||
extra_nix_config:
|
extra_nix_config:
|
||||||
|
@ -27,7 +27,12 @@ installer_options=(
|
|||||||
--darwin-use-unencrypted-nix-store-volume
|
--darwin-use-unencrypted-nix-store-volume
|
||||||
--nix-extra-conf-file /tmp/nix.conf
|
--nix-extra-conf-file /tmp/nix.conf
|
||||||
)
|
)
|
||||||
|
if [[ $INPUT_INSTALL_OPTIONS != "" ]]; then
|
||||||
|
IFS=' ' read -r -a extra_installer_options <<< $INPUT_INSTALL_OPTIONS
|
||||||
|
installer_options=("${extra_installer_options[@]}" "${installer_options[@]}")
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "installer options: ${installer_options[@]}"
|
||||||
# On self-hosted runners we don't need to install more than once
|
# On self-hosted runners we don't need to install more than once
|
||||||
if [[ ! -d /nix/store ]]
|
if [[ ! -d /nix/store ]]
|
||||||
then
|
then
|
||||||
@ -40,15 +45,15 @@ if [[ $OSTYPE =~ darwin ]]; then
|
|||||||
|
|
||||||
# macOS needs certificates hints
|
# macOS needs certificates hints
|
||||||
cert_file=/nix/var/nix/profiles/default/etc/ssl/certs/ca-bundle.crt
|
cert_file=/nix/var/nix/profiles/default/etc/ssl/certs/ca-bundle.crt
|
||||||
echo "NIX_SSL_CERT_FILE=$cert_file" >> $GITHUB_ENV
|
echo "NIX_SSL_CERT_FILE=$cert_file" >> "$GITHUB_ENV"
|
||||||
export NIX_SSL_CERT_FILE=$cert_file
|
export NIX_SSL_CERT_FILE=$cert_file
|
||||||
sudo launchctl setenv NIX_SSL_CERT_FILE "$cert_file"
|
sudo launchctl setenv NIX_SSL_CERT_FILE "$cert_file"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Set paths
|
# Set paths
|
||||||
echo "/nix/var/nix/profiles/per-user/$USER/profile/bin" >> $GITHUB_PATH
|
echo "/nix/var/nix/profiles/per-user/$USER/profile/bin" >> "$GITHUB_PATH"
|
||||||
echo "/nix/var/nix/profiles/default/bin" >> $GITHUB_PATH
|
echo "/nix/var/nix/profiles/default/bin" >> "$GITHUB_PATH"
|
||||||
|
|
||||||
if [[ $INPUT_NIX_PATH != "" ]]; then
|
if [[ $INPUT_NIX_PATH != "" ]]; then
|
||||||
echo "NIX_PATH=${INPUT_NIX_PATH}" >> $GITHUB_ENV
|
echo "NIX_PATH=${INPUT_NIX_PATH}" >> "$GITHUB_ENV"
|
||||||
fi
|
fi
|
||||||
|
12
yarn.lock
12
yarn.lock
@ -1452,9 +1452,9 @@ inherits@2, inherits@~2.0.3:
|
|||||||
integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==
|
integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==
|
||||||
|
|
||||||
ini@~1.3.0:
|
ini@~1.3.0:
|
||||||
version "1.3.5"
|
version "1.3.8"
|
||||||
resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927"
|
resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.8.tgz#a29da425b48806f34767a4efce397269af28432c"
|
||||||
integrity sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==
|
integrity sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==
|
||||||
|
|
||||||
invariant@^2.2.4:
|
invariant@^2.2.4:
|
||||||
version "2.2.4"
|
version "2.2.4"
|
||||||
@ -3630,9 +3630,9 @@ xml-name-validator@^3.0.0:
|
|||||||
integrity sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw==
|
integrity sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw==
|
||||||
|
|
||||||
y18n@^4.0.0:
|
y18n@^4.0.0:
|
||||||
version "4.0.0"
|
version "4.0.1"
|
||||||
resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.0.tgz#95ef94f85ecc81d007c264e190a120f0a3c8566b"
|
resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.1.tgz#8db2b83c31c5d75099bb890b23f3094891e247d4"
|
||||||
integrity sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==
|
integrity sha512-wNcy4NvjMYL8gogWWYAO7ZFWFfHcbdbE57tZO8e4cbpj8tfUcwrwqSl3ad8HxpYWCdXcJUCeKKZS62Av1affwQ==
|
||||||
|
|
||||||
yallist@^3.0.0, yallist@^3.0.3:
|
yallist@^3.0.0, yallist@^3.0.3:
|
||||||
version "3.1.0"
|
version "3.1.0"
|
||||||
|
Reference in New Issue
Block a user