-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (41 loc) · 1.46 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# TODO Remove when I can be arsed to fix the hydra server
name: "Build"
on: { push: { branches: [ "main" ] } }
jobs:
nix-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v25
- uses: cachix/cachix-action@v14
with:
name: npp
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- uses: nixbuild/nixbuild-action@v19
with:
nixbuild_token: ${{ secrets.NIXBUILD_NET_AUTH_TOKEN }}
# Evaluating things one by one like this is slower but also does not require ungodly amounts of memory
- run: |
set -euo pipefail
# shellcheck disable=SC2016
nix eval --impure .#hydraJobs --apply '
hydraJobs:
let
flatten = x:
if builtins.isList x then
builtins.concatMap flatten x
else
[ x ]
;
recurse = set: builtins.map (x: x.path) (flatten (recurse'"'"' [ ] set));
recurse'"'"' = path: set:
if set.type or "" == "derivation" then
{ inherit path; }
else
builtins.map (name: recurse'"'"' (path ++ [ name ]) set.${name}) (builtins.attrNames set)
;
in
recurse hydraJobs
' --json \
| nix run nixpkgs#jq -- --raw-output0 '.[] | map("\"" + . + "\"") | join(".")' \
| xargs -tr0I{} nix -L build --impure --keep-going .#hydraJobs.{} -o result-{}