mirror of
https://github.com/cachix/install-nix-action.git
synced 2024-11-21 16:10:52 +00:00
Merge pull request #73 from DamienCassou/add-binary-cache-doc
Add FAQ section "How do I add a binary cache?" to README
This commit is contained in:
commit
3e5f4ecda4
1 changed files with 32 additions and 5 deletions
37
README.md
37
README.md
|
@ -78,19 +78,21 @@ To install Nix from any commit, go to [the corresponding installer_test action](
|
||||||
### How do I print nixpkgs version I have configured?
|
### 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?
|
### How can I run NixOS tests?
|
||||||
|
|
||||||
With the following inputs:
|
With the following inputs:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- uses: cachix/install-nix-action@vXX
|
- uses: cachix/install-nix-action@vXX
|
||||||
with:
|
with:
|
||||||
extra_nix_config: "system-features = nixos-test benchmark big-parallel kvm"
|
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).
|
[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`?
|
### How can I install packages via nix-env from the specified `nix_path`?
|
||||||
|
@ -99,6 +101,31 @@ With the following inputs:
|
||||||
nix-env -i mypackage -f '<nixpkgs>'
|
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
|
## Hacking
|
||||||
|
|
||||||
Install the dependencies
|
Install the dependencies
|
||||||
|
|
Loading…
Reference in a new issue