File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22
33set -ex
44
5- OPTIONAL_FLAGS=$( nix-instantiate \
6- --eval --strict --json -E '
7- builtins.filter
8- (n: builtins.match "with[A-Z].+" n != null)
9- (builtins.attrNames (builtins.functionArgs (import ./shell.nix)))
10- ' | jq -r ' map("--arg \(.) true") | join(" ")' )
5+ BASE_DIR=$( cd " $( dirname " $0 " ) /../.." && pwd)
6+
7+ OPTIONAL_FLAGS=$( nix-instantiate -I " nixpkgs=$BASE_DIR /tools/nix/pkgs.nix" --eval --strict --raw -E "
8+ (import <nixpkgs> {}).lib.concatMapStrings
9+ (n: ''--arg \$ {n} true '')
10+ (builtins.filter
11+ (n: builtins.match ''with[A-Z].+'' n != null)
12+ (builtins.attrNames (builtins.functionArgs (import $BASE_DIR /shell.nix))))
13+ "
14+ )
1115
1216DRV=$(
17+ cd " $BASE_DIR "
1318 # shellcheck disable=SC2086
1419 nix-instantiate -I " nixpkgs=./tools/nix/pkgs.nix" shell.nix \
1520 $OPTIONAL_FLAGS \
@@ -54,4 +59,4 @@ REFS=$(nix-store --query --references "$DRV")
5459STORE_PATHS=$( echo " $REFS " | xargs nix-store --realise)
5560REQUISITES=$( echo " $STORE_PATHS " | xargs nix-store --query --requisites)
5661
57- echo " $REQUISITES " | sort -k1.45
62+ echo " $REQUISITES " | sort -k1.45 | uniq
You can’t perform that action at this time.
0 commit comments