diff --git a/nixos/doc/manual/release-notes/rl-2505.section.md b/nixos/doc/manual/release-notes/rl-2505.section.md index 29a0e96697ea..cfe1240bf752 100644 --- a/nixos/doc/manual/release-notes/rl-2505.section.md +++ b/nixos/doc/manual/release-notes/rl-2505.section.md @@ -104,6 +104,8 @@ 2.0](https://github.com/containerd/containerd/blob/main/docs/containerd-2.0.md) documentation for more details. +- The ZFS import service now respects `fileSystems.*.options = [ "noauto" ];` and does not add that pool's import service to `zfs-import.target`, meaning it will not be automatically imported at boot. + - `nodePackages.stackdriver-statsd-backend` has been removed, as the StackDriver service has been discontinued by Google, and therefore the package no longer works. - the notmuch vim plugin now lives in a separate output of the `notmuch` diff --git a/nixos/modules/tasks/filesystems/zfs.nix b/nixos/modules/tasks/filesystems/zfs.nix index c07a09d701f6..27f2028a175d 100644 --- a/nixos/modules/tasks/filesystems/zfs.nix +++ b/nixos/modules/tasks/filesystems/zfs.nix @@ -128,7 +128,9 @@ let "systemd-modules-load.service" "systemd-ask-password-console.service" ] ++ lib.optional (config.boot.initrd.clevis.useTang) "network-online.target"; - requiredBy = getPoolMounts prefix pool ++ [ "zfs-import.target" ]; + requiredBy = let + noauto = lib.all (fs: lib.elem "noauto" fs.options) (getPoolFilesystems pool); + in getPoolMounts prefix pool ++ lib.optional (!noauto) "zfs-import.target"; before = getPoolMounts prefix pool ++ [ "shutdown.target" "zfs-import.target" ]; conflicts = [ "shutdown.target" ]; unitConfig = {