Last active
July 11, 2024 07:03
-
-
Save barrbrain/838440d10c2acbdf6f87b0f6d563d37c to your computer and use it in GitHub Desktop.
Pin NixOS build deps
This file contains hidden or 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
| set -e | |
| ROOTS=${1:-/root/dev-roots} | |
| mkdir -p "$ROOTS" | |
| rm "$ROOTS/"* | |
| nix --extra-experimental-features nix-command derivation show -r /run/current-system | | |
| jq -r 'map(select(.outputs.out.path)) | map(.outputs.out.path) | unique .[]' | | |
| grep -xFf <(nix-store --gc --print-dead) | | |
| xargs ln -vst "$ROOTS" | |
| ln -vst /nix/var/nix/gcroots/auto "$ROOTS/"* |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment