Add tasksync
This commit is contained in:
parent
dca3279a80
commit
7bc1ba6ec1
1 changed files with 29 additions and 2 deletions
|
@ -1,10 +1,37 @@
|
||||||
{ lib, pkgs, config, ...}:
|
{ lib, pkgs, config, ...}:
|
||||||
with lib;
|
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";
|
options.m-0.taskwarrior.enable = mkEnableOption "Taskwarrior";
|
||||||
config = mkIf config.m-0.taskwarrior.enable {
|
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 = {
|
home = {
|
||||||
packages = [ pkgs.taskwarrior ];
|
packages = [ pkgs.taskwarrior tasksync ];
|
||||||
file = {
|
file = {
|
||||||
".taskrc".text = ''
|
".taskrc".text = ''
|
||||||
data.location=~/.task
|
data.location=~/.task
|
||||||
|
|
Loading…
Reference in a new issue