Commit Graph

389 Commits

Author SHA1 Message Date
Sandro
2a0905a113 nixos/btrfs: add crypto modules only for kernel < 7.0 (#540943) 2026-08-14 14:37:56 +00:00
Archit Gupta
51db4787a6 nixos/btrfs: add crypto modules only for kernel < 7.0
Since kernel 7.0 BTRFS uses the kernel crypto library API, and no longer
depends on the traditional crypto API.
2026-08-05 19:22:38 -07:00
Paul Meyer
bc557b7168 nixos/qemu-firmware: init
Link QEMU firmware descriptors to /etc/qemu/firmware, where
systemd-vmspawn and other tools discover firmware for running VMs.

Signed-off-by: Paul Meyer <katexochen0@gmail.com>
2026-07-21 10:36:49 +02:00
John Titor
a1161a601c nixos/ntfs: install userspace utils for the new NTFS (NTFSPLUS) driver
Co-authored-by: ccicnce113424 <ccicnce113424@gmail.com>
2026-07-03 13:03:25 +05:30
Martin Weinelt
ab51f0dbef nixos/sshfs: enable fuse 2026-06-20 17:29:41 +02:00
Andreas Wiese
84ef80c6e7 nixos/bcachefs: fix scrub command
Before bcachefs-tools v1.34.0, scrub command was `bcachefs data scrub
…`, then it got `bcachefs scrub …` with the old one still working.  The
old one doesn't work anymore.

Fix the command for `services.bcachefs.autoScrub`, including version switch.
2026-06-11 00:19:13 +02:00
beviu
04beb06164 nixos/bcachefs: add upstream Systemd units to initrd
The bcachefs-wait-devices@.service unit can be added as a Wants
dependency to a .mount units to wait until every device in the
filesystem is initialized before doing the mount.
2026-05-12 09:13:15 +02:00
beviu
0003a08b78 nixos/bcachefs: add sbin/bcachefs to the Systemd initrd's storePaths
A later commit will add the bcachefs-wait-devices@.service unit to
the initrd. Since it references sbin/bcachefs, so we need to add it
to the initrd. Note that sbin/bcachefs is just a symlink to the actual
executable in bin so nothing is duplicated.
2026-05-12 09:13:06 +02:00
·𐑑𐑴𐑕𐑑𐑩𐑤
29c41af60e nixos/zfs: fix indentation
this block was off
2026-05-08 23:49:41 +07:00
Adam C. Stephens
ebc08544af nixos/zfs: less footguns (#495581) 2026-04-29 01:19:07 +00:00
rnhmjoj
35c3b96ba8 nixos/zfs: remove udev settle hack
It may not be actually needed, at least anymore.
All nixosTests.zfs are passing.
2026-04-08 21:11:35 +02:00
rnhmjoj
1e4eb2df3f nixos: completely remove systemd-udev-settle.service
This service is essentially a random sleep() call that old software that
is unable to properly handle modern hardware initialisation being
asynchronous can use to *mostly* get by.

Over the years is has caused so many issues in NixOS, like introducing
long delays in the boot process[1], complete deadlocks[2] and even failures
when reloading services or activating a new configuration[3].

systemd has been discouraging its use since 2011 (15 years ago!), then
it officially deprecated it in 2018 and since 2020 it started to show on
every boot a huge wall of text calling out all the offending services
that still use it.

Around 2021 we managed to fix around 15 NixOS modules[4] that were
relying on systemd-udev-settle and practically ZFS[5] was the only
remaining one. However, since then, people have actually started to
bring it back with new services[6][7][8]. This is not acceptable.

So, to prevent any more (lazy) uses of systemd-udev-settle, we stop
providing the systemd-udev-settle.service unit entirely. For existing
modules that unfortunately still need it, we replace it with the command
`udevadm settle --timeout=180`, which is all that the service does.
Hopefully this will also increase the awareness that it's bad and
something to be fixed.

Note: I tested this change using

 - `nixosTests.zfs`,
 - `nixosTests.ifstate`,
 - `nixosTests.misc`,
 - `nixosTests.openvswitch`,
 - `nixosTests.predictable-interface-names`
 - `nixosTests.nvidia-container-toolkit`

and making sure that none of the 165 packages that provide upstream
units (via the `systemd.packages` option) had a dependency on
systemd-udev-settle.service.

[1]: https://github.com/NixOS/nixpkgs/pull/25311
[2]: https://github.com/NixOS/nixpkgs/issues/107341
[3]: https://github.com/NixOS/nixpkgs/pull/113804
[4]: https://github.com/NixOS/nixpkgs/issues/73095
[5]: https://github.com/openzfs/zfs/issues/10891
[6]: https://github.com/NixOS/nixpkgs/pull/257525#discussion_r1442702970
[7]: https://github.com/NixOS/nixpkgs/pull/460075
[8]: https://github.com/NixOS/nixpkgs/pull/284507
2026-04-08 21:11:35 +02:00
Jörg Thalheim
1c92bb1a42 nixos/envfs: fix compatibility with systemd in initrd (#494001) 2026-03-12 08:38:17 +00:00
İlkecan Bozdoğan
3a6f7a60ac nixos/envfs: fix compatibility with systemd in initrd
This module disables the activation scripts that would normally create
`/usr/bin/env` and `/bin/sh` (and their parent directories). When
systemd is used in the initrd, the absence of these directories causes
2 problems:
- During switch-root, base_filesystem_create_fd() creates an empty /usr
  directory. Later at stage2, systemd's initialize_runtime() aborts
  booting with "Refusing to run in unsupported environment where /usr/
  is not populated."
- Once /usr/bin is restored (by the fix above), base_filesystem_create_fd()
  creates a symlink /bin -> /usr/bin. systemd-fstab-generator then
  canonicalizes the /bin fstab entry through this symlink, producing a
  duplicate usr-bin.mount.

We create both /sysroot/usr/bin and /sysroot/bin via initrd tmpfiles
to prevent both issues.

Resolves NixOS#462556

Co-authored-by: Lin Yinfeng <lin.yinfeng@outlook.com>
2026-03-08 22:37:29 +03:00
Sandro
2983135f51 nixos/zfs: fix error when sendmail is not configured and zed is enabled (#472235) 2026-03-08 00:34:15 +00:00
Sandro Jäckel
9173118034 nixos/zfs: assert that zed.enableMail is only being used when sendmailSetuidWrapper is enabled
Otherwise we crash like:

… while selecting an attribute
  at /nix/store/0b202s06rfm1vlyai37gd0zmzxg59qj0-source/nixos/modules/tasks/filesystems/zfs.nix:827:48:
   826|           lib.mkDefault (
   827|             config.security.wrapperDir + "/" + config.services.mail.sendmailSetuidWrapper.program
      |                                                ^
   828|           )

error: expected a set but found null: null
2026-03-08 01:15:20 +01:00
ThinkChaos
17fd12ce9c nixos/zfs: rename allowHibernation to unsafeAllowHibernation
Update the name and documentation to make it clear it's a matter of
"when" not "if".

This change was recommended in 2023 but noone followed up:
https://github.com/NixOS/nixpkgs/pull/208037#issuecomment-1688855654

(I never used this and have suffered no dataloss, but might as well make
this small improvement while I notice the currently dire situation.)
2026-03-01 19:28:19 -05:00
ThinkChaos
dfd0f18d9d nixos/zfs: default forceImportRoot to false for stateVersion >= 26.11 and warn before that
As per 12e77fdc3f that set it to true:

> This may currently be necessary, especially if your pools have not
> been correctly imported with a proper host id configuration (which
> is probably true for 99% of current NixOS ZFS users). Once host id
> configuration becomes mandatory when using ZFS in NixOS and we are
> sure that most users have updated their configurations and rebooted
> at least once, we should disable force-import by default. Probably,
> this shouldn't be done before the next stable release.

A couple stable releases have come and gone since 2014!
Let's remove this armed and aimed footgun.
2026-03-01 19:28:19 -05:00
zowoq
efcd42d1bd linuxPackages: 6.12 -> 6.18 2026-02-09 22:20:12 +10:00
Will Fancher
43dee1759e nixos/bcachefs: Use kernel 6.18
Ideally, the module does not set a non-LTS kernel by default, which we
have been able to do since 6.18 was labeled LTS. This should have been
done before 6.19 became `latest` to avoid having people upgraded to
6.19 and then downgraded to 6.18, but we just missed that. Shouldn't
be a problem if we rectify it quickly.
2026-02-09 03:24:44 -05:00
Doron Behar
5b265bda51 jfsutils: split man, dev & lib outputs (#483024) 2026-01-26 09:54:05 +00:00
Doron Behar
abd697c830 nixos/jfs: use lib.getBin 2026-01-26 11:48:58 +02:00
Doron Behar
879306c36f cifs-utils: split bin, dev & man outputs (#482338) 2026-01-26 09:44:51 +00:00
Doron Behar
377c92a9ac cifs-utils: split bin, dev & man outputs 2026-01-22 13:30:01 +02:00
nixpkgs-ci[bot]
c95fc42eb1 Merge master into staging-next 2026-01-20 00:18:19 +00:00
Adam C. Stephens
c91db26175 nixos/zfs: fix missing zed-functions.sh 2026-01-19 15:39:50 -05:00
nixpkgs-ci[bot]
d93c437c6a Merge master into staging-next 2026-01-14 18:06:09 +00:00
Sigmanificient
a939c13d89 ecryptfs: drop 2026-01-14 09:33:38 +01:00
nixpkgs-ci[bot]
ee52662516 Merge staging-next into staging 2026-01-10 00:19:00 +00:00
Adam C. Stephens
366382c16e nixos/zfs: update /etc/zfs/zed.d symlinks (#474860) 2026-01-09 19:58:16 +00:00
Philip Taron
db1801609d Drop more reiserfs (#461260) 2026-01-05 21:08:05 +00:00
Sandro
c3576c34a7 nixos/xfs: fix xfs_scrub and include service (#469878) 2026-01-04 01:18:37 +00:00
Sandro Jäckel
9fb5374acb nixos/tasks/reiserfs: drop 2026-01-03 04:37:46 +01:00
Adam C. Stephens
e7fcac9576 nixos/zfs: update /etc/zfs/zed.d symlinks
2.4 renamed some of these, and we were missing a couple in 2.3 as well.
2025-12-28 13:42:02 -05:00
okt
cbd09c66a5 nixos/btrfs: use algorithm names instead of kernel module names
The canonical names of kernel crypto modules are not stable across
versions. Use the algorithm names from btrfs softdeps instead, which
the kernel will resolve to the appropriate modules.
Previously: xxhash_generic, blake2b_generic, sha256_generic
Now: xxhash64, blake2b-256, sha256
This fixes initrd builds on kernel 6.19+ where blake2b_generic was
renamed to blake2b, and is more resilient to future module renames.
See: https://github.com/torvalds/linux/blob/v6.19-rc1/fs/btrfs/super.c#L2705-L2708
2025-12-23 11:04:04 -07:00
Mark Ellis
64481a1a82 zfs: clevis support for all filesystems, not just those needed for boot
load zfs key from clevis for any dataset that is configured, not just
those needed for boot

also works for dual keys, e.g. those with a clevis key, and a zfs
keylocation of `file:///` (previously it would error if the zfs
keylocation was not `prompt`)
2025-12-17 13:53:13 +01:00
Tungsten842
1c07187c8f nixos/xfs: fix xfs_scrub and include service 2025-12-11 12:38:45 +01:00
Markus Kowalewski
9d71961da2 nixos/nfs-client: add dns_resolver entry to request-key.conf (#455207) 2025-11-03 11:11:45 +00:00
Markus Kowalewski
90050b9691 nixos/nfs-client: add dns_resolver entry to request-key.conf
* A dns_resolver entry is needed for a NFSv4 client to
  resolve hostnames of NFS referrals and replicas.

* Make request-key.conf customizable, by moving
  content from separate file into
  `environment.etc."request-key.conf".text`
2025-11-03 11:01:32 +01:00
John Titor
471e2931e8 nixos/stage-1: fix nix parsing error
```
error: A definition for option `boot.initrd.systemd.extraBin.mount' is not of type `absolute path'. Definition values:
       - In `/nix/store/h259dzilgbvpfsnlcyims14jrcdnx8fk-source/nixos/modules/tasks/filesystems/zfs.nix':
           {
             zfs = "/nix/store/hxg3s5l92y9n9m48p872i62dn5ck33hx-zfs-user-2.4.0-rc3/sbin/mount.zfs";
           }

```
Fixes https://github.com/NixOS/nixpkgs/pull/414391#issuecomment-3448084329
2025-10-26 14:27:21 +05:30
Masum Reza
5992eb776d nixos/stage-1: always include util-linux mount (#414391) 2025-10-25 10:56:23 +00:00
Will Fancher
e825675658 linux/common-config: Disable bcachefs 2025-10-15 22:27:08 +05:30
h7x4
2881e466f7 nixos/btrfs: Add option to limit scrub throughput (#447954) 2025-10-14 02:50:56 +00:00
Wolfgang Walther
91a8fee3aa treewide: remove redundant parentheses
Auto-fixed by nixf-diagnose.
2025-10-05 10:52:03 +02:00
Mynacol
e07671cc0d nixos/btrfs: Add option to limit scrub throughput 2025-10-02 10:38:00 +00:00
Will Fancher
62a07189b4 nixos/bcachefs: fix warning 2025-09-30 13:57:31 -04:00
Will Fancher
6e331d90bd bcachefs-kernel-module: Nest within bcachefs-tools
When you set the bcachefs userspace tools with:

```nix
boot.bcachefs.package = /* custom pacakge */;
```

This now also changes the kernel package. The NixOS module now calls
on the nested `cfg.package.kernelModule` expression with
`kernelPackages.callPackage`. This will enable overriding both
userspace and kernel space from e.g. upstream git.
2025-09-30 01:16:01 -04:00
Will Fancher
89e7815828 nixos/bcachefs: Use out-of-tree module when possible. 2025-09-24 21:15:52 -04:00
Will Fancher
25d56c5a34 nixos/bcachefs: Don't duplicate assertions.
The first instance is unconditional. No need to have it twice.
2025-09-24 21:15:52 -04:00
John Titor
f93738d6a2 Partially revert "nixos/bcachefs: remove linuxPackages_latest requirement"
This reverts commit afbaa572ed.

Bcachefs upstream recommends using the latest kernel for best compatibility.
2025-09-23 13:13:37 +05:30