2019-05-10 13:20:40 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2019-07-26 14:51:06 +00:00
|
|
|
if [[ -z "${IN_NIX_SHELL}" ]]; then
|
|
|
|
echo "Remember to call 'make shell'!"
|
|
|
|
exit 1
|
|
|
|
fi
|
2019-06-04 16:50:29 +00:00
|
|
|
|
2019-07-26 14:51:06 +00:00
|
|
|
set -Eeu
|
2019-06-04 16:50:29 +00:00
|
|
|
|
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
|