From 33398b1844e1f971605b23b1229f3176b6e3b0e6 Mon Sep 17 00:00:00 2001 From: Soispha Date: Tue, 4 Jul 2023 14:22:04 +0200 Subject: Fix(system/services/nix-sync): Remove slash from cachePath --- system/services/nix-sync/default.nix | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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" -- cgit 1.4.1