nh icon indicating copy to clipboard operation
nh copied to clipboard

Add flag to enable creation of `result` symlinks for build commands

Open DerRockWolf opened this issue 1 year ago • 1 comments

On the one hand, it's really nice that nh * build doesn't create result symlinks, as they (if not cleaned up) prevent garbage collection, on the other hand it's sometimes really helpful to be able to look around the files that will end up on my system.

Therefore, I would suggest adding a new flag (e.g., --symlink-result) to the nh os build & nh home build commands that creates the result symlink.

If you agree that this would be a good feature for nh I can also try to implement it 🙂

DerRockWolf avatar Jul 14 '24 09:07 DerRockWolf

The current implementation unconditionally sets the out-link into some ::tempfile here: https://github.com/viperML/nh/blob/7f8a1859ed6ea971fcf49b07ca8938e3000c3af4/src/nixos.rs#L39-L41

If you want to implement it, check if matches!(rebuild_type, OsRebuildType::Build(_), and change that path to result

viperML avatar Jul 14 '24 09:07 viperML

closed by 6878bc368e03915680dc1cfc929dc825bf5b7ca1

DerRockWolf avatar Aug 18 '24 15:08 DerRockWolf

is seems that if i use nh darwin switch in any folder, it will create a @result in it :( it will polute the current folder

image

it seems that it be fixed by #187

Parsifa1 avatar Dec 06 '24 05:12 Parsifa1