nix-infra/config/hosts/yate/service.nix

34 lines
1.1 KiB
Nix
Raw Normal View History

2024-06-08 22:18:23 +02:00
{ config, pkgs, ... }:
{
systemd.services.yate = {
enable = true;
description = "Yate telehony engine";
unitConfig = {
Type = "simple";
After="network.target";
};
serviceConfig = {
ExecStart = "${pkgs.yate}/bin/yate -c /etc/yate -e /etc/yate/share -Do";
2024-06-08 22:18:23 +02:00
Type="simple";
Restart="always";
2024-08-05 20:58:09 +02:00
Group="yate-config";
StateDirectory = "yate";
StateDirectoryMode = "0775";
2024-06-08 22:18:23 +02:00
# ...
};
wantedBy = [ "default.target" ];
requiredBy = [ "network.target" ];
2024-08-05 20:58:09 +02:00
preStart = "if ! [ -d \"/var/lib/yate/.git\" ]
then
2024-08-05 20:58:09 +02:00
${pkgs.git}/bin/git init /var/lib/yate
${pkgs.git}/bin/git -C /var/lib/yate remote add origin forgejo@git.hamburg.ccc.de:echtnurich/yate-config.git
${pkgs.git}/bin/git -C /var/lib/yate pull -f --set-upstream
echo \"New repo set up.\"
fi
${pkgs.git}/bin/git -C /var/lib/yate fetch --all
${pkgs.git}/bin/git -C /var/lib/yate checkout --track -f origin/master";
2024-06-08 22:18:23 +02:00
# ...
};
}