1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-24 22:11:15 +02:00
nix/tests/functional/flakes/trace-ifd.sh
gustavderdrache d80f0fb15a Add test for output warning to ensure stability
Co-authored-by: Eelco Dolstra <edolstra@gmail.com>
2025-05-27 09:18:51 -04:00

33 lines
688 B
Bash

#!/usr/bin/env bash
source ./common.sh
requireGit
flake1Dir="$TEST_ROOT/flake"
createGitRepo "$flake1Dir"
createSimpleGitFlake "$flake1Dir"
cat > "$flake1Dir/flake.nix" <<'EOF'
{
outputs = { self }: let inherit (import ./config.nix) mkDerivation; in {
drv = mkDerivation {
name = "drv";
buildCommand = ''
echo drv >$out
'';
};
ifd = mkDerivation {
name = "ifd";
buildCommand = ''
echo ${builtins.readFile self.drv} >$out
'';
};
};
}
EOF
nix build --no-link "$flake1Dir#ifd" --option trace-import-from-derivation true 2>&1 \
| grepQuiet 'warning: built .* during evaluation due to an import from derivation'