nixos/traefik: make config deep mergeable
This commit is contained in:
parent
bc766b003a
commit
1f61fbf326
@ -4,6 +4,20 @@ with lib;
|
|||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.services.traefik;
|
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
|
dynamicConfigFile = if cfg.dynamicConfigFile == null then
|
||||||
pkgs.runCommand "config.toml" {
|
pkgs.runCommand "config.toml" {
|
||||||
buildInputs = [ pkgs.remarshal ];
|
buildInputs = [ pkgs.remarshal ];
|
||||||
@ -52,7 +66,7 @@ in {
|
|||||||
description = ''
|
description = ''
|
||||||
Static configuration for Traefik.
|
Static configuration for Traefik.
|
||||||
'';
|
'';
|
||||||
type = types.attrs;
|
type = jsonValue;
|
||||||
default = { entryPoints.http.address = ":80"; };
|
default = { entryPoints.http.address = ":80"; };
|
||||||
example = {
|
example = {
|
||||||
entryPoints.web.address = ":8080";
|
entryPoints.web.address = ":8080";
|
||||||
@ -76,7 +90,7 @@ in {
|
|||||||
description = ''
|
description = ''
|
||||||
Dynamic configuration for Traefik.
|
Dynamic configuration for Traefik.
|
||||||
'';
|
'';
|
||||||
type = types.attrs;
|
type = jsonValue;
|
||||||
default = { };
|
default = { };
|
||||||
example = {
|
example = {
|
||||||
http.routers.router1 = {
|
http.routers.router1 = {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user