summary refs log tree commit diff
path: root/nixos/modules/tasks/filesystems/zfs.nix
diff options
context:
space:
mode:
authorJörg Thalheim <joerg@thalheim.io>2019-10-07 10:50:30 +0100
committerJörg Thalheim <joerg@thalheim.io>2019-10-08 11:11:06 +0100
commit692656daf85d17ceb8b9f0ad2a96aea208233857 (patch)
treef48c4173efe05c799eb01ed49f620cbae02e8edb /nixos/modules/tasks/filesystems/zfs.nix
parenta412d90e101b94d797f6aca4b96fdac2fd85e599 (diff)
downloadnixpkgs-692656daf85d17ceb8b9f0ad2a96aea208233857.tar
nixpkgs-692656daf85d17ceb8b9f0ad2a96aea208233857.tar.gz
nixpkgs-692656daf85d17ceb8b9f0ad2a96aea208233857.tar.bz2
nixpkgs-692656daf85d17ceb8b9f0ad2a96aea208233857.tar.lz
nixpkgs-692656daf85d17ceb8b9f0ad2a96aea208233857.tar.xz
nixpkgs-692656daf85d17ceb8b9f0ad2a96aea208233857.tar.zst
nixpkgs-692656daf85d17ceb8b9f0ad2a96aea208233857.zip
nixos/zfs: avoid script derivation for trim service
Since we only have a single pipe we can save the overhead of building a derivation
when creating the zfs trim service file when building the system.
Diffstat (limited to 'nixos/modules/tasks/filesystems/zfs.nix')
-rw-r--r--nixos/modules/tasks/filesystems/zfs.nix4
1 files changed, 1 insertions, 3 deletions
diff --git a/nixos/modules/tasks/filesystems/zfs.nix b/nixos/modules/tasks/filesystems/zfs.nix
index 6cfa510a78a..c8ba2cac0c1 100644
--- a/nixos/modules/tasks/filesystems/zfs.nix
+++ b/nixos/modules/tasks/filesystems/zfs.nix
@@ -558,9 +558,7 @@ in
         after = [ "zfs-import.target" ];
         path = [ packages.zfsUser ];
         startAt = cfgTrim.interval;
-        script = ''
-          zpool list -H -o name | xargs --no-run-if-empty -n1 zpool trim
-        '';
+        serviceConfig.ExecStart = "${pkgs.runtimeShell} -c 'zpool list -H -o name | xargs --no-run-if-empty -n1 zpool trim'";
       };
     })
   ];