@@ -8,21 +8,9 @@ let
88 group = config.users.groups.trafficserver.name;
99
1010 getManualUrl = name: "https://docs.trafficserver.apache.org/en/latest/admin-guide/files/${name}.en.html";
11− getConfPath = name: "${pkgs.trafficserver}/etc/trafficserver/${name}";
1211
1312 yaml = pkgs.formats.yaml { };
1413
15− fromYAML = f:
16− let
17− jsonFile = pkgs.runCommand "in.json"
18− {
19− nativeBuildInputs = [ pkgs.remarshal ];
20− } ''
21− yaml2json < "${f}" > "$out"
22− '';
23− in
24− builtins.fromJSON (builtins.readFile jsonFile);
25−
2614 mkYamlConf = name: cfg:
2715 if cfg != null then {
2816 "trafficserver/${name}.yaml".source = yaml.generate "${name}.yaml" cfg;
@@ -73,7 +61,7 @@ in
7361
7462 ipAllow = mkOption {
7563 type = types.nullOr yaml.type;
76− default = fromYAML (getConfPath "ip_allow.yaml");
64+ default = builtins.fromJSON (builtins.readFile ./ip_allow.json);
7765 defaultText = "upstream defaults";
7866 example = literalExample {
7967 ip_allow = [{
@@ -94,7 +82,7 @@ in
9482
9583 logging = mkOption {
9684 type = types.nullOr yaml.type;
97− default = fromYAML (getConfPath "logging.yaml");
85+ default = builtins.fromJSON (builtins.readFile ./logging.json);
9886 defaultText = "upstream defaults";
9987 example = literalExample { };
10088 description = ''