stockholm/lass/3modules/hass.nix

52 lines
1.1 KiB
Nix
Raw Normal View History

2020-04-21 12:38:00 +00:00
{ 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;
};
2020-09-27 13:58:38 +00:00
love = 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;
};
2020-04-21 12:38:00 +00:00
};
config =
assert versionOlder version "20.09";
mkIf (cfg.config != {})
{
services.home-assistant.config = cfg.config;
2020-09-27 13:58:38 +00:00
# services.home-assistant.lovelaceConfig = cfg.love;
2020-04-21 12:38:00 +00:00
};
}