nixos/resolvconf: Enable by default (#512584)

This commit is contained in:
Ramses
2026-04-27 21:16:17 +00:00
committed by GitHub
4 changed files with 21 additions and 2 deletions
@@ -384,6 +384,8 @@ See <https://github.com/NixOS/nixpkgs/issues/481673>.
- `systemd.network.*` has been updated to support all configuration options from upstream `networkd` version 259.
- `networking.resolvconf.enable` now defaults to `true` unconditionally instead of `!(config.environment.etc ? "resolv.conf")`.If you set `environment.etc."resolv.conf"` yourself, then you should also set `networking.resolvconf.enable = false`.
- `services.openssh` now supports generating host SSH keys by setting `services.openssh.generateHostKeys = true` while leaving `services.openssh.enable` disabled. This is particularly useful for systems that have no need of an SSH daemon but want SSH host keys for other purposes such as using agenix or sops-nix.
- `services.openssh.enableRecommendedAlgorithms` has been added to allow users to opt out of NixOS's curated set of recommended algorithms. This set to true by default, and thus is not a breaking change. Users may want to set this to false if they prefer upstream's default algorithms. See <https://github.com/NixOS/nixpkgs/pull/471330>.
+12 -2
View File
@@ -69,8 +69,7 @@ in
enable = lib.mkOption {
type = lib.types.bool;
default = !(config.environment.etc ? "resolv.conf");
defaultText = lib.literalExpression ''!(config.environment.etc ? "resolv.conf")'';
default = true;
description = ''
Whether DNS configuration is managed by resolvconf.
'';
@@ -170,6 +169,17 @@ in
}
(lib.mkIf cfg.enable {
assertions = [
{
assertion = !(config.environment.etc ? "resolv.conf");
message = ''
networking.resolvconf.enable is true but environment.etc."resolv.conf"
is also set. Set networking.resolvconf.enable = false if another
service manages /etc/resolv.conf.
'';
}
];
users.groups.resolvconf = { };
networking.resolvconf.subscriberFiles = [ "/etc/resolv.conf" ];
@@ -14,6 +14,9 @@
etc."resolv.conf".source = "/etc/tetrd/resolv.conf";
};
# Our resolv.conf will override resolvconf's version.
networking.resolvconf.enable = false;
systemd = {
tmpfiles.rules = [ "f /etc/tetrd/resolv.conf - - -" ];
+4
View File
@@ -219,6 +219,10 @@ in
# If networkmanager is enabled, ask it to interface with resolved.
networking.networkmanager.dns = "systemd-resolved";
# Since we explicitly provide a resolv.conf, disable resolvconf
networking.resolvconf.enable = false;
# ... but we still set the package for correct compatibility.
networking.resolvconf.package = config.systemd.package;
nix.firewall.extraNftablesRules = [