Compare commits
	
		
			27 Commits
		
	
	
		
			installer_
			...
			flakes-git
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|  | 542462de24 | ||
|  | 8725a6ad42 | ||
|  | 018abf956a | ||
|  | 76107d4eb5 | ||
|  | 5d66827b21 | ||
|  | dad6e949b6 | ||
|  | b88b67ae9d | ||
|  | d4ff692ea4 | ||
|  | 2a00823cdf | ||
|  | c337086021 | ||
|  | 73a329e1fc | ||
|  | 139e95e483 | ||
|  | 15ad7f8d90 | ||
|  | 3e5f4ecda4 | ||
|  | 46e3bcf1bc | ||
|  | 28b5f5643a | ||
|  | 87d70237f9 | ||
|  | e0cb57136a | ||
|  | 690eac722d | ||
|  | 8d6d5e9496 | ||
|  | 20dc92e361 | ||
|  | c5dad0de4e | ||
|  | 36ed3fe72b | ||
|  | 0b249633ac | ||
|  | 0bd2cdca25 | ||
|  | 20d5bae58c | ||
|  | 0598b739d8 | 
							
								
								
									
										32
									
								
								.github/workflows/test.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										32
									
								
								.github/workflows/test.yml
									
									
									
									
										vendored
									
									
								
							| @@ -12,7 +12,7 @@ jobs: | ||||
|         os: [ubuntu-latest, macos-latest] | ||||
|     runs-on: ${{ matrix.os }} | ||||
|     steps: | ||||
|     - uses: actions/checkout@v2 | ||||
|     - 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 | ||||
|     - 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 | ||||
|     - uses: actions/checkout@v2.3.4 | ||||
|     - run: yarn install --frozen-lockfile | ||||
|     - run: yarn build | ||||
|     - name: Install Nix | ||||
| @@ -65,16 +65,32 @@ jobs: | ||||
|         os: [ubuntu-latest, macos-latest] | ||||
|     runs-on: ${{ matrix.os }} | ||||
|     steps: | ||||
|     - uses: actions/checkout@v2 | ||||
|       with: | ||||
|         # Nix Flakes doesn't work on shallow clones | ||||
|         fetch-depth: 0 | ||||
|     - uses: actions/checkout@v2.3.4 | ||||
|     - run: yarn install --frozen-lockfile | ||||
|     - run: yarn build | ||||
|     - name: Install Nix | ||||
|       uses: ./ | ||||
|       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/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 | ||||
|  | ||||
|   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-21.05 | ||||
|         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 | ||||
|   | ||||
							
								
								
									
										60
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										60
									
								
								README.md
									
									
									
									
									
								
							| @@ -33,7 +33,7 @@ jobs: | ||||
