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:
parent
cdb6bfeab9
commit
ce87196a00
1 changed files with 10 additions and 0 deletions
|
@ -383,6 +383,16 @@ in
|
||||||
the legacy definitions.
|
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}
|
||||||
|
'';
|
||||||
|
}
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue