2019-05-10 13:20:40 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2019-06-04 16:50:29 +00:00
|
|
|
set -Eeu
|
|
|
|
|
|
|
|
. ~/.nix-profile/etc/profile.d/nix.sh
|
|
|
|
|
2019-06-04 17:00:19 +00:00
|
|
|
GIT_ROOT=$(cd "${BASH_SOURCE%/*}" && git rev-parse --show-toplevel)
|
2019-05-10 13:20:40 +00:00
|
|
|
|
|
|
|
rm -rf .nix-gcroots
|
|
|
|
mkdir .nix-gcroots
|
|
|
|
|
2019-07-23 06:19:48 +00:00
|
|
|
drv=$(nix-instantiate --argstr target-os all --add-root ${GIT_ROOT}/shell.nix)
|
2019-05-10 13:20:40 +00:00
|
|
|
refs=$(nix-store --query --references $drv)
|
|
|
|
nix-store -r $refs --indirect --add-root $GIT_ROOT/.nix-gcroots/shell.dep
|