gytis-ivaskevicius / flake-utils-plus

Use Nix flakes without any fluff.
MIT License
459 stars 52 forks source link

Can't use flakes inputs modifying `nixpkgs.config` anymore #142

Closed aviallon closed 1 month ago

aviallon commented 6 months ago

Hello, since the following lines ^1 were changed, it is not possible to have flake inputs with nixosModues modifying nixpkgs.config. Including their modules causes an assertion error:

Your system configures nixpkgs with an externally created instance. nixpkgs.config options should be passed when creating the instance instead.

I absolutely need this module, and I can't find a way to fix the issue. Is there a way, either for the input flake to do things differently, or for me to fix something so that it works again?

gytis-ivaskevicius commented 6 months ago

I've somewhat recently fixed a similar issue, i guess I've overlooked this case. Will resolve this today/tomorrow

lordkekz commented 2 months ago

I'm also facing this issue and would like to propose a solution: Some modules set something in nixpkgs.config (I want to keep allowing that) but fup adds a module which sets nixpkgs.pkgs even if nixpkgs.config has content. I think it should then also add nixpkgs.config = lib.mkForce {};, e.g. after Line 162, to prevent the assertion failure, since the options really are being considered, just by fup and not nixpkgs.

In line 160 we would need to use hostConfig.nixpkgs.config instead of config.nixpkgs.config because the latter would be overridden.

@gytis-ivaskevicius Would you like me to send a PR?

gytis-ivaskevicius commented 2 months ago

that actually would be great, yes please