mirror of
https://github.com/nmasur/dotfiles
synced 2024-11-09 23:22:57 +00:00
automatically fetch notes
This commit is contained in:
parent
c338ff5579
commit
1865f6985e
@ -1,4 +1,10 @@
|
|||||||
{ config, ... }: {
|
{
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
{
|
||||||
|
|
||||||
# This is just a placeholder as I expect to interact with my notes in a
|
# This is just a placeholder as I expect to interact with my notes in a
|
||||||
# certain location
|
# certain location
|
||||||
@ -9,6 +15,22 @@
|
|||||||
NOTES_PATH = "${config.homePath}/dev/personal/notes/content";
|
NOTES_PATH = "${config.homePath}/dev/personal/notes/content";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# Sync notes for Nextcloud automatically
|
||||||
|
systemd.user.timers.refresh-notes = lib.mkIf config.services.nextcloud.enable {
|
||||||
|
Timer = {
|
||||||
|
OnCalendar = "*-*-* *:0/10:50"; # Every 10 minutes
|
||||||
|
Unit = "refresh-notes.service";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
systemd.user.services.refresh-notes = {
|
||||||
|
Unit.Description = "Get latest notes.";
|
||||||
|
Service = {
|
||||||
|
Type = "oneshot";
|
||||||
|
ExecStartPre = "${pkgs.git}/bin/git -C /data/git/notes reset --hard master";
|
||||||
|
ExecStart = "${pkgs.git}/bin/git -C /data/git/notes pull";
|
||||||
|
WorkingDirectory = config.homePath;
|
||||||
|
Environment = "PATH=${pkgs.openssh}/bin";
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user