1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-18 11:40:45 +00:00
Commit graph

914 commits

Author SHA1 Message Date
Philip Taron 9c505de9f4
nixos/filesystems: ensure correct ordering w.r.t. shutdown.target 2023-11-30 15:34:11 -08:00
Kyle Hendricks 463424129d snapraid: fix split parity files
SnapRAID has a feature where you can specify "split" parity files. This
is useful when you're using 16tb or bigger ext4-formatted disks for
parity. ext4 doesn't support files bigger than 16tb so this "split
parity file" can be used to specify two parity files on a single parity
disk and SnapRAID will automatically use the subsequent file when the current
cannot grow anymore (hits 16TB). You specify these split parity files by
separating them with commas in the "parity" config option. This
mostly already works except when it comes to the scheduled systemd sync
job where it specifies ReadWritePaths. If you specify a parity with
multiple files you'll get an error when the systemd job runs: Failed to
set up mount namespacing:
/run/systemd/unit-root/mnt/parity1/snapraid1.parity,/mnt/parity1/snapraid2.parity: No such file or directory
Essentially, when the parity file paths are passed into ReadWritePaths,
they're always treated as a single path.  This change makes sure to
split the paths if they contain a comma.

The big concern for this change is if it would break users who have
commas in their actual parity file paths.  This won't be an issue because SnapRAID
itself blindly splits on commas for parity files, so legitimate commas in a parity
file path wouldn't work in SnapRAID anyway. See here:
978d812153/cmdline/state.c (L692)

SnapRAID doc for split parity files: https://www.snapraid.it/manual#7.1
2023-11-29 20:10:29 -05:00
Ryan Lahfa 58fdc495ed
Merge pull request #269452 from RaitoBezarius/zfs-superstable 2023-11-24 17:41:43 +01:00
Raito Bezarius e04c0b0d99 zfs_2_1: init at 2.1.13
This re-introduces the old stable ZFS version we had in the past following
the many predicted issues of ZFS 2.2.x series, that is much more stable
than any further ZFS version at the moment.

I am also removing myself from maintenance of any further ZFS versions as I am
planning to quit ZFS maintenance at some point.

In the meantime, for users like me who depend on ZFS for critical operations, here is a ZFS version
that is known to work for LTS kernels.
2023-11-24 15:47:21 +01:00
Ryan Lahfa d783b6040d
Merge pull request #269381 from YellowOnion/bcachefs 2023-11-23 16:53:22 +01:00
Finn Behrens a51ea9ca17 nixos: fix bcachefs filesystem with symlinks 2023-11-23 08:14:27 +01:00
Daniel Hill 34a58ce86f bcachefs: fix lib.kernel.option miss use.
option is a function not a set.
2023-11-23 19:08:57 +13:00
Madoura 890cf0a79c
nixos/bcachefs: soft-deprecate 'linuxPackages_testing_bcachefs'
'bcachefs' is included in the linux kernel since 6.7-rc1
2023-11-18 09:58:51 -06:00
Madoura 0adbda28d3
nixos/bcachefs: remove 'with lib;' 2023-11-18 07:59:01 -06:00
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
Will Fancher 4bd4976b87
Merge pull request #251290 from Majiir/systemd-initrd-networking-features
nixos/network-interfaces-systemd: support `vlans`, `bridges` in systemd-initrd
2023-09-25 05:07:23 -04:00
Adam Stephens b4e162a109
nixos/networking: warn when both networkd and dhcpcd can collide 2023-09-21 20:05:25 -04:00
Lin Jian 759ec1113d
nixos/network-interfaces: stop wrapping ping with cap_net_raw
From systemd 243 release note[1]:

This release enables unprivileged programs (i.e. requiring neither
setuid nor file capabilities) to send ICMP Echo (i.e. ping) requests
by turning on the "net.ipv4.ping_group_range" sysctl of the Linux
kernel for the whole UNIX group range, i.e. all processes.

So this wrapper is not needed any more.

See also [2] and [3].

This patch also removes:
- apparmor profiles in NixOS for ping itself and the wrapped one
- other references for the wrapped ping

