dev.fron.io nixrc / cd2b0c5
profiles(traefik): link config files for convenience Tony Olagbaiye 28 days ago
1 changed file(s) with 13 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
88 # router.tls.domains)
99 # config.services.traefik.dynamicConfigOptions.http.routers
1010 #);
11
12 environment.etc = let
13 staticConfigFile = lib.removePrefix "--configfile=" (
14 lib.findSingle (lib.hasPrefix "--configfile=") null null
15 (lib.splitString " " config.systemd.services.traefik.serviceConfig.ExecStart)
16 );
17 dynamicConfigFile = (
18 builtins.fromTOML (builtins.readFile staticConfigFile)
19 ).providers.file.filename;
20 in lib.mkIf config.services.traefik.enable {
21 "traefik/traefik.toml".source = staticConfigFile;
22 "traefik/rules.toml".source = dynamicConfigFile;
23 };
1124
1225 services.traefik = {
1326 enable = true;