From 6e18fa4cda3e2d6d910a42c54c3d38266043331c Mon Sep 17 00:00:00 2001
From: Soispha <soispha@vhack.eu>
Date: Tue, 4 Jul 2023 21:49:24 +0200
Subject: Fix(system/services/nix-sync): Use cache directory

---
 system/services/nix-sync/default.nix | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

(limited to 'system/services/nix-sync')

diff --git a/system/services/nix-sync/default.nix b/system/services/nix-sync/default.nix
index 67df089..c8f6c44 100644
--- a/system/services/nix-sync/default.nix
+++ b/system/services/nix-sync/default.nix
@@ -20,6 +20,7 @@
     repoCachePath = cfg.cachePath + optionalPathSeparator + repo.path;
     execStartScript = pkgs.writeScript "git-sync-exec" ''
       #! /usr/bin/env dash
+      export XDG_CACHE_HOME="$CACHE_DIRECTORY";
       cd ${esa repoCachePath};
 
       while true; do
@@ -41,6 +42,7 @@
       done
     '';
     execStartPreScript = ''
+      export XDG_CACHE_HOME="$CACHE_DIRECTORY";
       if ! stat ${esa repoCachePath}/.git; then
           mkdir --parents ${esa repoCachePath};
           git clone ${esa repo.uri} ${esa repoCachePath};
@@ -67,13 +69,13 @@
       User = cfg.user;
       Group = cfg.group;
       # Runtime directory and mode
-      RuntimeDirectory = "nginx";
+      RuntimeDirectory = "nix-sync";
       RuntimeDirectoryMode = "0750";
       # Cache directory and mode
-      CacheDirectory = "nginx";
+      CacheDirectory = "nix-sync";
       CacheDirectoryMode = "0750";
       # Logs directory and mode
-      LogsDirectory = "nginx";
+      LogsDirectory = "nix-sync";
       LogsDirectoryMode = "0750";
       # Proc filesystem
       ProcSubset = "pid";
-- 
cgit 1.4.1