summaryrefslogtreecommitdiffstats
path: root/lass/3modules/hass.nix
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2020-06-02 23:35:17 +0200
committertv <tv@krebsco.de>2020-06-02 23:35:17 +0200
commit09c9f8f7fb04be39390b6f65966789c1bf6333e5 (patch)
treeb0cb0f718b40517b0645a38169e67b1088566f64 /lass/3modules/hass.nix
parent09e620c79b70e495e9651e8e5c1b160dd1b5fb8d (diff)
parent211e2ca6b9a1d8b4dd92071065b0b595123fe282 (diff)
Merge remote-tracking branch 'prism/master'
Diffstat (limited to 'lass/3modules/hass.nix')
-rw-r--r--lass/3modules/hass.nix34
1 files changed, 34 insertions, 0 deletions
diff --git a/lass/3modules/hass.nix b/lass/3modules/hass.nix
new file mode 100644
index 000000000..30158e78a
--- /dev/null
+++ b/lass/3modules/hass.nix
@@ -0,0 +1,34 @@
+{ config, lib, pkgs, ... }:
+with import <stockholm/lib>;
+let
+
+ cfg = config.lass.hass;
+
+in {
+ options.lass.hass = {
+ config = mkOption {
+ default = {};
+ type = with lib.types; let
+ valueType = nullOr (oneOf [
+ bool
+ int
+ float
+ str
+ (attrsOf valueType)
+ (listOf valueType)
+ ]) // {
+ description = "Yaml value";
+ emptyValue.value = {};
+ };
+ in valueType;
+ };
+ };
+
+ config =
+ assert versionOlder version "20.09";
+ mkIf (cfg.config != {})
+ {
+ services.home-assistant.config = cfg.config;
+ };
+}
+