1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-03-06 16:57:03 +00:00

nixpkgs-disabled: warn instead of assert (#6466)

Temporarily fixes backwards compatibility as issued in #6172.
This commit is contained in:
bricked 2025-02-17 01:39:24 +00:00 committed by GitHub
parent 25870c6600
commit 662fa98bf4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -63,11 +63,19 @@ in {
};
config = {
assertions = [{
assertion = cfg.config == null && cfg.overlays == null;
message = ''
`nixpkgs` options are disabled when `home-manager.useGlobalPkgs` is enabled.
'';
}];
assertions = [
# TODO: Re-enable assertion after 25.05 (&&)
{
assertion = cfg.config == null || cfg.overlays == null;
message = ''
`nixpkgs` options are disabled when `home-manager.useGlobalPkgs` is enabled.
'';
}
];
warnings = optional ((cfg.config != null) || (cfg.overlays != null)) ''
You have set either `nixpkgs.config` or `nixpkgs.overlays` while using `home-manager.useGlobalPkgs`.
This will soon not be possible. Please remove all `nixpkgs` options when using `home-manager.useGlobalPkgs`.
'';
};
}