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-07-13 01:31:04 -07:00
|
|
|
cd /etc/nixos/ # TODO make variable
|
2022-06-22 06:14:35 -07:00
|
|
|
nix flake lock --update-input poonam
|
2022-07-10 21:20:32 -07:00
|
|
|
nix flake lock --update-input basant
|
2022-06-22 06:46:39 -07:00
|
|
|
# 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
|
|
|
};
|
|
|
|
}
|