From 000f56d295c4885a7c6c8a59588b260bcc02c69b Mon Sep 17 00:00:00 2001 From: coolneng Date: Fri, 21 May 2021 01:27:27 +0200 Subject: [PATCH] Work around services startup before ZFS pool --- modules/periodic.nix | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/modules/periodic.nix b/modules/periodic.nix index 92060dd..2305eca 100644 --- a/modules/periodic.nix +++ b/modules/periodic.nix @@ -46,4 +46,19 @@ in { requires = [ "systemd-udev-settle.service" ]; after = [ "systemd-udev-settle.service" ]; }; + + # HACK: restart services dependent on ZFS afer mount + systemd.services.restart-services-mount = { + description = "Restart services after the ZFS dataset is mounted"; + wantedBy = [ "default.target" ]; + script = '' + sleep 5 + systemctl restart syncthing + systemctl restart radicale + systemctl restart gitea + ''; + serviceConfig.Type = "oneshot"; + requires = [ "sata-hat.service" ]; + after = [ "vault.mount" ]; + }; }