From 64560de406ec701e26f286163a8d775ed2d0f8b6 Mon Sep 17 00:00:00 2001 From: Luflosi Date: Fri, 21 Jan 2022 18:45:31 +0100 Subject: [PATCH] nixos/networkd: fix networking.networkd.static test Commit ca58bd0a50f38de43b401df716806c0f83479a8e broke the test networking.networkd.static. This happened because the test sets `networking.defaultGateway`. This is implemented by adding the gateway to the list of `routes` using `mkDefault`. The `routes` are then overridden by an empty list in the newly added code. Replace `mkDefault` with `id` so the two lists are merged and everything (hopefully) works as expected. See https://github.com/NixOS/nixpkgs/pull/144590 for a more context. --- nixos/modules/tasks/network-interfaces-systemd.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/modules/tasks/network-interfaces-systemd.nix b/nixos/modules/tasks/network-interfaces-systemd.nix index 645ff161cddd..8a5e1b5af114 100644 --- a/nixos/modules/tasks/network-interfaces-systemd.nix +++ b/nixos/modules/tasks/network-interfaces-systemd.nix @@ -92,7 +92,7 @@ in }; }; }); - networks."40-${i.name}" = mkMerge [ (genericNetwork mkDefault) { + networks."40-${i.name}" = mkMerge [ (genericNetwork id) { name = mkDefault i.name; DHCP = mkForce (dhcpStr (if i.useDHCP != null then i.useDHCP else false));