From dd46445adc028cd627dcf4686e74f464fb4b7c2e Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Mon, 11 Mar 2024 08:37:31 -0700 Subject: [PATCH 1/3] Avoid top-level `with ...;` in lib/tests/modules/alias-with-priority-can-override.nix --- .../modules/alias-with-priority-can-override.nix | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/lib/tests/modules/alias-with-priority-can-override.nix b/lib/tests/modules/alias-with-priority-can-override.nix index 9a18c9d9f613..82a4c0df8cba 100644 --- a/lib/tests/modules/alias-with-priority-can-override.nix +++ b/lib/tests/modules/alias-with-priority-can-override.nix @@ -6,12 +6,19 @@ { config, lib, ... }: -with lib; +let + inherit (lib) + mkAliasOptionModule + mkForce + mkOption + types + ; +in { options = { # A simple boolean option that can be enabled or disabled. - enable = lib.mkOption { + enable = mkOption { type = types.nullOr types.bool; default = null; example = true; @@ -41,7 +48,7 @@ with lib; # should override the next import. ( { config, lib, ... }: { - enableAlias = lib.mkForce false; + enableAlias = mkForce false; } ) From 0426125c537b198e5d6db3f57e404e3f6954b85f Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Mon, 11 Mar 2024 08:38:14 -0700 Subject: [PATCH 2/3] Avoid top-level `with ...;` in lib/tests/modules/alias-with-priority.nix --- lib/tests/modules/alias-with-priority.nix | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/lib/tests/modules/alias-with-priority.nix b/lib/tests/modules/alias-with-priority.nix index a35a06fc6974..c64a586ab2d1 100644 --- a/lib/tests/modules/alias-with-priority.nix +++ b/lib/tests/modules/alias-with-priority.nix @@ -6,12 +6,19 @@ { config, lib, ... }: -with lib; +let + inherit (lib) + mkAliasOptionModule + mkDefault + mkOption + types + ; +in { options = { # A simple boolean option that can be enabled or disabled. - enable = lib.mkOption { + enable = mkOption { type = types.nullOr types.bool; default = null; example = true; @@ -41,7 +48,7 @@ with lib; # should be able to be overridden by the next import. ( { config, lib, ... }: { - enableAlias = lib.mkDefault false; + enableAlias = mkDefault false; } ) From 20abffc0dd8ccc9896f787bb7b64edd2b1d05cd5 Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Mon, 11 Mar 2024 08:38:37 -0700 Subject: [PATCH 3/3] Avoid top-level `with ...;` in lib/tests/modules/extendModules-168767-imports.nix --- lib/tests/modules/extendModules-168767-imports.nix | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/tests/modules/extendModules-168767-imports.nix b/lib/tests/modules/extendModules-168767-imports.nix index 489e6b5a5d83..6b50b81236d1 100644 --- a/lib/tests/modules/extendModules-168767-imports.nix +++ b/lib/tests/modules/extendModules-168767-imports.nix @@ -2,7 +2,14 @@ , extendModules , ... }: -with lib; + +let + inherit (lib) + mkOption + mkOverride + types + ; +in { imports = [