Skip to content

Commit 5a31bfd

Browse files
committed
Try setting up github actions
1 parent dc898e1 commit 5a31bfd

File tree

3 files changed

+64
-2
lines changed

3 files changed

+64
-2
lines changed
+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Nix Flake actions
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- master
8+
- main
9+
10+
jobs:
11+
nix-matrix:
12+
runs-on: ubuntu-latest
13+
outputs:
14+
matrix: ${{ steps.set-matrix.outputs.matrix }}
15+
steps:
16+
- uses: actions/checkout@v4
17+
- uses: cachix/install-nix-action@v27
18+
- id: set-matrix
19+
name: Generate Nix Matrix
20+
run: |
21+
set -Eeu
22+
matrix="$(nix eval --json '.#githubActions.matrix')"
23+
echo "matrix=$matrix" >> "$GITHUB_OUTPUT"
24+
25+
nix-build:
26+
needs: nix-matrix
27+
runs-on: ${{ matrix.os }}
28+
strategy:
29+
matrix: ${{fromJSON(needs.nix-matrix.outputs.matrix)}}
30+
steps:
31+
- uses: actions/checkout@v4
32+
- uses: cachix/install-nix-action@v27
33+
- run: nix build -L '.#${{ matrix.attr }}'

flake.lock

+21
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

+10-2
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,16 @@
44
inputs = {
55
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05";
66
flake-utils.url = "github:numtide/flake-utils";
7+
nix-github-actions.url = "github:nix-community/nix-github-actions";
8+
nix-github-actions.inputs.nixpkgs.follows = "nixpkgs";
79
};
810

9-
outputs = { self, nixpkgs, flake-utils }:
10-
flake-utils.lib.eachDefaultSystem (system:
11+
outputs = { self, nixpkgs, flake-utils, nix-github-actions }:
12+
{
13+
githubActions = nix-github-actions.lib.mkGithubMatrix {
14+
checks = nixpkgs.lib.getAttrs [ "x86_64-linux" ] self.checks;
15+
};
16+
} // flake-utils.lib.eachDefaultSystem (system:
1117
let
1218
pkgs = nixpkgs.legacyPackages.${system};
1319

@@ -30,6 +36,8 @@
3036

3137
packages.default = self.packages.${system}.${packageName};
3238

39+
checks.tailscale-manager = self.packages.${system}.tailscale-manager;
40+
3341
devShells.default = pkgs.mkShell {
3442
buildInputs = with pkgs; [
3543
haskellPackages.haskell-language-server # you must build it with your ghc to work

0 commit comments

Comments
 (0)