1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-24 22:11:15 +02:00
nix/tests/functional/symlinks.sh
Eelco Dolstra 26b87e78b5 copyPathToStore(): Preserve symlinks
E.g. in a derivation attribute `foo = ./bar`, if ./bar is a symlink,
we should copy the symlink to the store, not its target. This restores
the behaviour of Nix <= 2.19.
2025-02-11 20:58:48 +01:00

16 lines
426 B
Bash

#!/usr/bin/env bash
source common.sh
# Check that when we have a derivation attribute that refers to a
# symlink, we copy the symlink, not its target.
# shellcheck disable=SC2016
nix build --impure --no-link --expr '
with import ./config.nix;
mkDerivation {
name = "simple";
builder = builtins.toFile "builder.sh" "[[ -L \"$symlink\" ]]; mkdir $out";
symlink = ./lang/symlink-resolution/foo/overlays;
}
'