about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRobert Schütz <dev@schuetz-co.de>2021-04-08 18:19:34 +0200
committerGitHub <noreply@github.com>2021-04-08 18:19:34 +0200
commit5522a67fa5b0b761a87a9ca22f5c78da2e7cd652 (patch)
tree70e2b6ad6d588696e956f4b434aa05bb264fb27a
parent71433ce8231042719354c350aa833ba6209d5ca5 (diff)
parent5e0defcb25364b47c96b8eabf2b01e75d641dedb (diff)
downloadnixlib-5522a67fa5b0b761a87a9ca22f5c78da2e7cd652.tar
nixlib-5522a67fa5b0b761a87a9ca22f5c78da2e7cd652.tar.gz
nixlib-5522a67fa5b0b761a87a9ca22f5c78da2e7cd652.tar.bz2
nixlib-5522a67fa5b0b761a87a9ca22f5c78da2e7cd652.tar.lz
nixlib-5522a67fa5b0b761a87a9ca22f5c78da2e7cd652.tar.xz
nixlib-5522a67fa5b0b761a87a9ca22f5c78da2e7cd652.tar.zst
nixlib-5522a67fa5b0b761a87a9ca22f5c78da2e7cd652.zip
Merge pull request #118719 from dotlambda/home-assistant-tests
nixos/home-assistant: use override before overridePythonAttrs
-rw-r--r--nixos/modules/services/misc/home-assistant.nix19
1 files changed, 11 insertions, 8 deletions
diff --git a/nixos/modules/services/misc/home-assistant.nix b/nixos/modules/services/misc/home-assistant.nix
index f6398c083979..2787c975b352 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>.
       '';
     };