nixpkgs/nixos/modules/tasks
Majiir Paktu c4228b6c8f nixos/network-interfaces-systemd: fix DHCP setting
The networkd backend logic for setting DHCP= on an interface is bugged
and inconsistent with the scripted logic. Consider this simple NixOS
configuration:

    {
      networking.useNetworkd = true;
      networking.interfaces.eth0.wakeOnLan.enable = true;
    }

The default value of networking.useDHCP is true, so we expect our eth0
interface to have DHCP enabled. With the scripted backend, this works.
But the networkd backend generates the following 40-eth0.network file:

    [Match]
    Name=eth0

    [Network]
    DHCP=no
    IPv6PrivacyExtensions=kernel

This is happening because the wakeOnLan configuration creates a key in
networking.interfaces, and the networkd backend erroneously checks that
instead of for explicitly configured IP addresses as in the scripted
backend. The documentation is also inconsistent across various options.

This change aligns the networkd backend and option documentation to the
actual behavior of the scripted backend, and updates a test to account
for this behavior for both backends.
2023-10-14 13:57:32 -04:00
..
filesystems nixos/zfs: disable redundant scheduler 2023-09-13 21:36:36 +02:00
auto-upgrade.nix nixos/*: automatically convert option docs 2022-08-19 22:40:58 +02:00
bcache.nix nixos/bcache: add a boot.bcache.enable kill switch 2023-09-10 14:26:53 +01:00
cpu-freq.nix treewide: automatically md-convert option descriptions 2022-07-30 15:16:34 +02:00
encrypted-devices.nix nixos/tasks: invariant option docs MD conversions 2022-07-24 13:01:47 +02:00
filesystems.nix nixos/stage-1-systemd: makeFstabEntries: drop rootPrefix parameter 2023-09-27 18:31:56 -04:00
lvm.nix Merge pull request #240600 from lilyinstarlight/fix/luksroot-lvm-default-off 2023-07-05 12:42:45 -04:00
network-interfaces-scripted.nix network.interfaces: Add option to configure WakeOnLan policy 2023-09-28 20:14:02 +02:00
network-interfaces-systemd.nix nixos/network-interfaces-systemd: fix DHCP setting 2023-10-14 13:57:32 -04:00
network-interfaces.nix nixos/network-interfaces-systemd: fix DHCP setting 2023-10-14 13:57:32 -04:00
powertop.nix nixos/*: automatically convert option descriptions 2022-08-31 16:32:53 +02:00
scsi-link-power-management.nix nixos/*: automatically convert option docs to MD 2022-08-03 22:46:41 +02:00
snapraid.nix nixos/*: automatically convert option descriptions 2022-08-31 16:32:53 +02:00
stratis.nix nixos/stratis: init 2022-09-12 15:19:36 +08:00
swraid.nix nixos/swraid: only warn if swraid was explicitly enabled (#255426) 2023-09-16 12:19:19 +02:00
trackpoint.nix treewide: automatically md-convert option descriptions 2022-07-30 15:16:34 +02:00
tty-backgrounds-combine.sh