Skip to content

Commit

Permalink
Temp github action to replace borked hydra setup
Browse files Browse the repository at this point in the history
  • Loading branch information
kip93 committed Jul 20, 2024
1 parent 63d0754 commit d84fd3f
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/build.yml
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-{}

0 comments on commit d84fd3f

Please sign in to comment.