From a893d3898c60c437221abaf200e730be2eddfcb6 Mon Sep 17 00:00:00 2001 From: Guillaume Girol Date: Thu, 3 Sep 2026 12:00:00 +0000 Subject: [PATCH] nixos/btrfs: don't stop scrub on suspend when on a recent kernel this is now a feature in the kernel: https://kernelnewbies.org/Linux_6.19#Btrfs_improvements --- nixos/modules/tasks/filesystems/btrfs.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nixos/modules/tasks/filesystems/btrfs.nix b/nixos/modules/tasks/filesystems/btrfs.nix index e3f3fe29e3ae..80661e8e3af7 100644 --- a/nixos/modules/tasks/filesystems/btrfs.nix +++ b/nixos/modules/tasks/filesystems/btrfs.nix @@ -183,12 +183,12 @@ in nameValuePair "btrfs-scrub-${fs'}" { description = "btrfs scrub on ${fs}"; documentation = [ "man:btrfs-scrub(8)" ]; - # scrub prevents suspend2ram or proper shutdown - conflicts = [ + # scrub prevents suspend2ram or proper shutdown on linux < 6.19 + conflicts = lib.optionals (lib.versionOlder config.boot.kernelPackages.kernel.version "6.19") [ "shutdown.target" "sleep.target" ]; - before = [ + before = lib.optionals (lib.versionOlder config.boot.kernelPackages.kernel.version "6.19") [ "shutdown.target" "sleep.target" ];