-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Temp github action to replace borked hydra setup
- Loading branch information
Showing
1 changed file
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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-{} |