@@ -623,7 +623,11 @@ in
623623 after = [ "zfs-import.target" ];
624624 path = [ packages.zfsUser ];
625625 startAt = cfgTrim.interval;
626− serviceConfig.ExecStart = "${pkgs.runtimeShell} -c 'zpool list -H -o name | xargs --no-run-if-empty -n1 zpool trim'";
626+ # By default we ignore errors returned by the trim command, in case:
627+ # - HDDs are mixed with SSDs
628+ # - There is a SSDs in a pool that is currently trimmed.
629+ # - There are only HDDs and we would set the system in a degraded state
630+ serviceConfig.ExecStart = ''${pkgs.runtimeShell} -c 'for pool in $(zpool list -H -o name); do zpool trim $pool; done || true' '';
627631 };
628632 })
629633 ];