helm/profiles/sync/website/default.nix

34 lines
751 B
Nix
Raw Normal View History

2022-06-22 06:45:20 -07:00
{ pkgs, inputs, ... }:
2021-11-29 04:11:58 -08:00
{
2022-06-22 06:14:35 -07:00
systemd.services.website-deploy = {
2021-11-29 04:11:58 -08:00
serviceConfig.Type = "oneshot";
path = [
2022-03-24 06:06:10 -07:00
pkgs.git
2022-06-14 06:27:01 -07:00
pkgs.coreutils
2022-06-22 06:45:20 -07:00
pkgs.nixUnstable
pkgs.openssh
inputs.deploy.packages.${pkgs.system}.deploy-rs
2022-03-24 06:06:10 -07:00
];
2021-11-29 04:11:58 -08:00
script = ''
2022-06-22 06:14:35 -07:00
cd /etc/nixos/
nix flake lock --update-input poonam
# TODO
# git add flake.lock
# git commit -m "update website"
# git push
2022-06-22 06:14:35 -07:00
deploy .#cube --hostname lakhwara.com
2022-06-14 06:27:01 -07:00
exit 0
2022-03-24 06:06:10 -07:00
'';
2022-06-14 06:27:01 -07:00
serviceConfig = {
User = "anish";
};
2021-11-29 04:11:58 -08:00
};
2022-06-22 06:14:35 -07:00
systemd.timers.website-deploy = {
after = [ "kitaab-sync.timer" ];
2021-11-29 04:11:58 -08:00
wantedBy = [ "timers.target" ];
2022-06-22 06:14:35 -07:00
partOf = [ "website-deploy.service" ];
2022-06-14 06:27:01 -07:00
timerConfig.OnCalendar = [ "daily" ];
2021-11-29 04:11:58 -08:00
};
}