nix-darwin icon indicating copy to clipboard operation
nix-darwin copied to clipboard

darwin-rebuild leaves `./result` symlink behind when using flakes

Open lilyball opened this issue 3 years ago • 1 comments

When I use the --flake flag, darwin-rebuild ends up leaving a ./result symlink behind for any action that involves a build. It looks like the script explicitly avoids adding --no-out-link when using --flake but I don't know why.

❯ ls -F
❯ darwin-rebuild --flake darwin-config check
building the system configuration...
ok
❯ ls -F
result@

lilyball avatar Nov 09 '21 00:11 lilyball

@lilyball I fixed this myself on my fork. Feel free to use it, I'll be keeping it up to date with any changes that come upstream until this fix is in then I can move back to upstream myself. You should be able to just replace lnl7 with ryantking in your flake.nix and do a darwin-rebuild switch --flake /your/flake. I did a fresh nix install since my system got into a bad state, but I'm pretty sure if you change your flake and rebuild, your darwin-rebuild tool will now be my version with the fix.

@LnL7 I'd be happy to PR my fix, but there's already an open one (https://github.com/LnL7/nix-darwin/pull/310), that I just lifted the fix from and based it off the most recent master.

ryantking avatar Nov 21 '21 18:11 ryantking

Should have been fixed by https://github.com/LnL7/nix-darwin/pull/578.

emilazy avatar Jul 10 '23 12:07 emilazy