diff options
author | Vladimír Čunát <v@cunat.cz> | 2023-08-13 11:43:02 +0200 |
---|---|---|
committer | Vladimír Čunát <v@cunat.cz> | 2023-09-23 10:04:02 +0200 |
commit | ce85980e77ab1abbd91f127bea24534c703e05bb (patch) | |
tree | 3f1ca08b39ca8b1226f306df6fd0badd0366bde8 /nixos | |
parent | 7fb737dde6a77cc78f083915e44e8a6a5a0c65c6 (diff) | |
download | nixlib-ce85980e77ab1abbd91f127bea24534c703e05bb.tar nixlib-ce85980e77ab1abbd91f127bea24534c703e05bb.tar.gz nixlib-ce85980e77ab1abbd91f127bea24534c703e05bb.tar.bz2 nixlib-ce85980e77ab1abbd91f127bea24534c703e05bb.tar.lz nixlib-ce85980e77ab1abbd91f127bea24534c703e05bb.tar.xz nixlib-ce85980e77ab1abbd91f127bea24534c703e05bb.tar.zst nixlib-ce85980e77ab1abbd91f127bea24534c703e05bb.zip |
nixos/knot: also allow config by YAML file
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/modules/services/networking/knot.nix | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/nixos/modules/services/networking/knot.nix b/nixos/modules/services/networking/knot.nix index f8aa6f562c9a..58ebcb81898b 100644 --- a/nixos/modules/services/networking/knot.nix +++ b/nixos/modules/services/networking/knot.nix @@ -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; |