1
0
Fork 0

Add tasksync

This commit is contained in:
Malte Brandy 2018-07-27 18:16:46 +02:00
parent dca3279a80
commit 7bc1ba6ec1
No known key found for this signature in database
GPG key ID: 226A2D41EF5378C9

View file

@ -1,10 +1,37 @@
{ lib, pkgs, config, ...}:
with lib;
{
let
tasksync = pkgs.writeShellScriptBin "tasksync" ''
cd ${config.home.homeDirectory}/.task
${pkgs.git}/bin/git add completed.data pending.data
${pkgs.git}/bin/git commit -m 'Updating task data'
${pkgs.git}/bin/git pull -r
${pkgs.git}/bin/git push
'';
in {
options.m-0.taskwarrior.enable = mkEnableOption "Taskwarrior";
config = mkIf config.m-0.taskwarrior.enable {
systemd.user = {
services.tasksync = {
Unit = {
Description = "Update tasks";
};
Service = {
ExecStart="/bin/sh ${tasksync}/bin/tasksync";
Type="oneshot";
};
};
timers.tasksync = {
Timer = {
OnCalendar = "*:0/5";
};
Install = {
WantedBy = [ "timers.target" ];
};
};
};
home = {
packages = [ pkgs.taskwarrior ];
packages = [ pkgs.taskwarrior tasksync ];
file = {
".taskrc".text = ''
data.location=~/.task