From 662fa98bf488daa82ce8dc2bc443872952065ab9 Mon Sep 17 00:00:00 2001 From: bricked Date: Mon, 17 Feb 2025 01:39:24 +0000 Subject: [PATCH] nixpkgs-disabled: warn instead of assert (#6466) Temporarily fixes backwards compatibility as issued in #6172. --- modules/misc/nixpkgs-disabled.nix | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/modules/misc/nixpkgs-disabled.nix b/modules/misc/nixpkgs-disabled.nix index 09afc446..70574521 100644 --- a/modules/misc/nixpkgs-disabled.nix +++ b/modules/misc/nixpkgs-disabled.nix @@ -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`. + ''; }; }