diff options
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/modules/services/misc/home-assistant.nix | 19 | ||||
-rw-r--r-- | nixos/tests/all-tests.nix | 4 | ||||
-rw-r--r-- | nixos/tests/kernel-generic.nix | 37 | ||||
-rw-r--r-- | nixos/tests/kernel-latest.nix | 17 | ||||
-rw-r--r-- | nixos/tests/kernel-lts.nix | 17 | ||||
-rw-r--r-- | nixos/tests/kernel-testing.nix | 17 |
6 files changed, 49 insertions, 62 deletions
diff --git a/nixos/modules/services/misc/home-assistant.nix b/nixos/modules/services/misc/home-assistant.nix index f6398c0839793..2787c975b352e 100644 --- a/nixos/modules/services/misc/home-assistant.nix +++ b/nixos/modules/services/misc/home-assistant.nix @@ -50,10 +50,15 @@ let # List of components used in config extraComponents = filter useComponent availableComponents; - package = if (cfg.autoExtraComponents && cfg.config != null) + testedPackage = if (cfg.autoExtraComponents && cfg.config != null) then (cfg.package.override { inherit extraComponents; }) else cfg.package; + # overridePythonAttrs has to be applied after override + package = testedPackage.overridePythonAttrs (oldAttrs: { + doCheck = false; + }); + # If you are changing this, please update the description in applyDefaultConfig defaultConfig = { homeassistant.time_zone = config.time.timeZone; @@ -183,13 +188,9 @@ in { }; package = mkOption { - default = pkgs.home-assistant.overridePythonAttrs (oldAttrs: { - doCheck = false; - }); + default = pkgs.home-assistant; defaultText = literalExample '' - pkgs.home-assistant.overridePythonAttrs (oldAttrs: { - doCheck = false; - }) + pkgs.home-assistant ''; type = types.package; example = literalExample '' @@ -198,10 +199,12 @@ in { } ''; description = '' - Home Assistant package to use. By default the tests are disabled, as they take a considerable amout of time to complete. + Home Assistant package to use. Tests are automatically disabled, as they take a considerable amout of time to complete. Override <literal>extraPackages</literal> or <literal>extraComponents</literal> in order to add additional dependencies. If you specify <option>config</option> and do not set <option>autoExtraComponents</option> to <literal>false</literal>, overriding <literal>extraComponents</literal> will have no effect. + Avoid <literal>home-assistant.overridePythonAttrs</literal> if you use + <literal>autoExtraComponents</literal>. ''; }; diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index 76755208e6a92..58b2ba7fa514a 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -194,9 +194,7 @@ in keepalived = handleTest ./keepalived.nix {}; keepassxc = handleTest ./keepassxc.nix {}; kerberos = handleTest ./kerberos/default.nix {}; - kernel-latest = handleTest ./kernel-latest.nix {}; - kernel-lts = handleTest ./kernel-lts.nix {}; - kernel-testing = handleTest ./kernel-testing.nix {}; + kernel-generic = handleTest ./kernel-generic.nix {}; kernel-latest-ath-user-regd = handleTest ./kernel-latest-ath-user-regd.nix {}; keycloak = discoverTests (import ./keycloak.nix); keymap = handleTest ./keymap.nix {}; diff --git a/nixos/tests/kernel-generic.nix b/nixos/tests/kernel-generic.nix new file mode 100644 index 0000000000000..fbead1dc23b76 --- /dev/null +++ b/nixos/tests/kernel-generic.nix @@ -0,0 +1,37 @@ +{ system ? builtins.currentSystem +, config ? { } +, pkgs ? import ../.. { inherit system config; } +}: + +with pkgs.lib; + +let + makeKernelTest = version: linuxPackages: (import ./make-test-python.nix ({ pkgs, ... }: { + name = "kernel-${version}"; + meta = with pkgs.lib.maintainers; { + maintainers = [ nequissimus ]; + }; + + machine = { ... }: + { + boot.kernelPackages = linuxPackages; + }; + + testScript = + '' + assert "Linux" in machine.succeed("uname -s") + assert "${linuxPackages.kernel.modDirVersion}" in machine.succeed("uname -a") + ''; + })); +in +with pkgs; { + linux_4_4 = makeKernelTest "4.4" linuxPackages_4_4; + linux_4_9 = makeKernelTest "4.9" linuxPackages_4_9; + linux_4_14 = makeKernelTest "4.14" linuxPackages_4_14; + linux_4_19 = makeKernelTest "4.19" linuxPackages_4_19; + linux_5_4 = makeKernelTest "5.4" linuxPackages_5_4; + linux_5_10 = makeKernelTest "5.10" linuxPackages_5_10; + linux_5_11 = makeKernelTest "5.11" linuxPackages_5_11; + + linux_testing = makeKernelTest "testing" linuxPackages_testing; +} diff --git a/nixos/tests/kernel-latest.nix b/nixos/tests/kernel-latest.nix deleted file mode 100644 index 323dde267a426..0000000000000 --- a/nixos/tests/kernel-latest.nix +++ /dev/null @@ -1,17 +0,0 @@ -import ./make-test-python.nix ({ pkgs, ...} : { - name = "kernel-latest"; - meta = with pkgs.lib.maintainers; { - maintainers = [ nequissimus ]; - }; - - machine = { pkgs, ... }: - { - boot.kernelPackages = pkgs.linuxPackages_latest; - }; - - testScript = - '' - assert "Linux" in machine.succeed("uname -s") - assert "${pkgs.linuxPackages_latest.kernel.version}" in machine.succeed("uname -a") - ''; -}) diff --git a/nixos/tests/kernel-lts.nix b/nixos/tests/kernel-lts.nix deleted file mode 100644 index 9b03e9db6d84e..0000000000000 --- a/nixos/tests/kernel-lts.nix +++ /dev/null @@ -1,17 +0,0 @@ -import ./make-test-python.nix ({ pkgs, ...} : { - name = "kernel-lts"; - meta = with pkgs.lib.maintainers; { - maintainers = [ nequissimus ]; - }; - - machine = { pkgs, ... }: - { - boot.kernelPackages = pkgs.linuxPackages; - }; - - testScript = - '' - assert "Linux" in machine.succeed("uname -s") - assert "${pkgs.linuxPackages.kernel.version}" in machine.succeed("uname -a") - ''; -}) diff --git a/nixos/tests/kernel-testing.nix b/nixos/tests/kernel-testing.nix deleted file mode 100644 index 017007c0aec85..0000000000000 --- a/nixos/tests/kernel-testing.nix +++ /dev/null @@ -1,17 +0,0 @@ -import ./make-test-python.nix ({ pkgs, ...} : { - name = "kernel-testing"; - meta = with pkgs.lib.maintainers; { - maintainers = [ nequissimus ]; - }; - - machine = { pkgs, ... }: - { - boot.kernelPackages = pkgs.linuxPackages_testing; - }; - - testScript = - '' - assert "Linux" in machine.succeed("uname -s") - assert "${pkgs.linuxPackages_testing.kernel.modDirVersion}" in machine.succeed("uname -a") - ''; -}) |