From b4de5dbb5372ce4f73e90c33d72a51c65c3fe43c Mon Sep 17 00:00:00 2001 From: echtnurich Date: Sun, 9 Jun 2024 18:12:01 +0200 Subject: [PATCH] introduce /etc/yate, clone/reset on service start --- config/hosts/yate/service.nix | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/config/hosts/yate/service.nix b/config/hosts/yate/service.nix index e426a31..8c0eb50 100644 --- a/config/hosts/yate/service.nix +++ b/config/hosts/yate/service.nix @@ -9,13 +9,20 @@ After="network.target"; }; serviceConfig = { - ExecStart = "${pkgs.yate}/bin/yate -c /yate -e /yate/share -Do"; + ExecStart = "${pkgs.yate}/bin/yate -c /etc/yate -e /etc/yate/share -Do"; Type="simple"; Restart="always"; # ... }; wantedBy = [ "default.target" ]; requiredBy = [ "network.target" ]; + preStart = "if mkdir -p /etc/yate + then + ${pkgs.git}/bin/git -C /etc/yate clone forgejo@git.hamburg.ccc.de:echtnurich/yate-config.git + ${pkgs.git}/bin/git -C /etc/yate pull + else + ${pkgs.git}/bin/git -C /etc/yate checkout -f origin/main + fi"; # ... }; }