summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlassulus <lassulus@lassul.us>2020-04-21 14:38:00 +0200
committerlassulus <lassulus@lassul.us>2020-04-21 14:38:00 +0200
commitcabaf519b5970cbe5c1e57832d3bd12da4f47371 (patch)
tree7c1cdd07823686a10b76a91772c5b699ca23e68c
parenta50494cc5a192161151cce84716666d205873fd5 (diff)
l: add hass module
-rw-r--r--lass/3modules/default.nix1
-rw-r--r--lass/3modules/hass.nix34
2 files changed, 35 insertions, 0 deletions
diff --git a/lass/3modules/default.nix b/lass/3modules/default.nix
index 90dcb9d9c..057c7c74a 100644
--- a/lass/3modules/default.nix
+++ b/lass/3modules/default.nix
@@ -4,6 +4,7 @@ _:
./dnsmasq.nix
./ejabberd
./folderPerms.nix
+ ./hass.nix
./hosts.nix
./mysql-backup.nix
./news.nix
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;
+ };
+}
+