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

flakes: Do not verify channels when using flakes.

Open jsoo1 opened this issue 2 years ago • 5 comments

#403

jsoo1 avatar Dec 17 '21 22:12 jsoo1

It's been a while and I had to back track from using flakes. But if memory serves, if the system has no channels at all, the check will fail and just not activate the system at all. I.E. if nix is installed with --no-channel-add: https://github.com/NixOS/nix/blob/7e301fd74e929af916116a04d84e130f9e0112de/scripts/install-nix-from-closure.sh#L74

jsoo1 avatar Jun 17 '22 04:06 jsoo1

In any case, when using flakes, nix-darwin won't even refer to a channel, correct?

jsoo1 avatar Jun 17 '22 04:06 jsoo1

This is blocking me from updating — any ideas how to workaround this in the meantime?

socksy avatar Aug 31 '22 14:08 socksy

@socksy, can you provide some more details, e.g., the command you're running, the error that results, and a link to your config if it's posted online?

malob avatar Aug 31 '22 20:08 malob

After a full night's sleep I solved it! :)

I was doing

sudo rm -r ~/.nix-channels
nix-channel --update

which would error out when I did darwin-rebuild switch --flake ".#" with a symlink does not point your users channels, aborting activation.

I solved it last night by just doing sudo darwin-rebuild switch --flake ".#", which was not ideal. Now I looked closer, and saw that the second time around I was actually getting the error that ~/.nix-defexpr/channels was pointing at the wrong thing. The solution simply was to

sudo rm -r  ~/.nix-defexpr/channels
nix-channel --update

and now the darwin-rebuild works again

socksy avatar Sep 01 '22 13:09 socksy

LGTM. Can we get this merged?

yangm97 avatar Feb 15 '23 20:02 yangm97

@domenkozar just ran into this issue, any chance you can take a look at this PR?

Enzime avatar May 31 '23 01:05 Enzime

@jsoo1 could you rebase?

domenkozar avatar May 31 '23 08:05 domenkozar

Sure. It's been a bit since I thought about this one. One sec...

jsoo1 avatar May 31 '23 13:05 jsoo1

Note that https://github.com/LnL7/nix-darwin/pull/723 ended up effectively reverting this, due to https://github.com/LnL7/nix-darwin/pull/723#discussion_r1257442026. Hopefully if people start having this problem again we can figure out what's causing it or else re-disable the check.

emilazy avatar Jul 10 '23 09:07 emilazy