Compare commits
	
		
			4 Commits
		
	
	
		
			enable-exp
			...
			self-hoste
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|  | 39d848c6d3 | ||
|  | 8ba86cf165 | ||
|  | 712fbc2bf9 | ||
|  | c5729e9110 | 
							
								
								
									
										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.5 | ||||
|     - uses: actions/checkout@v2.3.4 | ||||
|     - 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.5 | ||||
|     - uses: actions/checkout@v2.3.4 | ||||
|     - 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.5 | ||||
|     - uses: actions/checkout@v2.3.4 | ||||
|     - 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.5 | ||||
|     - uses: actions/checkout@v2.3.4 | ||||
|     - run: yarn install --frozen-lockfile | ||||
|     - run: yarn build | ||||
|     - name: Install Nix | ||||
| @@ -74,6 +74,7 @@ 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 | ||||
|  | ||||
| @@ -83,7 +84,7 @@ jobs: | ||||
|         os: [ubuntu-latest, macos-latest] | ||||
|     runs-on: ${{ matrix.os }} | ||||
|     steps: | ||||
|     - uses: actions/checkout@v2.3.5 | ||||
|     - uses: actions/checkout@v2 | ||||
|     - run: yarn install --frozen-lockfile | ||||
|     - run: yarn build | ||||
|     - name: Install Nix | ||||
| @@ -93,19 +94,3 @@ 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 | ||||
|   | ||||
| @@ -14,11 +14,10 @@ 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` (the oldest supported Nix version is 2.3.5) | ||||
| - Allows specifying Nix installation URL via `install_url` | ||||
| - 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 | ||||
|  | ||||
| @@ -58,6 +57,7 @@ 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 | ||||
|   | ||||
| @@ -1,6 +1,9 @@ | ||||
| #!/usr/bin/env bash | ||||
| set -euo pipefail | ||||
|  | ||||
| # Set paths early (ephemeral self-hosted runners might reuse a runner) | ||||
| PATH="/nix/var/nix/profiles/per-user/$USER/profile/bin":"/nix/var/nix/profiles/default/bin":$PATH | ||||
|  | ||||
| if type -p nix &>/dev/null ; then | ||||
|   echo "Aborting: Nix is already installed at $(type -p nix)" | ||||
|   exit | ||||
| @@ -18,9 +21,6 @@ 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=( | ||||
| @@ -62,6 +62,7 @@ fi | ||||
| echo "/nix/var/nix/profiles/per-user/$USER/profile/bin" >> "$GITHUB_PATH" | ||||
| echo "/nix/var/nix/profiles/default/bin" >> "$GITHUB_PATH" | ||||
|  | ||||
|  | ||||
| if [[ $INPUT_NIX_PATH != "" ]]; then | ||||
|   echo "NIX_PATH=${INPUT_NIX_PATH}" >> "$GITHUB_ENV" | ||||
| fi | ||||
|   | ||||
		Reference in New Issue
	
	Block a user