···102102103103 in result;
104104105105- configFile = pkgs.writeTextFile {
105105+ configFile = if cfg.settingsFile != null then
106106+ assert cfg.settings == {} && cfg.keyFiles == [];
107107+ cfg.settingsFile
108108+ else pkgs.writeTextFile {
106109 name = "knot.conf";
107110 text = (concatMapStringsSep "\n" (file: "include: ${file}") cfg.keyFiles) + "\n" + yamlConfig;
108111 # TODO: maybe we could do some checks even when private keys complicate this?
···162165 default = {};
163166 description = lib.mdDoc ''
164167 Extra configuration as nix values.
168168+ '';
169169+ };
170170+171171+ settingsFile = mkOption {
172172+ type = types.nullOr types.path;
173173+ default = null;
174174+ description = lib.mdDoc ''
175175+ As alternative to ``settings``, you can provide whole configuration
176176+ directly in the almost-YAML format of Knot DNS.
177177+ You might want to utilize ``writeTextFile`` for this.
165178 '';
166179 };
167180