File tree Expand file tree Collapse file tree 4 files changed +58
-30
lines changed Expand file tree Collapse file tree 4 files changed +58
-30
lines changed Original file line number Diff line number Diff line change @@ -36,19 +36,12 @@ runs:
3636 using : " composite"
3737 steps :
3838 - name : Install Nix
39- uses : cachix/install-nix-action@v27
40- if : ${{ runner.environment == 'github-hosted' }}
39+ uses : metacraft-labs/nixos-modules/.github/install-nix@feat/CD
4140 with :
42- extra_nix_config : |
43- accept-flake-config = true
44- substituters = https://cache.nixos.org ${{inputs.substituters}}
45- trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= ${{inputs.trusted-public-keys}}
46- netrc-file = /home/runner/.config/nix/netrc
47- - name : Configure Nix
48- shell : bash
49- run : |
50- mkdir -p /home/runner/.config/nix
51- echo "machine ${{inputs.cachix-cache}}.cachix.org password ${{inputs.cachix-auth-token}}" >> /home/runner/.config/nix/netrc
41+ cachix-cache : ${{ inputs.cachix-cache }}
42+ cachix-auth-token : ${{ inputs.cachix-auth-token }}
43+ trusted-public-keys : ${{ inputs.trusted-public-keys }}
44+ substituters : ${{ inputs.substituters }}
5245
5346 - name : Generate CI Matrix
5447 id : generate-matrix
Original file line number Diff line number Diff line change 1+ name : Install Nix
2+ description : Installs Nix and configures substituters and trusted public keys
3+
4+ inputs :
5+ cachix-cache :
6+ description : The name of the cachix cache to use
7+ required : true
8+ cachix-auth-token :
9+ description : Cachix auth token
10+ required : true
11+ trusted-public-keys :
12+ description : Trusted public keys
13+ required : false
14+ default : ' '
15+ substituters :
16+ description : Substituters
17+ required : false
18+ default : ' '
19+
20+ runs :
21+ using : " composite"
22+ steps :
23+ - name : Install Nix
24+ uses : cachix/install-nix-action@v27
25+ if : ${{ runner.environment == 'github-hosted' }}
26+ with :
27+ extra_nix_config : |
28+ accept-flake-config = true
29+ allow-import-from-derivation = true
30+ substituters = https://cache.nixos.org ${{inputs.substituters}}
31+ trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= ${{inputs.trusted-public-keys}}
32+ netrc-file = $HOME/.config/nix/netrc
33+
34+ - name : Configure Nix
35+ if : ${{ runner.environment == 'github-hosted' }}
36+ shell : bash
37+ run : |
38+ mkdir -p $HOME/.config/nix
39+ {
40+ echo "machine ${{inputs.cachix-cache}}.cachix.org password ${{inputs.cachix-auth-token}}"
41+ } >> $HOME/.config/nix/netrc
Original file line number Diff line number Diff line change @@ -37,20 +37,12 @@ runs:
3737 using : " composite"
3838 steps :
3939 - name : Install Nix
40- uses : cachix/install-nix-action@v27
41- if : ${{ runner.environment == 'github-hosted' }}
40+ uses : metacraft-labs/nixos-modules/.github/install-nix@feat/CD
4241 with :
43- extra_nix_config : |
44- accept-flake-config = true
45- substituters = https://cache.nixos.org ${{inputs.substituters}}
46- trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= ${{inputs.trusted-public-keys}}
47- netrc-file = /home/runner/.config/nix/netrc
48- nix-installer-tag : v0.15.1
49- - name : Configure Nix
50- shell : bash
51- run : |
52- mkdir -p /home/runner/.config/nix
53- echo "machine ${{inputs.cachix-cache}}.cachix.org password ${{inputs.cachix-auth-token}}" >> /home/runner/.config/nix/netrc
42+ cachix-cache : ${{ inputs.CACHIX_CACHE }}
43+ cachix-auth-token : ${{ inputs.CACHIX_AUTH_TOKEN }}
44+ trusted-public-keys : ${{ inputs.TRUSTED_PUBLIC_KEYS }}
45+ substituters : ${{ inputs.SUBSTITUTERS }}
5446
5547 - name : Print CI Matrix
5648 id : print-matrix
Original file line number Diff line number Diff line change @@ -38,13 +38,15 @@ jobs:
3838 name : Generate Matrix of Matrices
3939 runs-on : ubuntu-latest
4040 steps :
41- - uses : actions/checkout@v4
42-
4341 - name : Install Nix
44- uses : cachix/install-nix-action@v27
45- if : ${{ runner.environment == 'github-hosted' }}
42+ uses : metacraft-labs/nixos-modules/.github/install-nix@feat/CD
4643 with :
47- extra_nix_config : accept-flake-config = true
44+ cachix-cache : ${{ vars.CACHIX_CACHE }}
45+ cachix-auth-token : ${{ secrets.CACHIX_AUTH_TOKEN }}
46+ trusted-public-keys : ${{ vars.TRUSTED_PUBLIC_KEYS }}
47+ substituters : ${{ vars.SUBSTITUTERS }}
48+
49+ - uses : actions/checkout@v4
4850
4951 - name : Generate Matrix for Matrix
5052 id : generate-matrix
You can’t perform that action at this time.
0 commit comments