36 lines
829 B
Nix
36 lines
829 B
Nix
{ pkgs, ... }:
|
|
|
|
{
|
|
systemd.services.website-deploy = {
|
|
serviceConfig.Type = "oneshot";
|
|
path = [
|
|
pkgs.git
|
|
pkgs.coreutils
|
|
pkgs.nixUnstable
|
|
pkgs.openssh
|
|
pkgs.deploy
|
|
];
|
|
script = ''
|
|
cd /home/anish/usr/helm/
|
|
git pull
|
|
nix flake lock --update-input poonam
|
|
nix flake lock --update-input basant
|
|
git add flake.lock
|
|
git diff-index --quiet HEAD || git commit -m 'updating website' # if nothing, don't exit 1
|
|
git push
|
|
deploy .#helix
|
|
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";
|
|
};
|
|
}
|