From 10679db066d61322e5d8c0ba31de41116003fa13 Mon Sep 17 00:00:00 2001 From: Dmitriy Pleshevskiy Date: Thu, 18 Apr 2024 10:43:23 +0300 Subject: [PATCH] host/tatos: add cronjobs to update routes --- hosts/tatos/services/wireguard/default.nix | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/hosts/tatos/services/wireguard/default.nix b/hosts/tatos/services/wireguard/default.nix index 3d54ab4..ad369df 100644 --- a/hosts/tatos/services/wireguard/default.nix +++ b/hosts/tatos/services/wireguard/default.nix @@ -1,4 +1,4 @@ -{ config, pkgs, lib, ... }: +{ config, pkgs, ... }: # Source: https://habr.com/ru/companies/xakep/articles/699000/ @@ -21,7 +21,14 @@ in internalInterfaces = [ "wg0" ]; }; - environment.systemPackages = [ update_ru_routes ]; + services.cron = { + enable = true; + systemCronJobs = let cmd = "${update_ru_routes}/bin/update_ru_routes > /root/update_routes.log 2>&1"; in [ + "@reboot sleep 30 && ${cmd}" + "0 3 * * mon ${cmd}" + ]; + }; + networking.wg-quick.interfaces = { # "wg0" is the network interface name. You can name the interface arbitrarily.