mirror of
https://github.com/daylinmorgan/oizys.git
synced 2024-11-05 01:53:15 -06:00
35 lines
911 B
Nix
35 lines
911 B
Nix
{ pkgs, ... }:
|
|
let
|
|
notes-git = ''${pkgs.git}/bin/git -C /home/daylin/stuff/notes'';
|
|
in
|
|
{
|
|
services.restic.backups.gdrive = {
|
|
user = "daylin";
|
|
repository = "rclone:g:archives/othalan";
|
|
passwordFile = "/home/daylin/.config/restic/othalan-pass";
|
|
paths = [
|
|
"/home/daylin/stuff/"
|
|
"/home/daylin/dev/"
|
|
];
|
|
};
|
|
|
|
systemd.services.notes-bot = {
|
|
description = "auto commit changes to notes";
|
|
serviceConfig = {
|
|
Type = "oneshot";
|
|
User = "daylin";
|
|
ExecStart = ''
|
|
${pkgs.bash}/bin/bash -c '${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";
|
|
};
|
|
};
|
|
}
|