helm/hosts/profiles/sync/website/default.nix

36 lines
836 B
Nix
Raw Normal View History

2022-12-06 08:01:17 -08:00
{ pkgs, ... }:
2022-09-18 15:13:50 -07:00
{
systemd.services.website-deploy = {
serviceConfig.Type = "oneshot";
path = [
pkgs.git
pkgs.coreutils
2024-08-19 21:29:41 -07:00
pkgs.nixVersions.latest
2022-09-18 15:13:50 -07:00
pkgs.openssh
2022-12-06 08:01:17 -08:00
pkgs.deploy
2022-09-18 15:13:50 -07:00
];
script = ''
2023-01-13 05:33:44 -08:00
cd /home/anish/usr/helm/
git pull
2022-09-18 15:13:50 -07:00
nix flake lock --update-input poonam
nix flake lock --update-input basant
2023-01-13 05:33:44 -08:00
git add flake.lock
git diff-index --quiet HEAD || git commit -m 'updating website' # if nothing, don't exit 1
git push
deploy .#helix
2022-09-18 15:13:50 -07:00
exit 0
'';
serviceConfig = {
User = "anish";
};
};
systemd.timers.website-deploy = {
after = [ "kitaab-sync.timer" ];
wantedBy = [ "timers.target" ];
partOf = [ "website-deploy.service" ];
timerConfig.OnCalendar = [ "daily" ];
timerConfig.persistent = "true";
};
}