nix-git/hosts/yodaNas/host-specific.nix

40 lines
993 B
Nix
Raw Normal View History

{ config, pkgs, ... }:
{
2023-11-20 14:09:10 +01:00
yoda.de-p1st-monitor = (builtins.readFile ../../assets/de-p1st-monitor/yodaNas.ini);
# Update and start Jinja-Compose project
# during boot and after every 30 minutes.
# To view the log, run
# journalctl -b -u Jinja-Compose -f
#
systemd.timers."Jinja-Compose" = {
wantedBy = [ "timers.target" ];
partOf = [ "Jinja-Compose.service" ];
timerConfig = {
OnBootSec = "0m";
OnUnitInactiveSec = "30m";
AccuracySec = "1m";
RandomizedDelaySec = "1m";
};
};
systemd.services."Jinja-Compose" = {
description = "Update and start Jinja-Compose project";
serviceConfig = {
Type = "oneshot";
PrivateTmp = true;
User = "root";
};
path = with pkgs; [
# The `docker-compose` helper script is written in `bash` (!)
bash
docker
];
script = ''
2023-10-08 15:38:44 +02:00
set -eu -o pipefail
2023-10-09 19:02:16 +02:00
/jc-config/docker-compose pull
/jc-config/docker-compose up -d --wait
'';
};
}