Skip to content

Commit

Permalink
Merge pull request #108 from cachix/enable-experimental-features-by-d…
Browse files Browse the repository at this point in the history
…efault

enable flakes & nix-command features by default
  • Loading branch information
domenkozar committed Nov 5, 2021
2 parents e776d82 + 53fb030 commit 74ef8ad
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
17 changes: 16 additions & 1 deletion .github/workflows/test.yml
Expand Up @@ -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

Expand All @@ -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
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -18,6 +18,7 @@ or [pin nixpkgs yourself](https://nix.dev/reference/pinning-nixpkgs.html)
- 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

Expand Down Expand Up @@ -57,7 +58,6 @@ jobs:
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
Expand Down
3 changes: 3 additions & 0 deletions lib/install-nix.sh
Expand Up @@ -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=(
Expand Down

0 comments on commit 74ef8ad

Please sign in to comment.