nixos/nixpkgs: assert that nixpkgs.config is not set when pkgs is passed in externally

This is a common footgun people hit often. Remove it.
This commit is contained in:
K900 2023-09-26 17:53:40 +03:00
parent cdb6bfeab9
commit ce87196a00

View File

@ -383,6 +383,16 @@ in
the legacy definitions.
'';
}
{
assertion = opt.pkgs.isDefined -> cfg.config == {};
message = ''
Your system configures nixpkgs with an externally created instance.
`nixpkgs.config` options should be passed when creating the instance instead.
Current value:
${lib.generators.toPretty { multiline = true; } opt.config}
'';
}
];
};