Commit Graph

855 Commits

Author SHA1 Message Date
Weijia Wang
74d102ce50 Merge branch 'master' into staging-next 2023-11-12 19:45:20 +01:00
Gaurav Juvekar
5ab4ce5d33 nixos/network-interfaces: fix typo in networking.fqdn 2023-11-12 08:47:01 -08:00
github-actions[bot]
931938d1df
Merge master into staging-next 2023-10-30 18:01:02 +00:00
Will Fancher
cca22054c0 systemd-stage-1: Add assertions for unsupported options. 2023-10-30 12:15:58 +01:00
Vladimír Čunát
5c89ba8ab4
Merge branch 'master' into staging-next 2023-10-30 06:12:04 +01:00
Ryan Lahfa
a905c3a544
Merge pull request #262854 from ElvishJerricco/systemd-stage-1-bcachefs-decryption
systemd-stage-1: bcachefs decryption
2023-10-29 22:24:38 +01:00
github-actions[bot]
64070c2fda
Merge master into staging-next 2023-10-29 18:01:23 +00:00
Rémy Grünblatt
c9e3cc43c7
nixos: fix iproute2 invocations (#263976)
When using iproute2's ip binary, you can omit the dev parameter, e.g. ip link set up eth0 instead of ip link set up dev eth0.

This breaks if for some reason your device is named e.g. he, hel, … because it is interpreted as ip link set up help.

I just encountered this bug using networking.bridges trying to create an interface named he.

I used a grep on nixpkgs to try to find iproute2 invocations using variables without the dev keyword, and found a few, and fixed them by providing the dev keyword.

I merely fixed what I found, but the use of abbreviated commands makes it a bit hard to be sure everything has been found (e.g. ip l set … up instead of ip link set … up).
2023-10-29 18:27:16 +01:00
github-actions[bot]
571f1df5e4
Merge master into staging-next 2023-10-29 12:00:57 +00:00
Joseph Stahl
137a3c1303
systemd domainname service - fix missing domainname binary
needs nettools in path
2023-10-28 22:30:14 -04:00
github-actions[bot]
954eb09381
Merge master into staging-next 2023-10-29 00:02:24 +00:00
Ryan Lahfa
de47b2e8a5
Merge pull request #263033 from ElvishJerricco/systemd-stage-1-filesystems-encrypted
systemd-stage-1: Enable more encrypted installer tests
2023-10-28 20:38:14 +02:00
github-actions[bot]
519b7ea0c3
Merge master into staging-next 2023-10-28 12:01:19 +00:00
Linus Heckemann
8670794565
Merge pull request #263203 from nikstur/replace-activation
Replace simple activationScripts
2023-10-28 10:17:15 +02:00
github-actions[bot]
96132a216a
Merge master into staging-next 2023-10-26 18:01:02 +00:00
Cole Mickens
8c7908acc8
nixos/fs/vfat: fix inclusion in systemd stage1 2023-10-26 18:44:02 +02:00
nikstur
d300940637 nixos/network-interfaces: replace hostname and domain activationScript
The hostname is already set by systemd
https://www.freedesktop.org/software/systemd/man/latest/hostname.html#Hostname%20semantics

Create a separate service that registers the domainname.
2023-10-26 01:51:08 +02:00
Will Fancher
99a47a5e35 systemd-stage-1: Enable more encrypted installer tests 2023-10-23 17:40:34 -04:00
Will Fancher
0425c4de6d systemd-stage-1: bcachefs decryption 2023-10-22 20:07:55 -04:00
github-actions[bot]
f4afba2014
Merge staging-next into staging 2023-10-21 18:01:53 +00:00
Ryan Lahfa
e6ade691a5
Merge pull request #259347 from ElvishJerricco/systemd-stage-1-zfs-sysusr-dependency
systemd 254: ZFS /usr fix with systemd-stage-1
2023-10-21 18:04:13 +01:00
github-actions[bot]
682b6995b4
Merge staging-next into staging 2023-10-21 12:01:45 +00:00
nikstur
6958acea7e
Merge pull request #262179 from ElvishJerricco/systemd-stage-1-specific-fs-packages
systemd-stage-1: Use specific fs packages
2023-10-21 13:25:42 +02:00
github-actions[bot]
34db746ff9
Merge staging-next into staging 2023-10-20 06:35:22 +00:00
Will Fancher
18013cc71e systemd-stage-1: Use specific fs packages 2023-10-19 21:13:22 -04:00
Martin Weinelt
d042a29613
Merge pull request #253764 from linj-fork/fix-ping-wrapper
nixos/network-interfaces: stop wrapping ping with cap_net_raw
2023-10-20 00:57:55 +02:00
github-actions[bot]
ae77d35744
Merge staging-next into staging 2023-10-16 00:03:09 +00:00
Maximilian Bosch
083a10949a
Merge pull request #258695 from Majiir/fix-networkd-defaultgateway
nixos/network-interfaces-systemd: support and require defaultGateway.interface
2023-10-15 16:42:01 +02:00
github-actions[bot]
62370ea07d
Merge staging-next into staging 2023-10-15 00:03:07 +00:00
Maximilian Bosch
632cfff257
Merge pull request #259619 from Majiir/fix-networkd-dhcp
nixos/network-interfaces-systemd: fix DHCP setting
2023-10-14 20:47:36 +02:00
github-actions[bot]
879976f685
Merge staging-next into staging 2023-10-14 18:01:33 +00:00
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
Maximilian Bosch
6998695f5d
Merge pull request #259658 from Majiir/fix-networkd-wakeonlan
nixos/network-interfaces-systemd: fix WakeOnLan
2023-10-14 14:48:22 +02:00
github-actions[bot]
5b761c2ba3
Merge staging-next into staging 2023-10-14 12:01:32 +00:00
Maximilian Bosch
d664571660
Merge pull request #256598 from adamcstephens/net/warn-multiple-net
nixos/networking: warn when both networkd and dhcpcd can collide
2023-10-14 12:24:24 +02:00
Majiir Paktu
f5f1751b1f refactor: combine scripted and networkd WakeOnLan config 2023-10-07 21:02:46 -04:00
Majiir Paktu
d290c309f4 nixos/network-interfaces-systemd: fix WakeOnLan
WakeOnLan= was configured when using the scripted backend but not the
networkd backend. The other link options are set in the .network file
when using networkd, but WakeOnLan= is only available in a .link file.
2023-10-07 20:58:51 -04:00
Majiir Paktu
c3e90f5667 nixos/network-interfaces-systemd: require defaultGateway.interface
The logic for configuring a gateway without an interface specified adds
a route with Gateway= to *every interface* configured by NixOS for
networkd. This leads to nonsensical configurations like the following:

    [Network]
    DHCP=no
    Address=192.168.0.1/24

    [Route]
    Gateway=10.0.0.1
    GatewayOnLink=false

We remove this logic and make defaultGateway.interface required to
configure a default gateway when using networkd.

We can ignore the removal of GatewayOnLink because systemd defaults it
to "no" anyway.
2023-10-07 16:09:11 -04:00
Majiir Paktu
c11b788d1a nixos/network-interfaces-systemd: support defaultGateway.interface
When interface and address are both specified, we can set Gateway= on
the named interface. The existing logic assumes interface is not set
(since it's guarded by assertion) so we now disable it when interface
has a value.

As a bonus, we now support the defaultGateway.metric option when
interface is set.
2023-10-07 16:09:11 -04:00
Alyssa Ross
182718fecc
Merge remote-tracking branch 'origin/staging-next' into staging
Conflicts:
	pkgs/top-level/linux-kernels.nix
2023-10-07 19:52:18 +00:00
Linus Heckemann
2de1be5b51
Merge pull request #258677 from Majiir/fix-networkd-search-domains
nixos/network-interfaces-systemd: don't set network-level domains
2023-10-07 08:43:49 +02:00
Will Fancher
524714f7ea systemd 254: ZFS /usr fix with systemd-stage-1 2023-10-06 04:25:25 -04:00
github-actions[bot]
2dc3af6ef9
Merge staging-next into staging 2023-10-04 12:01:34 +00:00
Florian Klink
42f2e2dadd
Merge pull request #257510 from ign0tus/fix/wake-on-lan-policy
Fix: WakeOnLan policy
2023-10-04 11:36:16 +03:00
Daniel Hill
d6bf8b47ec bcachefs: 2023-06-28 -> 2023-09-29
Includes prep work for mainline bcachefs release.
2023-10-03 22:00:26 +01:00
Jade Lovelace
28ab2b278d nixos/networkd: make wait-online not time out
A further bug to our strange multi-user.target depending on
network-online.target issue is that systemd recently changed the
behaviour of systemd-networkd-wait-online to no longer consider the
absence of interfaces with RequiredForOnline to be sufficient to be
online: https://github.com/systemd/systemd/pull/27825

On the advice of the systemd developers
(https://github.com/systemd/systemd/issues/29388), this commit changes
the configuration of systemd-networkd-wait-online to pass --any by
default, and lets the default DHCP interfaces be RequiredForOnline
as they would be by default if the option is omitted.

It is plausible that systemd-networkd-wait-online may still fail if
there are no interfaces at all. However, that probably cannot be
avoided.
2023-10-02 14:47:21 -07:00
Majiir Paktu
0ba49949b0 nixos/network-interfaces-systemd: don't set network-level domains
systemd.network(5) describes Domains= as a "list of domains which should
be resolved using the DNS servers on this link." This setting is read by
systemd-resolved.service, and it's used to configure both search domains
and DNS query routing.

Adding the search domains from `networking.search` is unnecessary
because these are already configured globally in `resolved.conf` through
the default value of `services.resolved.domains`.

Adding the system's `networking.domain` to each network is unexpected
and probably incorrect. A user may not expect that the domain is in
effect automatically added to the search domains even if not specified
in `networking.search`.

Both of these network-level assignments are problematic in cases where
the NixOS networkd module is not managing every interface on the system.
In that scenario, the managed interfaces will have Domains= set while
the others do not. That will cause systemd-resolved to route DNS queries
for the search domains and the system domain to only those managed
interfaces.
2023-10-02 17:36:08 -04:00
ign0tus
27d0a8a0cd network.interfaces: Add option to configure WakeOnLan policy
Adds an option to configure a custom WakeOnLan policy instead of the
hard-coded "magic" policy. To ensure compatibility with current
behavior, "magic" is kept as default.
2023-09-28 20:14:02 +02:00
Nick Cao
37cac5f032
nixos/stage-1-systemd: makeFstabEntries: drop rootPrefix parameter 2023-09-27 18:31:56 -04:00
Nick Cao
0fecd7edc8
nixos/stage-1-systemd: fix initrd-fstab generation for bind mounts, again
See https://github.com/NixOS/nixpkgs/pull/185089
2023-09-27 14:34:17 -04:00