From 57c6c0ac0abd5e1d67f1d037b62abfa6ac0c9d95 Mon Sep 17 00:00:00 2001 From: Daylin Morgan Date: Wed, 21 Feb 2024 14:26:47 -0600 Subject: [PATCH] add systemd service to autocommit notes --- hosts/othalan/services.nix | 21 +++++++++++++++++++++ modules/desktop/gui.nix | 2 +- 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 hosts/othalan/services.nix diff --git a/hosts/othalan/services.nix b/hosts/othalan/services.nix new file mode 100644 index 0000000..3f70cd0 --- /dev/null +++ b/hosts/othalan/services.nix @@ -0,0 +1,21 @@ +{pkgs, ...}: let + notes-git = ''${pkgs.git}/bin/git -C /home/daylin/stuff/notes''; +in { + systemd.services.notes-bot = { + description = "auto commit changes to notes"; + serviceConfig = { + Type = "oneshot"; + User = "daylin"; + ExecStart = ''${notes-git} commit -m ":memo: :robot: $(${pkgs.coreutils}/bin/date +'%T')" --no-gpg-sign -- notes''; + }; + }; + systemd.timers.notes-bot-timer = { + description = "run notes commit service"; + wantedBy = ["timers.target"]; + timerConfig = { + OnCalendar = "daily"; + Persistent = true; + Unit = "notes-bot.service"; + }; + }; +} diff --git a/modules/desktop/gui.nix b/modules/desktop/gui.nix index 26bd652..f95dc12 100644 --- a/modules/desktop/gui.nix +++ b/modules/desktop/gui.nix @@ -26,6 +26,6 @@ in { ]; proprietaryCodecs = true; }) - ]; + ]; }; }