diff options
author | Ioannis Koutras <ioannis.koutras@gmail.com> | 2020-02-08 12:38:38 +0100 |
---|---|---|
committer | Ioannis Koutras <ioannis.koutras@gmail.com> | 2020-04-12 22:50:36 +0200 |
commit | 1f61fbf3260dc01afd4d44d309aef682d3558fb3 (patch) | |
tree | b392c90b8e4a5e0521743970fda626ed8834f85a /nixos/modules/services | |
parent | bc766b003a3e98159c8f0c46a1689bb70e4a40c2 (diff) | |
download | nixlib-1f61fbf3260dc01afd4d44d309aef682d3558fb3.tar nixlib-1f61fbf3260dc01afd4d44d309aef682d3558fb3.tar.gz nixlib-1f61fbf3260dc01afd4d44d309aef682d3558fb3.tar.bz2 nixlib-1f61fbf3260dc01afd4d44d309aef682d3558fb3.tar.lz nixlib-1f61fbf3260dc01afd4d44d309aef682d3558fb3.tar.xz nixlib-1f61fbf3260dc01afd4d44d309aef682d3558fb3.tar.zst nixlib-1f61fbf3260dc01afd4d44d309aef682d3558fb3.zip |
nixos/traefik: make config deep mergeable
Diffstat (limited to 'nixos/modules/services')
-rw-r--r-- | nixos/modules/services/web-servers/traefik.nix | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/nixos/modules/services/web-servers/traefik.nix b/nixos/modules/services/web-servers/traefik.nix index 436136f4736a..4ab7307c3b67 100644 --- a/nixos/modules/services/web-servers/traefik.nix +++ b/nixos/modules/services/web-servers/traefik.nix @@ -4,6 +4,20 @@ with lib; let cfg = config.services.traefik; + jsonValue = with types; + let + valueType = nullOr (oneOf [ + bool + int + float + str + (lazyAttrsOf valueType) + (listOf valueType) + ]) // { + description = "JSON value"; + emptyValue.value = { }; + }; + in valueType; dynamicConfigFile = if cfg.dynamicConfigFile == null then pkgs.runCommand "config.toml" { buildInputs = [ pkgs.remarshal ]; @@ -52,7 +66,7 @@ in { description = '' Static configuration for Traefik. ''; - type = types.attrs; + type = jsonValue; default = { entryPoints.http.address = ":80"; }; example = { entryPoints.web.address = ":8080"; @@ -76,7 +90,7 @@ in { description = '' Dynamic configuration for Traefik. ''; - type = types.attrs; + type = jsonValue; default = { }; example = { http.routers.router1 = { |