diff options
| author | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2026-10-28 13:52:23 +0100 |
|---|---|---|
| committer | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2026-10-28 13:52:23 +0100 |
| commit | f3598f99127c0bdb81e7ac7676df505d72a61a2a (patch) | |
| tree | 18c7fe6cc8a556d498419ff2dc4bf6e1a43d016b /scripts/build.sh | |
| parent | tests/default: Also provide `lib` to the tests (diff) | |
| download | nixos-server-f3598f99127c0bdb81e7ac7676df505d72a61a2a.zip | |
scripts/build.sh: Add gc roots to every build output
Diffstat (limited to '')
| -rwxr-xr-x | scripts/build.sh | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/scripts/build.sh b/scripts/build.sh index f1ff620..1cde3f0 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -2,6 +2,7 @@ set -eu +root="$(git rev-parse --show-toplevel)" wrong_arg=false use_dirty=true @@ -37,7 +38,14 @@ if [ "$use_dirty" = "false" ]; then fi for host in "server2" "server3"; do - nix build ".#nixosConfigurations.$host.config.system.build.toplevel" --print-out-paths --no-link --option max-jobs 1 + nix build ".#nixosConfigurations.$host.config.system.build.toplevel" --print-out-paths --option max-jobs 1 + + result_file="$root/result-$host" + if [ -L "$result_file" ]; then + rm "$result_file" + fi + nix-store --add-root "$result_file" --realise "$(readlink -f ./result)" + rm ./result done # vim: ft=sh |
