Unverified Commit ce85980e authored by Vladimír Čunát's avatar Vladimír Čunát
Browse files

nixos/knot: also allow config by YAML file

parent 7fb737dd
Loading
Loading
Loading
Loading
+14 −1
Original line number Diff line number Diff line
@@ -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;