lol

nixos/knot: also allow config by YAML file

+14 -1
+14 -1
nixos/modules/services/networking/knot.nix
··· 102 102 103 103 in result; 104 104 105 - configFile = pkgs.writeTextFile { 105 + configFile = if cfg.settingsFile != null then 106 + assert cfg.settings == {} && cfg.keyFiles == []; 107 + cfg.settingsFile 108 + else pkgs.writeTextFile { 106 109 name = "knot.conf"; 107 110 text = (concatMapStringsSep "\n" (file: "include: ${file}") cfg.keyFiles) + "\n" + yamlConfig; 108 111 # TODO: maybe we could do some checks even when private keys complicate this? ··· 162 165 default = {}; 163 166 description = lib.mdDoc '' 164 167 Extra configuration as nix values. 168 + ''; 169 + }; 170 + 171 + settingsFile = mkOption { 172 + type = types.nullOr types.path; 173 + default = null; 174 + description = lib.mdDoc '' 175 + As alternative to ``settings``, you can provide whole configuration 176 + directly in the almost-YAML format of Knot DNS. 177 + You might want to utilize ``writeTextFile`` for this. 165 178 ''; 166 179 }; 167 180