Commit graph

321 commits

Author SHA1 Message Date
Shawn8901
9a1d8f09cf zfs: add option to use kernel keyring for encryption credentials 2025-04-03 22:57:06 +02:00
Silvan Mosberger
374e6bcc40 treewide: Format all Nix files
Format all Nix files using the officially approved formatter,
making the CI check introduced in the previous commit succeed:

  nix-build ci -A fmt.check

This is the next step of the of the [implementation](https://github.com/NixOS/nixfmt/issues/153)
of the accepted [RFC 166](https://github.com/NixOS/rfcs/pull/166).

This commit will lead to merge conflicts for a number of PRs,
up to an estimated ~1100 (~33%) among the PRs with activity in the past 2
months, but that should be lower than what it would be without the previous
[partial treewide format](https://github.com/NixOS/nixpkgs/pull/322537).

Merge conflicts caused by this commit can now automatically be resolved while rebasing using the
[auto-rebase script](8616af08d9/maintainers/scripts/auto-rebase).

If you run into any problems regarding any of this, please reach out to the
[formatting team](https://nixos.org/community/teams/formatting/) by
pinging @NixOS/nix-formatting.
2025-04-01 20:10:43 +02:00
Arne Keller
fd9f17ef49
nixos/filesystems: init bindfs (#337697) 2025-03-30 22:10:57 +02:00
h7x4
ab0564bd10
treewide: add documentation for nixos systemd units 2025-03-12 18:00:38 +01:00
Stefan Frijters
45dad721eb
nixos/zfs: make it easier to override Persistent setting of timers 2025-02-22 12:55:04 +01:00
Peder Bergebakken Sundt
953f72e76e nixos/*: tag manpage references 2025-01-27 02:47:01 +01:00
Christian Kögler
945777b8ed
nixos/zfs: Set scrub default IOSchedulingClass to idle (#312193) 2025-01-05 23:57:50 +01:00
Will Fancher
b7ea795937
nixos/overlayfs: add a switch to disable prefixing with /sysroot for initrd mounts (#340763) 2025-01-05 17:56:41 -05:00
Andrew Marshall
4ed27101c6 nixos/zfs: fix not auto-importing pools without any fileSystems
`lib.all (_: false) [ ]` is `true`, which is not the semantics we want
here, and interacts poorly with `boot.zfs.extraPools` where
`getPoolFilesystems` may return `[]`. So explicitly handle this case.
This does mean there isn’t a straightforward way to disable auto-import
with `extraPools` and no associated `fileSystems` while keeping the unit
around, but that’s probably okay for now.

See https://github.com/NixOS/nixpkgs/issues/364995.
Broken in 7f8278a264.
2024-12-13 19:02:30 -05:00
Arne Keller
e3f940648e
nixos/zfs: do not auto-import pools marked noauto (#352391) 2024-12-12 06:51:39 +01:00
Andrew Marshall
7f8278a264 nixos/zfs: do not auto-import pools marked noauto
This requires all datasets for the pool specified in `fileSystems` to be
marked noauto.

Note that this implicitly skips some tasks for the pool, such as
`expandOnBoot`, as the pool will not be imported at that time.
2024-12-11 22:56:13 -05:00
Silvan Mosberger
4f0dadbf38 treewide: format all inactive Nix files
After final improvements to the official formatter implementation,
this commit now performs the first treewide reformat of Nix files using it.
This is part of the implementation of RFC 166.

Only "inactive" files are reformatted, meaning only files that
aren't being touched by any PR with activity in the past 2 months.
This is to avoid conflicts for PRs that might soon be merged.
Later we can do a full treewide reformat to get the rest,
which should not cause as many conflicts.

A CI check has already been running for some time to ensure that new and
already-formatted files are formatted, so the files being reformatted here
should also stay formatted.

This commit was automatically created and can be verified using

    nix-build a08b3a4d19.tar.gz \
      --argstr baseRev b32a094368
    result/bin/apply-formatting $NIXPKGS_PATH
2024-12-10 20:26:33 +01:00
Bjørn Forsman
7aad7090b7 nixos/zfs: order pool sync services before final.target
If we don't do this, I think systemd can kill the service(s) before they
finish.
2024-12-07 10:16:55 +01:00
Moritz Sanft
cba277a1dc
nixos/overlayfs: format 2024-11-05 17:02:24 +01:00
Moritz Sanft
96a7448a4e
nixos/overlayfs: add a switch to disable prefixing with /sysroot for initrd mounts 2024-11-05 16:54:01 +01:00
Andrew Marshall
9ce881027b zfs: remove recommendations to use unstable
`pkgs.zfs_unstable` is pre-release software and may very well have
critical bugs that make it unsuitable for general use. As such, we
should not recommend it as a general solution to the problem of "my
Kernel is too new for stable ZFS".
2024-11-01 18:50:24 -04:00
Andrew Marshall
a0de415588 nixos/zfs: improve docs for boot.zfs.devNodes option
Specify more clearly how this is used, and defer to upstream docs for
guidance on selecting it.
2024-10-31 09:04:11 -04:00
Andrew Marshall
0f69b960b8 nixos/zfs: teach to override devNodes per pool
This may be useful if some pools use LUKS or some other intermediate
layer, while others do not.
2024-10-30 10:41:18 -04:00
Sandro Jäckel
91cf1d31c8 nixos/zfs: fix shellcheck findings with enableStrictShellChecks enabled 2024-10-30 08:33:57 +00:00
Franz Pletz
cc2142b9f0
nixos/zfs: remove incorrect conditional use of spl kmod; remove withs (#344271) 2024-09-28 15:30:13 +02:00
Andrew Marshall
bec753ddfc nixos/zfs: replace with with let
The fully-qualified name would certainly be a lot here, but `with` can
still be unclear even with narrow scope. A short `let` adds clarity
without significantly increasing verbosity.
2024-09-27 08:08:31 -04:00
Andrew Marshall
eef4c18ae8 nixos/zfs: remove unused vars 2024-09-27 08:08:31 -04:00
Andrew Marshall
33bd85a6c8 nixos/zfs: remove top-level withs
As it is generally considered an anti-pattern. Removing them here in
fact exposed one bug (see previous commit).
2024-09-27 08:08:30 -04:00
Andrew Marshall
06ed2c46fb nixos/zfs: remove incorrect conditional use of spl kmod
This was incorrectly getting `lib.version` which is e.g.
`"24.11pre-git"`, but should have been the ZFS package version. However,
the condition, at least per the comment, is reversed and should be
instead `versionOlder cfgZfs.package.version "2.2.0"`. However, the
entire premise seems to be incorrect, as ZFS 2.2.6 includes the spl
module. Since the previous condition here was effectively always true,
it would initially seem the best move is to remove the conditional
altogether and always include the spl kmod. However, going back to
4360a87c45 where this condition was added,
the intent appears to be that spl was no longer needed here in
the-pre-release ZFS (long since in all supported versions), due to it
being merged into ZFS mainline. Given that intent and that our boot
tests on all versions succeed without including it in the initrd, remove
it.
2024-09-27 08:08:30 -04:00
Patrick Collins
448240f6e2
nixos/nfsd: fix typo that breaks services.nfs.settings (#342200)
Currently will always fail when nfs.server.hostName is specified alongside nfs.settings.
2024-09-25 20:33:23 +03:00
Felix Buehler
dd7ab59690 nixos/services.nfs: remove with lib; 2024-09-15 10:43:58 +02:00
Aaron Ecay
345618de26
nixos/zfs: mitigate data loss issues when resuming from hibernation 2024-09-06 13:39:21 -04:00
Will Fancher
c653608dcd overlayfs: Assert that upperdir == null requires systemd initrd 2024-08-30 15:18:36 -04:00
Will Fancher
160ff9ff9c overlayfs: Use depends 2024-08-30 15:18:36 -04:00
Luflosi
8032f77462
nixos/filesystems: init bindfs 2024-08-27 13:43:46 +02:00
7c6f434c
da64ac6beb
Merge pull request #310807 from Naxdy/work/improve-btrfs-autoscrub
nixos/btrfs: refactor & improve device selection for autoScrub
2024-08-03 15:31:32 +00:00
misuzu
4df3c4c17b nixos/clevis: add support for parent encrypted zfs datasets 2024-06-12 21:21:50 +03:00
Jonathan Davies
0274fc2212
nixos/zfs: Set scrub default IOSchedulingClass to idle 2024-05-16 13:47:02 +01:00
Naxdy
d0239a1e50
nixos/btrfs: improve default selection of filesystems for autoScrub 2024-05-11 12:10:38 +02:00
Naxdy
804bc033a6
nixos/btrfs: refactor global with lib; 2024-05-11 11:50:58 +02:00
Franz Pletz
338a208e7d
Merge pull request #287505 from jpds/zfs-scrub-trim-randomizedDelaySec 2024-05-10 02:11:13 +02:00
Jonathan Davies
8e0e9bdee8 nixos/zfs: Added a randomizedDelaySec option to ZFS autoscrub/trim timers
Allows operators to space out these IO operations across a fleet of
machines, rather than have them all happen at the same time.
2024-05-03 15:01:53 +01:00
Jonathan Davies
5b671b7fc8 nixos/zfs: Default autoscrub interval to monthly 2024-05-03 13:41:51 +01:00
stuebinm
6afb255d97 nixos: remove all uses of lib.mdDoc
these changes were generated with nixq 0.0.2, by running

  nixq ">> lib.mdDoc[remove] Argument[keep]" --batchmode nixos/**.nix
  nixq ">> mdDoc[remove] Argument[keep]" --batchmode nixos/**.nix
  nixq ">> Inherit >> mdDoc[remove]" --batchmode nixos/**.nix

two mentions of the mdDoc function remain in nixos/, both of which
are inside of comments.

Since lib.mdDoc is already defined as just id, this commit is a no-op as
far as Nix (and the built manual) is concerned.
2024-04-13 10:07:35 -07:00
Luís Fonseca
38b68216a5
nixos/zfs: install zfs udev rules on stage1
Install zfs udev rules on initrd, so that /dev/zvol gets populated.
2024-04-08 02:53:01 +01:00
Matt Moriarity
10035ed5ab nixos/bcachefs: support unlock with clevis in systemd stage 1 2024-04-05 14:39:11 +00:00
Aaron Andersen
c4719710f0
Merge pull request #298068 from posch/manage-gids
nixos/nfsd: settings for /etc/nfs.conf
2024-04-01 16:15:10 +00:00
Tobias Poschwatta
ee2b899ff7 nixos/nfsd: settings for /etc/nfs.conf
services.nfs.settings is added for options that go into /etc/nfs.conf.

There are services.nfs.server.extraNfsdConfig and
services.nfs.extraConfig, but they have drawbacks.  They overlap in
scope (nfs.extraConfig can also add nfsd options). They require that one
writes INI syntax. They often produce nfs.conf files with duplicate
section names, which is confusing.

This deprecates services.nfs.server.extraNfsdConfig and
services.nfs.extraConfig.

services.nfs.settings cannot be used together with
services.nfs.server.extraNfsdConfig or services.nfs.extraConfig.
2024-03-25 12:22:48 +01:00
Jörg Thalheim
3a8e8369a6 envfs: 1.0.3 -> 1.0.6
Diff: https://github.com/Mic92/envfs/compare/1.0.3...1.0.6
2024-03-24 10:26:45 +01:00
Adam C. Stephens
b52452f8c7
Merge pull request #291951 from amarshall/zfs-pkgs-renaming
zfs: rename zfsStable -> zfs_2_2; zfsUnstable -> zfs_unstable; remove enableUnstable option in favor of package
2024-03-01 10:09:12 -05:00
Andrew Marshall
1f32eb724d nixos/zfs: Remove enableUnstable in favor of setting package
This just adds complexity and confusion. Once-upon-a-time, there was no
`package` and only `enableUnstable`, but now it is just confusing to
have both, as it would be possible to do e.g. `package = pkgs.zfs` and
`enableUnstable = true`, but then `enableUnstable` does nothing.
2024-02-27 19:30:19 -05:00
Andrew Marshall
929fcf9335 zfs_unstable: Rename from zfsUnstable
This matches the naming of other zfs_* pkgs.
2024-02-27 18:45:55 -05:00
Andrew Marshall
ce5b1e007e nixos/zfs: Fix typo in option doc 2024-02-27 18:45:55 -05:00
Alyssa Ross
45f1428902
zfs_2_1: 2.1.14 -> 2.1.15
This adds compatibility with newer kernels, which fixes
nixosTests.zfs.series_2_1, which broke when the default kernel version
was bumped.

This means we no longer need the removeLinuxDRM option at all, but
I've kept it around as a no-op so people can leave it set in case the
same thing happens again in future.
2024-02-27 13:44:16 +01:00
Alyssa Ross
2b9f043823
zfs: update latestCompatibleLinuxPackages
ZFS no longer tries to use GPL-only symbols on aarch64.

Tested by building nixosTests.zfs.stable (modified to use Linux 6.6)
and nixosTests.zfs.unstable.
2024-02-26 12:27:10 +01:00