1
0
mirror of https://github.com/kmein/niveum synced 2026-03-17 18:41:09 +01:00
Files
niveum/configs/todo-txt.nix
2020-01-03 12:01:32 +01:00

24 lines
650 B
Nix

{ pkgs, ... }:
let
get-todo-dir = pkgs.writers.writeDash "git-toplevel-todo" ''
if GIT_TOPLEVEL=$(${pkgs.git}/bin/git rev-parse --show-toplevel); then
echo "$GIT_TOPLEVEL/.todo"
else
echo "$HOME/cloud/Dropbox/todo"
fi
'';
todo-txt-config = pkgs.writeText "todo.cfg" ''
export TODO_DIR="$(${get-todo-dir})"
export TODO_FILE="$TODO_DIR/todo.txt"
export DONE_FILE="$TODO_DIR/done.txt"
export REPORT_FILE="$TODO_DIR/report.txt"
'';
in {
environment = {
systemPackages = [ pkgs.todo-txt-cli ];
shellAliases.t = "todo.sh -d ${todo-txt-config}";
variables.TODOTXT_DEFAULT_ACTION = "ls";
};
}