Commit c26ca03c authored by Ryan Horiguchi's avatar Ryan Horiguchi Committed by Bjørn Forsman
Browse files

nixos/dnsmasq: remove deprecated option "extraConfig"

parent 3ceb2f3b
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -463,6 +463,8 @@

- The `openlens` package got removed, suggested replacment `lens-desktop`

- The `services.dnsmasq.extraConfig` option has been removed, as it had been deprecated for over 2 years. This option has been replaced by `services.dnsmasq.settings`.

- The NixOS installation media no longer support the ReiserFS or JFS file systems by default.

- Minimal installer ISOs are no longer built on the small channel.
+2 −20
Original line number Diff line number Diff line
@@ -20,13 +20,7 @@ let
    listsAsDuplicateKeys = true;
  };

  # Because formats.generate is outputting a file, we use of conf-file. Once
  # `extraConfig` is deprecated we can just use
  # `dnsmasqConf = format.generate "dnsmasq.conf" cfg.settings`
  dnsmasqConf = pkgs.writeText "dnsmasq.conf" ''
    conf-file=${settingsFormat.generate "dnsmasq.conf" cfg.settings}
    ${cfg.extraConfig}
  '';
  dnsmasqConf = settingsFormat.generate "dnsmasq.conf" cfg.settings;

in

@@ -34,6 +28,7 @@ in

  imports = [
    (lib.mkRenamedOptionModule [ "services" "dnsmasq" "servers" ] [ "services" "dnsmasq" "settings" "server" ])
    (lib.mkRemovedOptionModule [ "services" "dnsmasq" "extraConfig" ] "This option has been replaced by `services.dnsmasq.settings`")
  ];

  ###### interface
@@ -104,17 +99,6 @@ in
        '';
      };

      extraConfig = lib.mkOption {
        type = lib.types.lines;
        default = "";
        description = ''
          Extra configuration directives that should be added to
          `dnsmasq.conf`.

          This option is deprecated, please use {option}`settings` instead.
        '';
      };

    };

  };
@@ -124,8 +108,6 @@ in

  config = lib.mkIf cfg.enable {

    warnings = lib.optional (cfg.extraConfig != "") "Text based config is deprecated, dnsmasq now supports `services.dnsmasq.settings` for an attribute-set based config";

    services.dnsmasq.settings = {
      dhcp-leasefile = lib.mkDefault "${stateDir}/dnsmasq.leases";
      conf-file = lib.mkDefault (lib.optional cfg.resolveLocalQueries "/etc/dnsmasq-conf.conf");
+4 −4
Original line number Diff line number Diff line
@@ -68,10 +68,10 @@ in
      servers = [
        "/${cfg.domain}/127.0.0.1#5300"
      ];
      extraConfig = ''
        bind-interfaces
        listen-address=127.0.0.1
      '';
      settings = {
        bind-interfaces = true;
        listen-address = "127.0.0.1";
      };
    };

  };