summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorSoispha <soispha@vhack.eu>2023-07-04 14:22:04 +0200
committerSoispha <soispha@vhack.eu>2023-07-04 14:22:04 +0200
commit33398b1844e1f971605b23b1229f3176b6e3b0e6 (patch)
treee899fe268d273014a3679d197d61e0a7aec15faa
parentFix(system/services/nix-sync): Add some required paths to unit (diff)
downloadnixos-server-33398b1844e1f971605b23b1229f3176b6e3b0e6.tar.gz
nixos-server-33398b1844e1f971605b23b1229f3176b6e3b0e6.zip
Fix(system/services/nix-sync): Remove slash from cachePath
-rw-r--r--system/services/nix-sync/default.nix8
1 files changed, 7 insertions, 1 deletions
diff --git a/system/services/nix-sync/default.nix b/system/services/nix-sync/default.nix
index 07c621a..de51f0b 100644
--- a/system/services/nix-sync/default.nix
+++ b/system/services/nix-sync/default.nix
@@ -179,7 +179,7 @@ in {
         type = lib.types.str;
         default = "/var/lib/nix-sync";
         description = lib.mdDoc ''
-          Where to cache git directories.
+          Where to cache git directories. Should not end with a slash ("/")
         '';
       };
 
@@ -193,6 +193,12 @@ in {
   };
 
   config = lib.mkIf cfg.enable {
+    assertions = [
+      {
+        assertion = !lib.strings.hasSuffix "/" cfg.cachePath;
+        message = "Your cachePath ('${cfg.cachePath}') ends with a slash ('/'), please use: '${lib.strings.removeSuffix "/" cfg.cachePath}'.";
+      }
+    ];
     systemd.services = services;
     users.users =
       if cfg.user == "nix-sync"