Skip to content

Commit

Permalink
nixos/dnsmasq: remove deprecated option "extraConfig"
Browse files Browse the repository at this point in the history
  • Loading branch information
rhoriguchi authored and bjornfor committed Sep 20, 2024
1 parent 3ceb2f3 commit c26ca03
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 24 deletions.
2 changes: 2 additions & 0 deletions nixos/doc/manual/release-notes/rl-2411.section.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
22 changes: 2 additions & 20 deletions nixos/modules/services/networking/dnsmasq.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,15 @@ 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

{

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
Expand Down Expand Up @@ -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.
'';
};

};

};
Expand All @@ -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");
Expand Down
8 changes: 4 additions & 4 deletions nixos/modules/services/networking/nixops-dns.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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";
};
};

};
Expand Down

0 comments on commit c26ca03

Please sign in to comment.