diff --git a/hosts/lillypc/gitwatch.nix b/hosts/lillypc/gitwatch.nix index cef6e91..55674c9 100644 --- a/hosts/lillypc/gitwatch.nix +++ b/hosts/lillypc/gitwatch.nix @@ -20,7 +20,7 @@ "EXCLUDE_PATTERN" = ""; "GIT_BRANCH" = "main"; "GIT_REMOTE" = "origin"; - "GIT_WATCH_DIR" = "/home/LillyOS"; + "GIT_WATCH_DIR" = "/home/lilly/LillyOS"; "PULL_BEFORE_PUSH" = "true"; "SKIP_IF_MERGING" = "false"; "SLEEP_TIME" = "10"; @@ -30,7 +30,7 @@ "/home/lilly/.config/git/config:/root/.gitconfig:ro" "/home/lilly/.ssh/known_hosts:/root/.ssh/known_hosts" "/home/lilly/.ssh/id_ed25519:/root/.ssh/id_ed25519:ro" - "/home/lilly/LillyOS:/home/LillyOS:rw" + "/home/lilly/LillyOS:/home/lilly/LillyOS:rw" ]; log-driver = "journald"; extraOptions = [ @@ -59,6 +59,54 @@ ]; }; + virtualisation.oci-containers.containers."gitwatch-lilly-config" = { + image = "ghcr.io/gitwatch/gitwatch:latest"; + environment = { + "COMMIT_MSG" = "Auto-commit: %d"; + "COMMIT_ON_START" = "false"; + "DATE_FMT" = "+%Y-%m-%d %H:%M:%S"; + "EXCLUDE_PATTERN" = ""; + "GIT_BRANCH" = "main"; + "GIT_REMOTE" = "origin"; + "GIT_WATCH_DIR" = "/home/lilly/.config"; + "PULL_BEFORE_PUSH" = "true"; + "SKIP_IF_MERGING" = "false"; + "SLEEP_TIME" = "10"; + "VERBOSE" = "false"; + }; + volumes = [ + "/home/lilly/.config/git/config:/root/.gitconfig:ro" + "/home/lilly/.ssh/known_hosts:/root/.ssh/known_hosts" + "/home/lilly/.ssh/id_ed25519:/root/.ssh/id_ed25519:ro" + "/home/lilly/.config:/home/lilly/.config:rw" + ]; + log-driver = "journald"; + extraOptions = [ + "--network-alias=gitwatch" + "--network=gitwatch_default" + ]; + }; + systemd.services."docker-gitwatch-lilly-config" = { + serviceConfig = { + Restart = lib.mkOverride 90 "always"; + RestartMaxDelaySec = lib.mkOverride 90 "1m"; + RestartSec = lib.mkOverride 90 "100ms"; + RestartSteps = lib.mkOverride 90 9; + }; + after = [ + "docker-network-gitwatch_default.service" + ]; + requires = [ + "docker-network-gitwatch_default.service" + ]; + partOf = [ + "docker-compose-gitwatch-root.target" + ]; + wantedBy = [ + "docker-compose-gitwatch-root.target" + ]; + }; + # Networks systemd.services."docker-network-gitwatch_default" = { path = [ pkgs.docker ];