forked from mirrors/nixpkgs
nixos/knot: also allow config by YAML file
This commit is contained in:
parent
7fb737dde6
commit
ce85980e77
|
@ -102,7 +102,10 @@ let
|
|||
|
||||
in result;
|
||||
|
||||
configFile = pkgs.writeTextFile {
|
||||
configFile = if cfg.settingsFile != null then
|
||||
assert cfg.settings == {} && cfg.keyFiles == [];
|
||||
cfg.settingsFile
|
||||
else pkgs.writeTextFile {
|
||||
name = "knot.conf";
|
||||
text = (concatMapStringsSep "\n" (file: "include: ${file}") cfg.keyFiles) + "\n" + yamlConfig;
|
||||
# TODO: maybe we could do some checks even when private keys complicate this?
|
||||
|
@ -165,6 +168,16 @@ in {
|
|||
'';
|
||||
};
|
||||
|
||||
settingsFile = mkOption {
|
||||
type = types.nullOr types.path;
|
||||
default = null;
|
||||
description = lib.mdDoc ''
|
||||
As alternative to ``settings``, you can provide whole configuration
|
||||
directly in the almost-YAML format of Knot DNS.
|
||||
You might want to utilize ``writeTextFile`` for this.
|
||||
'';
|
||||
};
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
default = pkgs.knot-dns;
|
||||
|
|
Loading…
Reference in a new issue