File tree Expand file tree Collapse file tree 4 files changed +44
-16
lines changed Expand file tree Collapse file tree 4 files changed +44
-16
lines changed Original file line number Diff line number Diff line change @@ -27,20 +27,19 @@ runs:
27
27
- name : Install Nix
28
28
uses : cachix/install-nix-action@v27
29
29
if : ${{ runner.environment == 'github-hosted' }}
30
- with :
31
- extra_nix_config : |
32
- ${{ inputs.nix-github-token != '' && format('access-tokens = github.com={0}', inputs.nix-github-token) || '' }}
33
- accept-flake-config = true
34
- allow-import-from-derivation = true
35
- substituters = https://cache.nixos.org ${{inputs.substituters}}
36
- trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= ${{inputs.trusted-public-keys}}
37
- netrc-file = $HOME/.config/nix/netrc
38
30
39
31
- name : Configure Nix
40
- if : ${{ runner.environment == 'github-hosted' }}
41
32
shell : bash
42
33
run : |
43
34
mkdir -p $HOME/.config/nix
44
35
{
45
36
echo "machine ${{inputs.cachix-cache}}.cachix.org password ${{inputs.cachix-auth-token}}"
46
37
} >> $HOME/.config/nix/netrc
38
+ {
39
+ echo "${{ inputs.nix-github-token != '' && format('access-tokens = github.com={0}', inputs.nix-github-token) || '' }}
40
+ accept-flake-config = true
41
+ allow-import-from-derivation = true
42
+ substituters = https://cache.nixos.org ${{inputs.substituters}}
43
+ trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= ${{inputs.trusted-public-keys}}
44
+ netrc-file = $HOME/.config/nix/netrc"
45
+ } > $HOME/.config/nix/nix.conf
Original file line number Diff line number Diff line change @@ -182,8 +182,15 @@ jobs:
182
182
183
183
- name : Install Nix
184
184
uses : cachix/install-nix-action@V27
185
- with :
186
- extra_nix_config : accept-flake-config = true
185
+
186
+ - name : Configure Nix
187
+ shell : bash
188
+ run : |
189
+ mkdir -p $HOME/.config/nix
190
+ {
191
+ echo "${{ inputs.nix-github-token != '' && format('access-tokens = github.com={0}', inputs.nix-github-token) || '' }}
192
+ accept-flake-config = true"
193
+ } > $HOME/.config/nix/nix.conf
187
194
188
195
- uses : cachix/cachix-action@v15
189
196
with :
Original file line number Diff line number Diff line change @@ -3,6 +3,10 @@ name: "Update Nix Flake lockfile"
3
3
on :
4
4
# Allow this workflow to be reused by other workflows:
5
5
workflow_call :
6
+ secrets :
7
+ nix-github-token :
8
+ description : GitHub token to add as access-token in nix.conf
9
+ required : false
6
10
7
11
# Allow this workflow to be triggered manually:
8
12
workflow_dispatch :
21
25
- name : Install Nix
22
26
uses : cachix/install-nix-action@v27
23
27
if : ${{ runner.environment == 'github-hosted' }}
24
- with :
25
- extra_nix_config : accept-flake-config = true
28
+
29
+ - name : Configure Nix
30
+ shell : bash
31
+ run : |
32
+ mkdir -p $HOME/.config/nix
33
+ {
34
+ echo "${{ secrets.nix-github-token != '' && format('access-tokens = github.com={0}', secrets.nix-github-token) || '' }}
35
+ accept-flake-config = true"
36
+ } > $HOME/.config/nix/nix.conf
37
+
26
38
27
39
- name : Run `nix flake update`
28
40
id : update-lockfile
Original file line number Diff line number Diff line change @@ -3,6 +3,10 @@ name: "Update Flake Packages ❄️"
3
3
on :
4
4
# Allow this workflow to be reused by other workflows:
5
5
workflow_call :
6
+ secrets :
7
+ nix-github-token :
8
+ description : GitHub token to add as access-token in nix.conf
9
+ required : false
6
10
7
11
# Allow this workflow to be triggered manually:
8
12
workflow_dispatch :
@@ -21,10 +25,16 @@ jobs:
21
25
- name : Install Nix
22
26
uses : cachix/install-nix-action@v27
23
27
if : ${{ runner.environment == 'github-hosted' }}
24
- with :
25
- extra_nix_config : |
28
+
29
+ - name : Configure Nix
30
+ shell : bash
31
+ run : |
32
+ mkdir -p $HOME/.config/nix
33
+ {
34
+ echo "${{ secrets.nix-github-token != '' && format('access-tokens = github.com={0}', secrets.nix-github-token) || '' }}
26
35
accept-flake-config = true
27
- allow-import-from-derivation = true
36
+ allow-import-from-derivation = true"
37
+ } > $HOME/.config/nix/nix.conf
28
38
29
39
30
40
id : generate-token
You can’t perform that action at this time.
0 commit comments