diff options
Diffstat (limited to 'nixos/modules/config/resolvconf.nix')
-rw-r--r-- | nixos/modules/config/resolvconf.nix | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/nixos/modules/config/resolvconf.nix b/nixos/modules/config/resolvconf.nix index 4499481811f..3e14884bb2b 100644 --- a/nixos/modules/config/resolvconf.nix +++ b/nixos/modules/config/resolvconf.nix @@ -50,7 +50,20 @@ in default = !(config.environment.etc ? "resolv.conf"); defaultText = literalExpression ''!(config.environment.etc ? "resolv.conf")''; description = '' - DNS configuration is managed by resolvconf. + Whether DNS configuration is managed by resolvconf. + ''; + }; + + package = mkOption { + type = types.package; + default = pkgs.openresolv; + defaultText = literalExpression "pkgs.openresolv"; + description = '' + The package that provides the system-wide resolvconf command. Defaults to <literal>openresolv</literal> + if this module is enabled. Otherwise, can be used by other modules (for example <option>services.resolved</option>) to + provide a compatibility layer. + + This option generally shouldn't be set by the user. ''; }; @@ -119,10 +132,12 @@ in exit 1 '' else configText; + + environment.systemPackages = [ cfg.package ]; } (mkIf cfg.enable { - environment.systemPackages = [ pkgs.openresolv ]; + networking.resolvconf.package = pkgs.openresolv; systemd.services.resolvconf = { description = "resolvconf update"; @@ -134,7 +149,7 @@ in serviceConfig = { Type = "oneshot"; - ExecStart = "${pkgs.openresolv}/bin/resolvconf -u"; + ExecStart = "${cfg.package}/bin/resolvconf -u"; RemainAfterExit = true; }; }; |