From 8aa77958b36da49bbc854cefc239b740916550c8 Mon Sep 17 00:00:00 2001 From: Dmitry Voronin Date: Thu, 22 Feb 2024 14:43:24 +0300 Subject: [PATCH] Dotfiles : Add a timer to sync daily. --- .config/linux/system/module/common/Dotfiles.nix | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.config/linux/system/module/common/Dotfiles.nix b/.config/linux/system/module/common/Dotfiles.nix index dcd569d..7770f7b 100644 --- a/.config/linux/system/module/common/Dotfiles.nix +++ b/.config/linux/system/module/common/Dotfiles.nix @@ -28,9 +28,23 @@ ${pkgs.git}/bin/git pull ''; }; + timer = { + timerConfig = { + OnCalendar = "daily"; + Unit = "dotfiles.service"; + }; + wantedBy = [ "timers.target" ]; + }; dotsSource = inputs.dotfiles; in { + # Service. systemd.user.services.dotfiles = unit; systemd.services.dotfiles = unit; + + # Sync timer. + systemd.timers.dotfiles = timer; + systemd.user.timers.dotfiles = timer; + + # Link copy to /etc/dotfiles environment.etc.dotfiles.source = dotsSource; }