chore: drop taskwarrior related things

This commit is contained in:
Malte Tammena 2023-11-18 11:17:34 +01:00
parent 08a5a3f565
commit bb2fa263a0
8 changed files with 2 additions and 266 deletions

View file

@ -1,8 +1,4 @@
{
timewarrior = {
version = "v1.4.3";
hash = "sha256-+HsUiU287bWZ5Ytl+N5i+STuG9YlqlaKWxd69y0PRds=";
};
"2i-emulator" = {
rev = "dbd022b";
hash = "sha256-zQdnDZwFd7KkSoLyu3Ty/YDn7qosTIf2n02PHitGf2g=";

View file

@ -23,7 +23,6 @@ in {
./deck.nix
./radicale.nix
./restic.nix
./taskserver.nix
./wakeup.nix
./state.nix
];

View file

@ -71,15 +71,6 @@ in {
radicale-password = {
inherit sopsFile owner mode;
};
taskserver-private-key = {
inherit sopsFile owner mode;
};
taskserver-certificate = {
inherit sopsFile owner mode;
};
taskserver-ca-certificate = {
inherit sopsFile owner mode;
};
pw-mail-pm = {
inherit sopsFile owner mode;
};

View file

@ -1,27 +0,0 @@
{
lib,
config,
...
}: let
cfg = config.services.taskserverConfigured;
in {
options.services.taskserverConfigured = with lib; {
enable = mkEnableOption "Enable configured taskserver";
dataDir = mkOption {
type = types.str;
description = "Folder to use for storage";
};
};
config = {
services.taskserver = lib.mkIf cfg.enable {
inherit (cfg) dataDir enable;
fqdn = "elysia-clarki";
debug = true;
listenHost = "0.0.0.0";
organisations.default = {
users = ["malte"];
};
};
};
}

View file

@ -53,7 +53,6 @@ in {
./mail.nix
./pass.nix
./zathura.nix
./taskwarrior.nix
./scarlett-solo.nix
./helix.nix
./mpv.nix
@ -69,7 +68,6 @@ in {
config = {
settings.hyprland.enable = true;
settings.mail.enable = true;
settings.taskwarrior.enable = true;
# Define my color schemes
colorsLight = nix-colors.colorSchemes."gruvbox-light-medium";
@ -175,11 +173,9 @@ in {
"/home/malte/Documents"
"/home/malte/Lieder"
"/home/malte/Pictures"
"/home/malte/Tasks"
"/home/malte/Uni"
"/home/malte/helden"
"/home/malte/ledger"
"/home/malte/timewarrior"
"/home/malte/vimwiki"
"/home/malte/.local/share/cataclysm-dda"
];

View file

@ -55,12 +55,6 @@ in {
dev = "nix develop -c fish";
nix-todo = "task add project:nixos +computer";
uni-todo = "task add project:studium +uni";
note = "task add +unsorted project:unsorted prio:H";
today = "task +heute";
neu = "task rc.report.next.context=0 +neu next";
genpw = "xkcdpass -n4";
zat = "zathura --fork";

View file

@ -1,173 +0,0 @@
{
pkgs,
lib,
config,
nixosConfig,
...
}: let
# Data storage location for taskwarrior
dataLocation = "/home/malte/Tasks";
# A usable (with dateutil) python interpreter for timewarrior's totals.py extension
pythonWithLibs = pkgs.python3.withPackages (ps: [ps.dateutil]);
# This is a patched version of the upstream `totals.py` script
# so sum up timewarrior stats
# This just patches the first line to use a python interpreter that has
# `dateutil` available!
timewarriorExtensions = let
hashes = (builtins.import ../../hashes.nix).timewarrior;
in
pkgs.stdenvNoCC.mkDerivation {
name = "timewarrior-totals";
inherit (hashes) version;
src = pkgs.fetchFromGitHub {
owner = "GothenburgBitFactory";
repo = "timewarrior";
rev = hashes.version;
inherit (hashes) hash;
};
buildInputs = [pkgs.coreutils];
propagatedBuildInputs = [pythonWithLibs];
phases = ["unpackPhase" "patchPhase" "installPhase"];
patchPhase = ''
sed -i 's|^#!/usr/bin/env python3$|#!${pythonWithLibs}/bin/python3|' \
ext/totals.py \
ext/on-modify.timewarrior
'';
installPhase = ''
mkdir -p $out
cp ext/totals.py ext/on-modify.timewarrior $out/
'';
};
# Color scheme used for taskwarrior
taskwarriorColors = pkgs.writeText "colors.rc" ''
# General decoration
color.label=white
color.label.sort=bold
color.alternate=
color.footnote=green
color.error=red
# Status
color.completed=gray8
color.deleted=rgb335
color.blocked=gray12
color.blocking=blue
color.active=black on cyan
color.scheduled=bold black on blue
# Tags
color.tag.irgendwann=gray16
color.tag.extern=gray20
color.tag.github=magenta
color.tag.unsorted=black on yellow
# Projects
color.project.nixos=green
color.project.unsorted=black on yellow
# Priority
color.uda.priority.H=bold yellow
color.uda.priority.M=yellow
color.uda.priority.L=gray20
# Due
color.due=red
color.due.today=bold red
color.overdue=bold black on red
# Report: summary
color.summary.background=on yellow
color.summary.bar=color0 on cyan
# Report: burndown
color.burndown.done=on cyan
color.burndown.pending=on red
color.burndown.started=on yellow
# Report: history
color.history.add=black on yellow
color.history.delete=black on red
color.history.done=black on cyan
# Command: undo
color.undo.after=cyan
color.undo.before=red
# Command: calendar
color.calendar.due=black on red
color.calendar.due.today=black on red
color.calendar.holiday=green
color.calendar.overdue=black on magenta
color.calendar.today=black on cyan
color.calendar.weekend=yellow
color.calendar.weeknumber=gray6
color.calendar.scheduled=black on white
# Command: sync
color.sync.added=cyan
color.sync.changed=yellow
color.sync.rejected=red
# Remove some defaults
color.tagged=
color.tag.next=
color.recurring=
'';
cfg = config.settings.taskwarrior;
in {
options.settings.taskwarrior.enable = lib.mkEnableOption "taskwarrior related stuff";
config = lib.mkIf cfg.enable {
# Install timewarrior aswell!
# Timewarrior hook needs Python3.. or a patch.. to lazy for the latter
home.packages = with pkgs; [timewarrior python3];
programs.taskwarrior = {
inherit dataLocation;
enable = true;
colorTheme = taskwarriorColors;
config = {
include = "${pkgs.taskwarrior}/share/doc/task/rc/holidays.de-DE.rc";
urgency.user.tag = {
irgendwann.coefficient = "-100.0";
extern.coefficient = "-50.0";
};
dateformat = "D.M.Y H:N";
fontunderline = false;
rule.precedence.color = "rule.precedence.color=deleted,completed,active,tag.unsorted,project.unsorted,keyword.,tag.,project.,overdue,scheduled,due.today,due,blocked,blocking,recurring,tagged,uda.";
weekstart = "Monday";
calendar.holidays = "sparse";
uda.reviewed = {
type = "date";
label = "Reviewed";
};
report._reviewed = {
description = "Tasksh review report. Adjust the filter to your needs.";
columns = "uuid";
sort = "reviewed+,modified+";
filter = "( reviewed.none: or reviewed.before:now-6days ) and ( +PENDING )";
};
taskd = {
certificate = nixosConfig.sops.secrets.taskserver-certificate.path;
key = nixosConfig.sops.secrets.taskserver-private-key.path;
ca = nixosConfig.sops.secrets.taskserver-ca-certificate.path;
server = "inthe.am:53589";
credentials = "inthe_am/malte.tammena/63b57bb7-f23e-440c-bd9f-658efa1e194d";
trust = "strict";
};
context = {
work = {
read = "+work";
write = "+work";
};
uni = {
read = "+uni";
write = "+uni";
};
home = {
read = "-uni -work";
write = "";
};
};
};
};
services.taskwarrior-sync = {
enable = true;
};
home.file.".timewarrior/extensions/totals.py".source = "${timewarriorExtensions}/totals.py";
home.file."${dataLocation}/hooks/on-modify-timewarrior" = {
source = "${timewarriorExtensions}/on-modify.timewarrior";
executable = true;
};
};
}

View file

@ -8,39 +8,6 @@
mkBorder = hex: ((config.myLib.mkColor hex).darker 0.4).hashRgb;
col = config.colorsDark.colors;
task-activity = with pkgs; let
task = "${pkgs.taskwarrior}/bin/task";
jq = "${pkgs.jq}/bin/jq";
timew = "${pkgs.timewarrior}/bin/timew";
getTaskwarriorDesc = "${task} +ACTIVE export | ${jq} '.[0].description'";
getTimewarriorDesc = "${timew} get dom.active.json | ${jq} '.tags|join(\", \")'";
in
writeScriptBin "task-activity" ''
#!${stdenv.shell}
task +ACTIVE >/dev/null 2>/dev/null
if [[ $? -eq 0 ]]; then
# taskwarrior is running
echo "{ \"text\": \" \", \
\"tooltip\": $(${getTaskwarriorDesc}) \
}" | ${jq} --unbuffered --compact-output
exit 0
fi
if [[ $(${timew} get dom.active) -eq 1 ]]; then
# Timew is running but taskwarrior is not
echo "{ \"text\": \" \", \
\"tooltip\": $(${getTimewarriorDesc}) \
}" | ${jq} --unbuffered --compact-output
exit 0
fi
# Nothing is running
echo "{ \"text\": \"\", \
\"tooltip\": \"\" \
}" | ${jq} --unbuffered --compact-output
'';
doNotDisturbJson = pkgs.writeShellApplication {
name = "do-not-disturb-json";
runtimeInputs = [
@ -102,7 +69,7 @@
fi
'';
in {
home.packages = [pkgs.hackNerdLigatures task-activity];
home.packages = [pkgs.hackNerdLigatures];
programs.waybar = {
enable = true;
@ -115,7 +82,7 @@ in {
modules-left = ["hyprland/workspaces" "hyprland/window"];
modules-center = ["clock#time" "custom/check-system" "clock#date"];
modules-right =
["custom/do-not-disturb" "custom/taskwarrior" "custom/new-mail" "network"]
["custom/do-not-disturb" "custom/new-mail" "network"]
++ (lib.optional nixosConfig.settings.batteryStuff.enable "battery")
++ ["tray"];
@ -147,11 +114,6 @@ in {
return-type = "json";
interval = 1;
};
"custom/taskwarrior" = {
exec = "${task-activity}/bin/task-activity";
return-type = "json";
interval = 1;
};
"custom/new-mail" = {
exec = "${new-mail}/bin/new-mail";
return-type = "json";
@ -267,7 +229,6 @@ in {
#battery,
#network,
#mode,
#custom-taskwarrior,
#custom-do-not-disturb,
#custom-new-mail,
#custom-check-system {
@ -275,7 +236,6 @@ in {
color: @base05;
}
#custom-taskwarrior,
#custom-do-not-disturb,
#custom-new-mail {
padding: 0px 10px 0px 13px;