File tree Expand file tree Collapse file tree 4 files changed +61
-0
lines changed Expand file tree Collapse file tree 4 files changed +61
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Nix Flake actions
2
+
3
+ on :
4
+ pull_request :
5
+ push :
6
+
7
+ jobs :
8
+ nix-matrix :
9
+ runs-on : ubuntu-latest
10
+ outputs :
11
+ matrix : ${{ steps.set-matrix.outputs.matrix }}
12
+ steps :
13
+ - uses : actions/checkout@v4
14
+ - uses : cachix/install-nix-action@v30
15
+ - id : set-matrix
16
+ name : Generate Nix Matrix
17
+ run : |
18
+ set -Eeu
19
+ matrix="$(nix eval --json '.#githubActions.matrix')"
20
+ echo "matrix=$matrix" >> "$GITHUB_OUTPUT"
21
+
22
+ nix-build :
23
+ name : ${{ matrix.name }} (${{ matrix.system }})
24
+ needs : nix-matrix
25
+ runs-on : ${{ matrix.os }}
26
+ strategy :
27
+ matrix : ${{fromJSON(needs.nix-matrix.outputs.matrix)}}
28
+ steps :
29
+ - uses : actions/checkout@v4
30
+ - uses : cachix/install-nix-action@v30
31
+ - run : nix build -L '.#${{ matrix.attr }}'
Original file line number Diff line number Diff line change 13
13
treefmt-nix . inputs . nixpkgs . follows = "nixpkgs" ;
14
14
git-hooks . url = "github:cachix/git-hooks.nix" ;
15
15
git-hooks . inputs . nixpkgs . follows = "nixpkgs" ;
16
+ nix-github-actions . url = "github:nix-community/nix-github-actions" ;
17
+ nix-github-actions . inputs . nixpkgs . follows = "nixpkgs" ;
16
18
} ;
17
19
18
20
outputs =
35
37
nix/nixpkgs.nix
36
38
nix/packages
37
39
nix/overlays
40
+ nix/github-actions.nix
38
41
] ;
39
42
} ) ;
40
43
}
Original file line number Diff line number Diff line change
1
+ { inputs , ... } :
2
+ {
3
+ flake . githubActions = inputs . nix-github-actions . lib . mkGithubMatrix {
4
+ checks = inputs . nixpkgs . lib . getAttrs [ "x86_64-linux" ] inputs . self . checks ;
5
+ } ;
6
+ }
You can’t perform that action at this time.
0 commit comments