[1]: 8e2d9d40b3/NEWS (L6457-L6464)
[2]: https://github.com/systemd/systemd/pull/13141
[3]: https://fedoraproject.org/wiki/Changes/EnableSysctlPingGroupRange
2023-09-21 16:52:16 +08:00
Christian Theune 697312fb82
nixos/swraid: only warn if swraid was explicitly enabled (#255426)
The default just recently changed in 23.11. Users that had
swraid enabled implicitly by NixOS in previous releases got surprised
by warnings even though they do not actually use software RAID.

Fixes #254807
2023-09-16 12:19:19 +02:00
Artturin 696353fcf4 nixos/zfs: disable redundant scheduler
I (according to the comment) wrote this somewhere and since then it has
spread to many configs.

https://github.com/search?q=artturin+ENV%7BID_FS_TYPE%7D%3D%3D%22zfs_member%22%2C+ATTR%7B..%2Fqueue%2Fscheduler%7D%3D%22none%22&type=code

https://github.com/NixOS/nixpkgs/issues/169457#issuecomment-1523873402
2023-09-13 21:36:36 +02:00
K900 a604b522be
Merge pull request #254429 from ctheune/fix-swraid-for-old-init
nixos/swraid: fix regression for old initrd and add test coverage
2023-09-11 09:11:10 +03:00
Artturi 4c22001bbf
Merge pull request #253973 from trofi/bcache-make-optional 2023-09-11 08:10:19 +03:00
Christian Theune 0e1a8027d1 nixos/swraid: fix regression for old initrd and add test coverage 2023-09-10 17:16:33 +02:00
Christian Theune 7f341bb450 nixos/swraid: fix monitor service 2023-09-10 15:34:11 +02:00
Sergei Trofimovich 566e32dd42 nixos/bcache: add a boot.bcache.enable kill switch
My system does not use `bcache` and I sould prever my `systemPackages`
not to have bcache tools.

The change does not change the default but proviced usual `enable` knob.
2023-09-10 14:26:53 +01:00
Robert Obryk 44fde723be nixos/security/wrappers: generate a separate and more complete apparmor policy fragment for each wrapper
This change includes some stuff (e.g. reading of the `.real` file,
execution of the wrapper's target) that belongs to the apparmor policy
of the wrapper. This necessitates making them distinct for each wrapper.
The main reason for this change is as a preparation for making each
wrapper be a distinct binary.
2023-08-27 14:10:07 +02:00
Majiir Paktu 1f34babe84 nixos/network-interfaces-systemd: add bridge interfaces in systemd-initrd 2023-08-25 13:11:40 -04:00
Majiir Paktu 2cb4671ebc nixos/network-interfaces-systemd: add VLAN interfaces in systemd-initrd 2023-08-25 10:44:43 -04:00
Daniel Carosone 4ffc1c82c6 zfs: 'want', don't 'require', systemd-udev-settle
This completes changes in #227208
Fixes: #244737, #245089.
2023-07-28 16:57:12 +10:00
Will Fancher 0ddc9d0250 zfs: Relate import services to zfs-import.target instead of local-fs
Being wanted by and ordered before local-fs.target isn't strictly
correct. And in systemd initrd, it's very incorrect because
local-fs.target is for the initrd file system, not the real root file
system.
2023-07-23 14:12:53 -04:00
Matti 162039a233 nixos/swraid: Add missing mkRenamedOption 2023-07-15 03:56:54 +02:00
Will Fancher 11fec97761
Merge pull request #183314 from DeterminateSystems/optional-swraid
Make swraid optional
2023-07-13 16:24:34 -04:00
nikstur 3b6bc9b536 nixos/filesystems: init squashfs 2023-07-10 22:02:36 +02:00
Linus Heckemann 7d2124f9e3 stage-1: Only copy mdadm and mdmon into initramfs if enabled 2023-07-10 20:31:13 +02:00
Linus Heckemann c0f963a338 boot.initrd.services.swraid -> boot.swraid
Since the option affects both stage-1 and stage-2, it does not make
sense to keep it within the boot.initrd namespace.
2023-07-10 20:20:08 +02:00
Linus Heckemann 0b277bcc2b nixos/swraid: make entire module optional
swraid support will now only be enabled by default if stateVersion is
older than 23.11. nixos-generate-config will now generate explicit
config for enabling support if needed.
2023-07-10 16:39:35 +02:00
Ryan Lahfa ed2f009130
Merge pull request #237873 from Mic92/fix-aarch64-zfs 2023-07-08 14:41:00 +02:00
Michele Guerini Rocco d0b4889418
Merge pull request #240295 from sysvinit/sysvinit/udev-privacy-address-scope
network-interfaces: restrict ipv6 udev rules
2023-07-06 18:03:36 +02:00
Will Fancher e520c2e278
Merge pull request #240600 from lilyinstarlight/fix/luksroot-lvm-default-off
nixos/lvm: toggle initrd enable option independently of main options
2023-07-05 12:42:45 -04:00
Lily Foster 7b514d2175
nixos/lvm: toggle initrd enable option independently of main options 2023-07-05 04:59:04 -04:00
Will Fancher 73a8ca1674
Merge pull request #240601 from lilyinstarlight/fix/lvm-root-sd-stage-1-unhide
nixos/*: unhide remaining systemd stage-1 options
2023-07-03 13:38:12 -04:00
Lily Foster e9207b0501
nixos/*: unhide remaining systemd stage-1 options
These options were missed in NixOS/nixpkgs#226237, but they all were
specifically added for systemd stage-1.
2023-07-03 08:41:38 -04:00
Jörg Thalheim 4d719f101c nixos/bcachefs: add new mount.bcachefs util 2023-07-01 17:10:10 +02:00
Molly Miller 3e96fd980d nixos/network-interfaces: restrict IPv6 privacy address overrides to interface
Only trigger the privacy address override for a given interface when
that interface is added. Without restricting the rule to the
interface, this command would be run when any interface is added.
2023-06-27 16:15:02 +02:00
Raito Bezarius d4cab20b3a zfs: add option to restore kernel_neon for linux 6.2 support on aarch64
Introduced in aaeca98456
with the usual disdain for ZFS.

We have been there in the past with
<https://www.phoronix.com/news/NixOS-Linux-5.0-ZFS-FPU-Drop> /
https://github.com/NixOS/nixpkgs/pull/61076.

This fixes ZFS on aarch64 until the next breakage.

See https://github.com/openzfs/zfs/issues/14555 for original upstream
issue.
2023-06-16 11:07:33 +02:00
Daniel Carosone 86ecee627a typo 2023-06-16 12:25:34 +10:00
Daniel Carosone 2dcb1b3ed7 nixos/zfs: assert that pool names are not empty
a zfs fileSystems entry with an absolute (e.g. device) path rather than
a zfs dataser is parsed as an empty pool name, causing a doomed-to-fail
import job to be created as a boot dependency. Catch this as an assertion
2023-06-16 10:40:09 +10:00
Will Fancher b497502357 nixos: Use systemd-growfs for autoResize 2023-06-04 22:57:22 -04:00
Will Fancher 5176a4f113 nixos: Use systemd-makefs for autoFormat 2023-06-04 22:57:20 -04:00
rnhmjoj 6732106210
network-interfaces-scripted: fix interface cleanup
There is apparently a bug in the parser of iproute2 where the command
`ip link show <devname>` will not show the device but list all
interfaces (equivalent to `ip link show`) if devname is equal to one of
the flags of `ip-address(8)`. For example, `home`, or `optimistic`.

This bug causes a false positive in the clean up command of the
<devname>-netdev.service, the service fails and the interface is never
configured.

To avoid the bug we can simply use `ip link show dev <devname>`.
2023-05-27 15:09:22 +02:00
Will Fancher fe43923a70
Merge pull request #229767 from mberndt123/mberndt123/stratis-rootfs
nixos/stratis: initrd support for stratis root volumes
2023-05-25 14:06:31 -04:00
figsoda 701bcdbead nixos: fix typos 2023-05-19 22:31:04 -04:00
Will Fancher edcd3d3056
Merge pull request #229318 from ReneHollander/fix/nixos-zfs-systemd-unlock-times-out
nixos/zfs: disable unlock timeout with systemd
2023-05-18 12:42:21 -04:00
Matthias Berndt cb410a8c59 Merge remote-tracking branch 'upstream/master' into mberndt123/stratis-rootfs 2023-05-17 21:47:19 -04:00
Matthias Berndt 92814241a8 improve stratis initrd support
it is now possible to supply a stratis pool uuid
for every filesystem, and if that filesystem
is required for boot, the relevant pool will be
started in the initramfs.
2023-05-16 22:48:36 -04:00
Rene Hollander dbb940f433
nixos/zfs: disable unlock timeout with systemd
Currently systemd-ask-passwd times out after 1m30s. After 3 tries this
causees systemd to enter the emergency shell and basically lead to an
unbootable system requiring a reboot to be able to try to unlock again.

Also if a pool is imported but not unlocked, the unlock step will no
longer be skipped.
2023-05-13 13:53:22 +02:00