nixos/home-assistant: make config deep mergeable

This make it possible to split the home-assistant configuration
across multiple files and nix will merge the option in an intuitive
way.
This commit is contained in:
Jörg Thalheim
2020-02-28 15:32:03 +00:00
parent 112cc9c052
commit ee2ea82a68
+14 -1
View File
@@ -96,7 +96,20 @@ in {
config = mkOption {
default = null;
type = with types; nullOr attrs;
# Migrate to new option types later: https://github.com/NixOS/nixpkgs/pull/75584
type = with lib.types; let
valueType = nullOr (oneOf [
bool
int
float
str
(lazyAttrsOf valueType)
(listOf valueType)
]) // {
description = "Yaml value";
emptyValue.value = {};
};
in valueType;
example = literalExample ''
{
homeassistant = {