nix icon indicating copy to clipboard operation
nix copied to clipboard

flakeref: follow symlinks

Open con-f-use opened this issue 2 years ago • 3 comments

fixes #9463

Motivation

Given /tmp/flakelink is a symlink to an actual flake directory, currently this happens:

$ nix build '/tmp/flakelink/#hello'
error: path '/tmp/flakelink' is not a flake (because it's not a directory)

This PR attempts to fix that.

Warning: I have no prior knowledge of the nix-codebase or much of a background in C++. Please review carefully. In particular, I do not know if there's any ramification, regarding the use of flakeref in the inputs definitions of flake.nix files or other edge-cases. @infinisil and @YorikSar pressured me into this 😉

Priorities

Add :+1: to pull requests you find important.

con-f-use avatar Nov 30 '23 19:11 con-f-use

I was about to open a PR with the same change.

This PR, if merged, would fix #8013.

zedseven avatar Jan 08 '24 02:01 zedseven

I think this is a good and simple change. One thing I would suggest is adding a functional test for this. Have a look at this section of the manual for info on how to set this up.

iFreilicht avatar Jan 26 '24 14:01 iFreilicht

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/2024-03-11-nix-team-meeting-132/42960/1

nixos-discourse avatar Apr 08 '24 15:04 nixos-discourse

Added you as a coauthor in https://github.com/NixOS/nix/pull/12286

Mic92 avatar Feb 02 '25 01:02 Mic92