Remove devenv impurity #3
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
# 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-{} |