Closed emilazy closed 1 month ago
This is still wrong because Nixpkgs isn’t necessarily from our nixpkgs
input at all and I forgot all the lessons I learned in https://github.com/LnL7/nix-darwin/pull/723 and everything is sad and I need to do something else here. :(
FWIW, my configuration builds successfully with this change. Good luck with finding a solution that satisfies you!
How does this PR relate to #1076?
I'm admitedly confused about this one. The error was
'nix.registry.nixpkgs.to.path' is defined multiple times
but all this PR does is type the value of nixpkgs.flake.source
from a flake attrset to a string representation of its path in the Nix store.
How does this prevent said option from being set multiple times?
edit: I see the mkIf (config.flake != null)
now:
Sorry for the dramatic reaction, I have just been repeatedly burned by Nixpkgs mismatch issues :)
I will try to explain what’s going on here and what issues there still are tomorrow.
Didn’t end up getting around to writing down all the moving parts here today; will try to do so in the next couple days. The tl;dr is that this PR won’t make anything worse and should be okay to merge, but the whole way this is set currently is quite incorrect in a way that can result in pretty bad outcomes (e.g. pinning a vulnerable version of Nixpkgs even though your system uses a good one, or even getting a different release branch entirely). I think the upstream NixOS version of this is also broken in a similar but less likely to trigger way (due to the fact that it’s in the Nixpkgs repository itself). I’m still thinking about the best way to resolve the issues; https://github.com/LnL7/nix-darwin/pull/1076 is not strictly related, but could potentially also use some rethinking depending on what ends up seeming best (and I should adjust it to fix https://github.com/LnL7/nix-darwin/issues/792 anyway).
Closes: #1082