From 141a58f9cfc3ed637969c150f0b63b33ec7b2816 Mon Sep 17 00:00:00 2001 From: Peter Kling Date: Thu, 29 Aug 2024 20:47:37 +0200 Subject: [PATCH] provide RUNTIME_DIRECTORY manually if not given by systemd --- modules/services/syncthing.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/services/syncthing.nix b/modules/services/syncthing.nix index a87f5c3e7..7431d30ec 100644 --- a/modules/services/syncthing.nix +++ b/modules/services/syncthing.nix @@ -50,6 +50,7 @@ let cat = "${pkgs.coreutils}/bin/cat"; curl = "${pkgs.curl}/bin/curl"; install = "${pkgs.coreutils}/bin/install"; + mktemp = "${pkgs.coreutils}/bin/mktemp"; syncthing = "${pkgs.syncthing}/bin/syncthing"; copyKeys = pkgs.writers.writeBash "syncthing-copy-keys" '' @@ -67,6 +68,10 @@ let ''; curlShellFunction = '' + # systemd sets and creates RUNTIME_DIRECTORY on Linux + # on Darwin, we create it manually via mktemp + RUNTIME_DIRECTORY="''${RUNTIME_DIRECTORY:=$(${mktemp} -d)}" + curl() { # get the api key by parsing the config.xml while