mirror of
https://github.com/ipetkov/crane.git
synced 2024-11-22 14:10:16 +03:00
6f7504ad93
Callers should use `mkLib` with an instantiation of `pkgs` instead of using `crane.lib.${system}` directly
24 lines
794 B
Bash
Executable File
24 lines
794 B
Bash
Executable File
#!/bin/sh
|
|
|
|
set -eu
|
|
|
|
scriptDir=$(dirname "$0")
|
|
cd "${scriptDir}"
|
|
|
|
nixpkgsOverride="$(../../ci/ref-from-lock.sh ../../test#nixpkgs)"
|
|
craneOverride="--override-input crane ../.. --override-input nixpkgs ${nixpkgsOverride}"
|
|
flakeSrc=$(nix flake metadata ${craneOverride} --json 2>/dev/null | jq -r '.path')
|
|
|
|
# Get information about the default derivation
|
|
# Then pull out any input sources
|
|
drvSrcs=$(nix show-derivation ${craneOverride} '.#dummy' 2>/dev/null |
|
|
jq -r 'to_entries[].value.inputSrcs[]')
|
|
|
|
# And lastly make sure we DO NOT find the flake root source listed
|
|
# or else the dummy derivation will depend on _too much_ (and get
|
|
# invalidated with irrelevant changes)
|
|
if echo "${drvSrcs}" | grep -q -F "${flakeSrc}"; then
|
|
echo "error: dummy derivation depends on flake source"
|
|
exit 1
|
|
fi
|