diff --git a/hosts/seer/services/mc-docs.nix b/hosts/seer/services/mc-docs.nix index 2d9eacb..8c619cf 100644 --- a/hosts/seer/services/mc-docs.nix +++ b/hosts/seer/services/mc-docs.nix @@ -5,7 +5,10 @@ in { systemd.services."mc-docs" = { description = "https://${url} source"; - serviceConfig.Type = "oneshot"; + serviceConfig = { + Type = "oneshot"; + EnvironmentFile = "/var/secrets/mc-docs.env"; + }; startAt = "*:0/5"; path = with pkgs; [nix git]; script = '' @@ -18,6 +21,13 @@ in { mkdir -p /var/www/ ln -sfT $result/var/www/docs ${out} + + commit=$(git rev-parse --short HEAD) + + if [ "$(cat current)" != "$commit" ]; then + echo $commit > current + nix run .#kivia -- "Docs Site Deployed" "Updated docs and resource pack" "https://${url}" "Commit: $commit" "57e389" + fi ''; };