-{ pkgs, lib, hostName, ... }:
+{
+ pkgs,
+ lib,
+ hostName,
+ ...
+}:
{
# none is the recommended elevator with ZFS (which has its own I/O scheduler)
services.udev.extraRules = ''
PrivateTmp = true;
SyslogIdentifier = "zfs-import@%i";
Restart = "no";
- ExecStart = pkgs.writeShellScript "zfs-import" ''
- pool="$1"
- set -eux
- zpool status "$pool" ||
- zpool import -lFd /dev/disk/by-id/ -o cachefile=none "$pool" ||
- zpool reopen "$pool" ||
- zpool import -lfd /dev/disk/by-id/ -o cachefile=none "$pool" ||
- zpool clear -nFX "$pool"
- ${pkgs.systemd}/bin/systemctl restart zfs-mount.service
- '' + " %I";
+ ExecStart =
+ pkgs.writeShellScript "zfs-import" ''
+ pool="$1"
+ set -eux
+ zpool status "$pool" ||
+ zpool import -lFd /dev/disk/by-id/ -o cachefile=none "$pool" ||
+ zpool reopen "$pool" ||
+ zpool import -lfd /dev/disk/by-id/ -o cachefile=none "$pool" ||
+ zpool clear -nFX "$pool"
+ ${pkgs.systemd}/bin/systemctl restart zfs-mount.service
+ ''
+ + " %I";
};
};
}