diff --git a/nixos/modules/config/resolvconf.nix b/nixos/modules/config/resolvconf.nix index 4499481811fd..3e14884bb2bf 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 openresolv + if this module is enabled. Otherwise, can be used by other modules (for example ) 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; }; }; diff --git a/nixos/modules/system/boot/resolved.nix b/nixos/modules/system/boot/resolved.nix index 21d3fab2f35d..3a38201ff60d 100644 --- a/nixos/modules/system/boot/resolved.nix +++ b/nixos/modules/system/boot/resolved.nix @@ -1,4 +1,4 @@ -{ config, lib, ... }: +{ config, lib, pkgs, ... }: with lib; let @@ -178,6 +178,8 @@ in # If networkmanager is enabled, ask it to interface with resolved. networking.networkmanager.dns = "systemd-resolved"; + networking.resolvconf.package = pkgs.systemd; + }; }