···113 args ? {}
114 , # This would be remove in the future, Prefer _module.check option instead.
115 check ? true
0000116 }:
117 let
118 withWarnings = x:
···338 modules ? [],
339 specialArgs ? {},
340 prefix ? [],
0341 }:
342 evalModules (evalModulesArgs // {
343 modules = regularModules ++ modules;
344 specialArgs = evalModulesArgs.specialArgs or {} // specialArgs;
345 prefix = extendArgs.prefix or evalModulesArgs.prefix;
0346 });
347348 type = lib.types.submoduleWith {
349- inherit modules specialArgs;
350 };
351352 result = withWarnings {
···113 args ? {}
114 , # This would be remove in the future, Prefer _module.check option instead.
115 check ? true
116+ # Internal variable to avoid `_key` collisions regardless
117+ # of `extendModules`. Used in `submoduleWith`.
118+ # Test case: lib/tests/modules, "168767"
119+ , extensionOffset ? 0
120 }:
121 let
122 withWarnings = x:
···342 modules ? [],
343 specialArgs ? {},
344 prefix ? [],
345+ extensionOffset ? length modules,
346 }:
347 evalModules (evalModulesArgs // {
348 modules = regularModules ++ modules;
349 specialArgs = evalModulesArgs.specialArgs or {} // specialArgs;
350 prefix = extendArgs.prefix or evalModulesArgs.prefix;
351+ inherit extensionOffset;
352 });
353354 type = lib.types.submoduleWith {
355+ inherit modules specialArgs extensionOffset;
356 };
357358 result = withWarnings {
+5-1
lib/tests/modules.sh
···293294# moduleType
295checkConfigOutput '^"a b"$' config.resultFoo ./declare-variants.nix ./define-variant.nix
296-checkConfigOutput '^"a y z"$' config.resultFooBar ./declare-variants.nix ./define-variant.nix
297checkConfigOutput '^"a b c"$' config.resultFooFoo ./declare-variants.nix ./define-variant.nix
298299## emptyValue's
···326327# Test that types.optionType leaves types untouched as long as they don't need to be merged
328checkConfigOutput 'ok' config.freeformItems.foo.bar ./adhoc-freeformType-survives-type-merge.nix
0000329330cat <<EOF
331====== module tests ======
···293294# moduleType
295checkConfigOutput '^"a b"$' config.resultFoo ./declare-variants.nix ./define-variant.nix
296+checkConfigOutput '^"a b y z"$' config.resultFooBar ./declare-variants.nix ./define-variant.nix
297checkConfigOutput '^"a b c"$' config.resultFooFoo ./declare-variants.nix ./define-variant.nix
298299## emptyValue's
···326327# Test that types.optionType leaves types untouched as long as they don't need to be merged
328checkConfigOutput 'ok' config.freeformItems.foo.bar ./adhoc-freeformType-survives-type-merge.nix
329+330+# Anonymous submodules don't get nixed by import resolution/deduplication
331+# because of an `extendModules` bug, issue 168767.
332+checkConfigOutput '^1$' config.sub.specialisation.value ./extendModules-168767-imports.nix
333334cat <<EOF
335====== module tests ======
···1-# This file was generated by go2nix.
2-[
3- {
4- goPackagePath = "github.com/shoenig/config";
5- fetch = {
6- type = "git";
7- url = "https://github.com/shoenig/config";
8- rev = "7d793e7ad7f175ef22743b1ea38acee8267788db";
9- sha256 = "1dhcv1j5xk30kj73dfnx3xqx8mcvk9r8ywp9khgf2kq6wh9sm1qr";
10- };
11- }
12-]
···000000000000
+1
pkgs/top-level/aliases.nix
···141142 ### C ###
1430144 caddy1 = throw "caddy 1.x has been removed from nixpkgs, as it's unmaintained: https://github.com/caddyserver/caddy/blob/master/.github/SECURITY.md#supported-versions"; # Added 2020-10-02
145 calibre-py2 = throw "calibre-py2 has been removed from nixpkgs, as calibre has upgraded to python 3. Please use calibre as replacement"; # Added 2021-01-13
146 calibre-py3 = throw "calibre-py3 has been removed from nixpkgs, as calibre's default python version is now 3. Please use calibre as replacement"; # Added 2021-01-13
···141142 ### C ###
143144+ c14 = throw "c14 is deprecated and archived by upstream"; # Added 2022-04-10
145 caddy1 = throw "caddy 1.x has been removed from nixpkgs, as it's unmaintained: https://github.com/caddyserver/caddy/blob/master/.github/SECURITY.md#supported-versions"; # Added 2020-10-02
146 calibre-py2 = throw "calibre-py2 has been removed from nixpkgs, as calibre has upgraded to python 3. Please use calibre as replacement"; # Added 2021-01-13
147 calibre-py3 = throw "calibre-py3 has been removed from nixpkgs, as calibre's default python version is now 3. Please use calibre as replacement"; # Added 2021-01-13