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-01-28 23:09:52 +00:00
parent 112cc9c052
commit ee2ea82a68
No known key found for this signature in database
GPG Key ID: 003F2096411B5F92

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 = {