diff --git a/nixos/doc/manual/release-notes/rl-2411.section.md b/nixos/doc/manual/release-notes/rl-2411.section.md index ab951ddb3c25b..7976af21a5da1 100644 --- a/nixos/doc/manual/release-notes/rl-2411.section.md +++ b/nixos/doc/manual/release-notes/rl-2411.section.md @@ -438,6 +438,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. diff --git a/nixos/modules/services/networking/dnsmasq.nix b/nixos/modules/services/networking/dnsmasq.nix index 20986f8d93ef7..633e37ad25e93 100644 --- a/nixos/modules/services/networking/dnsmasq.nix +++ b/nixos/modules/services/networking/dnsmasq.nix @@ -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"); diff --git a/nixos/modules/services/networking/nixops-dns.nix b/nixos/modules/services/networking/nixops-dns.nix index 5e33d872ea452..5d009d6d30845 100644 --- a/nixos/modules/services/networking/nixops-dns.nix +++ b/nixos/modules/services/networking/nixops-dns.nix @@ -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"; + }; }; };