nixos/resolvconf: allow disabling
For systems without internet connections, it doesn't make sense to require the existence of an /etc/resolv.conf file to disable resolvconf, so let's expose networking.resolveconf.enable as a public option that can be set to false.
This commit is contained in:
parent
8f176cfe2c
commit
70d3697f8c
@ -47,8 +47,8 @@ in
|
|||||||
|
|
||||||
enable = mkOption {
|
enable = mkOption {
|
||||||
type = types.bool;
|
type = types.bool;
|
||||||
default = false;
|
default = !(config.environment.etc ? "resolv.conf");
|
||||||
internal = true;
|
defaultText = literalExpression ''!(config.environment.etc ? "resolv.conf")'';
|
||||||
description = ''
|
description = ''
|
||||||
DNS configuration is managed by resolvconf.
|
DNS configuration is managed by resolvconf.
|
||||||
'';
|
'';
|
||||||
@ -110,8 +110,6 @@ in
|
|||||||
|
|
||||||
config = mkMerge [
|
config = mkMerge [
|
||||||
{
|
{
|
||||||
networking.resolvconf.enable = !(config.environment.etc ? "resolv.conf");
|
|
||||||
|
|
||||||
environment.etc."resolvconf.conf".text =
|
environment.etc."resolvconf.conf".text =
|
||||||
if !cfg.enable then
|
if !cfg.enable then
|
||||||
# Force-stop any attempts to use resolvconf
|
# Force-stop any attempts to use resolvconf
|
||||||
|
Loading…
Reference in New Issue
Block a user