From 1517dd9072c4db97dd2f3e785bbbafff38c48e81 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 13 Aug 2024 22:22:36 +0200 Subject: [PATCH] tests.kernel-config: remove 'with lib;' --- pkgs/test/kernel.nix | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/pkgs/test/kernel.nix b/pkgs/test/kernel.nix index e345d9fa207e..210d69f7ffae 100644 --- a/pkgs/test/kernel.nix +++ b/pkgs/test/kernel.nix @@ -2,9 +2,6 @@ # common-config.nix { lib, pkgs }: -with lib; -with kernel; - let lts_kernel = pkgs.linuxPackages.kernel; @@ -14,29 +11,29 @@ let structuredExtraConfig = structuredConfig; }).configfile.structuredConfig; - mandatoryVsOptionalConfig = mkMerge [ - { NIXOS_FAKE_USB_DEBUG = yes;} - { NIXOS_FAKE_USB_DEBUG = option yes; } + mandatoryVsOptionalConfig = lib.mkMerge [ + { NIXOS_FAKE_USB_DEBUG = lib.kernel.yes;} + { NIXOS_FAKE_USB_DEBUG = lib.kernel.option lib.kernel.yes; } ]; - freeformConfig = mkMerge [ - { NIXOS_FAKE_MMC_BLOCK_MINORS = freeform "32"; } # same as default, won't trigger any error - { NIXOS_FAKE_MMC_BLOCK_MINORS = freeform "64"; } # will trigger an error but the message is not great: + freeformConfig = lib.mkMerge [ + { NIXOS_FAKE_MMC_BLOCK_MINORS = lib.kernel.freeform "32"; } # same as default, won't trigger any error + { NIXOS_FAKE_MMC_BLOCK_MINORS = lib.kernel.freeform "64"; } # will trigger an error but the message is not great: ]; - mkDefaultWorksConfig = mkMerge [ - { "NIXOS_TEST_BOOLEAN" = yes; } - { "NIXOS_TEST_BOOLEAN" = lib.mkDefault no; } + mkDefaultWorksConfig = lib.mkMerge [ + { "NIXOS_TEST_BOOLEAN" = lib.kernel.yes; } + { "NIXOS_TEST_BOOLEAN" = lib.mkDefault lib.kernel.no; } ]; - allOptionalRemainOptional = mkMerge [ - { NIXOS_FAKE_USB_DEBUG = option yes;} - { NIXOS_FAKE_USB_DEBUG = option yes;} + allOptionalRemainOptional = lib.mkMerge [ + { NIXOS_FAKE_USB_DEBUG = lib.kernel.option lib.kernel.yes;} + { NIXOS_FAKE_USB_DEBUG = lib.kernel.option lib.kernel.yes;} ]; - failures = runTests { + failures = lib.runTests { testEasy = { - expr = (getConfig { NIXOS_FAKE_USB_DEBUG = yes;}).NIXOS_FAKE_USB_DEBUG; + expr = (getConfig { NIXOS_FAKE_USB_DEBUG = lib.kernel.yes;}).NIXOS_FAKE_USB_DEBUG; expected = { tristate = "y"; optional = false; freeform = null; }; };