Skip to content

Commit

Permalink
build using the remote store (but copy explicitly now!)
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianHicks committed Aug 10, 2022
1 parent 8c1de2d commit 101fa9d
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions build.sh
Expand Up @@ -8,13 +8,20 @@ if test -z "$SYSTEM"; then
exit 1
fi

set -x
# TODO: it'd be really cool to use
# https://blog.nixbuild.net/posts/2022-03-16-lightning-fast-ci-with-nixbuild-net.html
# eventually, but for now it's giving me some trouble copying the built closure
# after the build, so we can't actually do the deploy. It'll probably get stabler
# in the future, and I should try again then.
nix --extra-experimental-features "nix-command flakes" \
build \
--print-build-logs \
".#nixosConfigurations.${SYSTEM}.config.system.build.toplevel"
set -x
OUTPUT="$(
nix --extra-experimental-features "nix-command flakes" \
build \
--json \
--eval-store auto \
--store ssh-ng://eu.nixbuild.net \
--print-build-logs \
".#nixosConfigurations.${SYSTEM}.config.system.build.toplevel"
)"

OUT="$(jq -r '.[0]'.outputs.out <<< "$OUTPUT")"

nix-copy-closure --from eu.nixbuild.net "$OUT"
if test -h result; then rm result; fi
ln -s "$OUT" result

0 comments on commit 101fa9d

Please sign in to comment.