1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-08 19:23:54 +02:00

nix shell: Handle output paths that are symlinks

This requires moving resolveSymlinks() into SourceAccessor. Also, it
requires LocalStoreAccessor::maybeLstat() to work on parents of the
store (to avoid an error like "/nix is not in the store").

Fixes #10375.

(cherry picked from commit 85b9f4ef4f)
This commit is contained in:
Eelco Dolstra 2024-04-10 23:46:19 +02:00 committed by github-actions[bot]
parent 60824fa97c
commit 3e138de2e0
8 changed files with 97 additions and 72 deletions

View file

@ -1,6 +1,6 @@
with import ./config.nix;
{
rec {
hello = mkDerivation {
name = "hello";
outputs = [ "out" "dev" ];
@ -24,6 +24,14 @@ with import ./config.nix;
'';
};
hello-symlink = mkDerivation {
name = "hello-symlink";
buildCommand =
''
ln -s ${hello} $out
'';
};
salve-mundi = mkDerivation {
name = "salve-mundi";
outputs = [ "out" ];