|     runs-on: ubuntu-latest | ||||
|     steps: | ||||
|     - uses: actions/checkout@v2.3.4 | ||||
|     - uses: cachix/install-nix-action@v12 | ||||
|     - uses: cachix/install-nix-action@v13 | ||||
|       with: | ||||
|         nix_path: nixpkgs=channel:nixos-unstable | ||||
|     - run: nix-build | ||||
| @@ -51,18 +51,20 @@ jobs: | ||||
|   tests: | ||||
|     runs-on: ubuntu-latest | ||||
|     steps: | ||||
|     - uses: actions/checkout@v2 | ||||
|     - uses: actions/checkout@v2.3.4 | ||||
|     - uses: cachix/install-nix-action@v13 | ||||
|       with: | ||||
|           # Nix Flakes doesn't work on shallow clones | ||||
|           fetch-depth: 0 | ||||
|     - uses: cachix/install-nix-action@v12 | ||||
|       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/i6laym9jw3wg9mw6ncyrk6gjx4l34vvx/install | ||||
|         install_options: '--tarball-url-prefix https://nixos-nix-install-tests.cachix.org/serve' | ||||
|         extra_nix_config: | | ||||
|           experimental-features = nix-command flakes | ||||
|     - run: nix-build | ||||
|           access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} | ||||
|     - run: nix build | ||||
|     - run: nix flake check | ||||
| ``` | ||||
|  | ||||
| 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:`) | ||||
|  | ||||
| - `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) | ||||
| @@ -75,26 +77,25 @@ jobs: | ||||
|  | ||||
| ## FAQ | ||||
|  | ||||
| ### Is it possible to run NixOS tests / Qemu+KVM with GitHub Actions? | ||||
|  | ||||
| [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 I have configured? | ||||
|  | ||||
|  | ||||
| ```nix-instantiate --eval -E '(import <nixpkgs> {}).lib.version'``` | ||||
| ```yaml | ||||
| - name: Print nixpkgs version | ||||
|   run: 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" | ||||
| - 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. | ||||
| [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`? | ||||
|  | ||||
| @@ -102,6 +103,31 @@ Note that there's no hardware acceleration on GitHub Actions. | ||||
| nix-env -i mypackage -f '<nixpkgs>' | ||||
| ``` | ||||
|  | ||||
| ### How do I add a binary cache? | ||||
|  | ||||
| If the binary cache you want to add is hosted on [Cachix](https://cachix.org/) and you are | ||||
| using [cachix-action](https://github.com/cachix/cachix-action), you | ||||
| should use their `extraPullNames` input like this: | ||||
|  | ||||
| ```yaml | ||||
| - uses: cachix/cachix-action@vXX | ||||
|    with: | ||||
|      name: mycache | ||||
|      authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' | ||||
|      extraPullNames: nix-community | ||||
| ``` | ||||
|  | ||||
| Otherwise, you can add any binary cache to nix.conf using | ||||
| install-nix-action's own `extra_nix_config` input: | ||||
|  | ||||
| ```yaml | ||||
| - uses: cachix/install-nix-action@vXX | ||||
|   with: | ||||
|     extra_nix_config: | | ||||
|       trusted-public-keys = hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= | ||||
|       substituters = https://hydra.iohk.io https://cache.nixos.org/ | ||||
| ``` | ||||
|  | ||||
| ## Hacking | ||||
|  | ||||
| Install the dependencies | ||||
|   | ||||
| @@ -8,7 +8,7 @@ fi | ||||
|  | ||||
| # Configure Nix | ||||
| add_config() { | ||||
|   echo "$1" | sudo tee -a /tmp/nix.conf >/dev/null | ||||
|   echo "$1" | tee -a /tmp/nix.conf >/dev/null | ||||
| } | ||||
| # Set jobs to number of cores | ||||
| add_config "max-jobs = auto" | ||||
| @@ -28,7 +28,8 @@ installer_options=( | ||||
|   --nix-extra-conf-file /tmp/nix.conf | ||||
| ) | ||||
| if [[ $INPUT_INSTALL_OPTIONS != "" ]]; then | ||||
|   installer_options=("${installer_options[@]}" "${INPUT_INSTALL_OPTIONS[@]}") | ||||
|   IFS=' ' read -r -a extra_installer_options <<< $INPUT_INSTALL_OPTIONS | ||||
|   installer_options=("${extra_installer_options[@]}" "${installer_options[@]}") | ||||
| fi | ||||
|  | ||||
| echo "installer options: ${installer_options[@]}" | ||||
|   | ||||
							
								
								
									
										30
									
								
								yarn.lock
									
									
									
									
									
								
							
							
						
						
									
										30
									
								
								yarn.lock
									
									
									
									
									
								
							| @@ -1313,9 +1313,9 @@ growly@^1.3.0: | ||||
|   integrity sha1-8QdIy+dq+WS3yWyTxrzCivEgwIE= | ||||
|  | ||||
| handlebars@^4.1.2: | ||||
|   version "4.7.6" | ||||
|   resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.7.6.tgz#d4c05c1baf90e9945f77aa68a7a219aa4a7df74e" | ||||
|   integrity sha512-1f2BACcBfiwAfStCKZNrUCgqNZkGsAT7UM3kkYtXuLo0KnaVfjKOyf7PRzB6++aK9STyT1Pd2ZCPe3EGOXleXA== | ||||
|   version "4.7.7" | ||||
|   resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.7.7.tgz#9ce33416aad02dbd6c8fafa8240d5d98004945a1" | ||||
|   integrity sha512-aAcXm5OAfE/8IXkcZvCepKU3VzW1/39Fb5ZuqMtgI/hT8X2YgoMvBY5dLhq/cpOvw7Lk1nK/UF71aLG/ZnVYRA== | ||||
|   dependencies: | ||||
|     minimist "^1.2.5" | ||||
|     neo-async "^2.6.0" | ||||
| @@ -1391,9 +1391,9 @@ has@^1.0.1, has@^1.0.3: | ||||
|     function-bind "^1.1.1" | ||||
|  | ||||
| hosted-git-info@^2.1.4: | ||||
|   version "2.8.4" | ||||
|   resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.8.4.tgz#44119abaf4bc64692a16ace34700fed9c03e2546" | ||||
|   integrity sha512-pzXIvANXEFrc5oFFXRMkbLPQ2rXRoDERwDLyrcUxGhaZhgP54BBSl9Oheh7Vv0T090cszWBxPjkQQ5Sq1PbBRQ== | ||||
|   version "2.8.9" | ||||
|   resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.8.9.tgz#dffc0bf9a21c02209090f2aa69429e1414daf3f9" | ||||
|   integrity sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw== | ||||
|  | ||||
| html-encoding-sniffer@^1.0.2: | ||||
|   version "1.0.2" | ||||
| @@ -2221,9 +2221,9 @@ lodash.sortby@^4.7.0: | ||||
|   integrity sha1-7dFMgk4sycHgsKG0K7UhBRakJDg= | ||||
|  | ||||
| lodash@^4.17.11, lodash@^4.17.13: | ||||
|   version "4.17.19" | ||||
|   resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.19.tgz#e48ddedbe30b3321783c5b4301fbd353bc1e4a4b" | ||||
|   integrity sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ== | ||||
|   version "4.17.21" | ||||
|   resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" | ||||
|   integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== | ||||
|  | ||||
| loose-envify@^1.0.0: | ||||
|   version "1.4.0" | ||||
| @@ -3442,9 +3442,9 @@ typescript@^3.5.1: | ||||
|   integrity sha512-N7bceJL1CtRQ2RiG0AQME13ksR7DiuQh/QehubYcghzv20tnh+MQnQIuJddTmsbqYj+dztchykemz0zFzlvdQw== | ||||
|  | ||||
| uglify-js@^3.1.4: | ||||
|   version "3.10.4" | ||||
|   resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.10.4.tgz#dd680f5687bc0d7a93b14a3482d16db6eba2bfbb" | ||||
|   integrity sha512-kBFT3U4Dcj4/pJ52vfjCSfyLyvG9VYYuGYPmrPvAxRw/i7xHiT4VvCev+uiEMcEEiu6UNB6KgWmGtSUYIWScbw== | ||||
|   version "3.13.5" | ||||
|   resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.13.5.tgz#5d71d6dbba64cf441f32929b1efce7365bb4f113" | ||||
|   integrity sha512-xtB8yEqIkn7zmOyS2zUNBsYCBRhDkvlNxMMY2smuJ/qA8NCHeQvKCF3i9Z4k8FJH4+PJvZRtMrPynfZ75+CSZw== | ||||
|  | ||||
| underscore@1.8.3: | ||||
|   version "1.8.3" | ||||
| @@ -3630,9 +3630,9 @@ xml-name-validator@^3.0.0: | ||||
|   integrity sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw== | ||||
|  | ||||
| y18n@^4.0.0: | ||||
|   version "4.0.0" | ||||
|   resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.0.tgz#95ef94f85ecc81d007c264e190a120f0a3c8566b" | ||||
|   integrity sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w== | ||||
|   version "4.0.1" | ||||
|   resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.1.tgz#8db2b83c31c5d75099bb890b23f3094891e247d4" | ||||
|   integrity sha512-wNcy4NvjMYL8gogWWYAO7ZFWFfHcbdbE57tZO8e4cbpj8tfUcwrwqSl3ad8HxpYWCdXcJUCeKKZS62Av1affwQ== | ||||
|  | ||||
| yallist@^3.0.0, yallist@^3.0.3: | ||||
|   version "3.1.0" | ||||
|   | ||||
		Reference in New Issue
	
	Block a user