diff options
author | K900 <me@0upti.me> | 2023-10-01 10:11:15 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-01 10:11:15 +0300 |
commit | eb8ce7930d14dafcc7eff56c2f9efca6a3b2f622 (patch) | |
tree | d0962eb1a8f99f7e6f5b263f87d7b4a3af186b47 /nixos/modules/misc | |
parent | 479a41341f338d3b4e3352541a6bfd6d4f476240 (diff) | |
parent | 95c3abfda09fc7279f6c536dd620030b7da76601 (diff) | |
download | nixpkgs-eb8ce7930d14dafcc7eff56c2f9efca6a3b2f622.tar nixpkgs-eb8ce7930d14dafcc7eff56c2f9efca6a3b2f622.tar.gz nixpkgs-eb8ce7930d14dafcc7eff56c2f9efca6a3b2f622.tar.bz2 nixpkgs-eb8ce7930d14dafcc7eff56c2f9efca6a3b2f622.tar.lz nixpkgs-eb8ce7930d14dafcc7eff56c2f9efca6a3b2f622.tar.xz nixpkgs-eb8ce7930d14dafcc7eff56c2f9efca6a3b2f622.tar.zst nixpkgs-eb8ce7930d14dafcc7eff56c2f9efca6a3b2f622.zip |
Merge pull request #257458 from K900/die-nixpkgs-config-die
treewide: fail when `nixpkgs.config` is set with explicit `pkgs`, remove all `nixpkgs.config` usages in in-tree modules
Diffstat (limited to 'nixos/modules/misc')
-rw-r--r-- | nixos/modules/misc/locate.nix | 4 | ||||
-rw-r--r-- | nixos/modules/misc/nixpkgs.nix | 10 |
2 files changed, 11 insertions, 3 deletions
diff --git a/nixos/modules/misc/locate.nix b/nixos/modules/misc/locate.nix index acf441cda62..482d12fe0ca 100644 --- a/nixos/modules/misc/locate.nix +++ b/nixos/modules/misc/locate.nix @@ -230,9 +230,7 @@ in plocate = (mkIf isPLocate (mkMerge [ common plocate ])); }; - nixpkgs.config = { locate.dbfile = cfg.output; }; - - environment.systemPackages = [ cfg.locate ]; + environment.systemPackages = [ (cfg.locate.override { dbfile = cfg.output; }) ]; environment.variables = mkIf (!isMorPLocate) { LOCATE_PATH = cfg.output; }; diff --git a/nixos/modules/misc/nixpkgs.nix b/nixos/modules/misc/nixpkgs.nix index cc5f5742109..bfcae9c7a93 100644 --- a/nixos/modules/misc/nixpkgs.nix +++ b/nixos/modules/misc/nixpkgs.nix @@ -379,6 +379,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} + ''; + } ]; }; |