nix-darwin
                                
                                 nix-darwin copied to clipboard
                                
                                    nix-darwin copied to clipboard
                            
                            
                            
                        flakes: Do not verify channels when using flakes.
#403
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
In any case, when using flakes, nix-darwin won't even refer to a channel, correct?
This is blocking me from updating — any ideas how to workaround this in the meantime?
@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?
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
LGTM. Can we get this merged?
@domenkozar just ran into this issue, any chance you can take a look at this PR?
@jsoo1 could you rebase?
Sure. It's been a bit since I thought about this one. One sec...
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.