tagtime: init at 2018-09-02

The original perl implementation of tagtime.

I packaged it to the point of being able to use it on my system, in a
very barebones state.
The configuration is … well it just assumes you have a perl file
somewhere and it evals it at startup. Since that configuration needs
access to the distpath of tagtime, we just patch it a bit for
now (which also means no user configuration is possible atm).

The main changes to the config are:

- instead of defaulting to `vim`, we use `$EDITOR`
- The log file is placed in `$HOME/.local/share/tagtime/pings.log`
(which corresponds to `$XDG_DATA_HOME` on normal unix systems), but
could be patched to use the real logic instead.

+81
+79
pkgs/applications/misc/tagtime/default.nix
··· 1 + { lib, stdenv, fetchFromGitHub, perl, xterm, coreutils }: 2 + 3 + stdenv.mkDerivation { 4 + pname = "tagtime"; 5 + version = "2018-09-02"; 6 + 7 + src = fetchFromGitHub { 8 + owner = "tagtime"; 9 + repo = "TagTime"; 10 + rev = "59343e2cbe451eb16109e782c194ccbd0ee4196d"; 11 + sha256 = "1xpmra3f9618b0gajfxqh061r4phkiklvcgpglsyx82bhmgf9n1f"; 12 + }; 13 + 14 + buildInputs = [ 15 + perl 16 + ]; 17 + 18 + installPhase = '' 19 + runHook preInstall 20 + 21 + mkdir -p $out/{libexec,bin} 22 + 23 + # We don’t support a config file for now, 24 + # since it’s not entirely clear how to split nix-set paths 25 + # from the actual config options. 26 + for pl in *.pl; do 27 + substituteInPlace "$pl" \ 28 + --replace 'require "$ENV{HOME}/.tagtimerc";' \ 29 + 'require "${placeholder "out"}/libexec/settings.pl";' 30 + done; 31 + 32 + install tagtimed.pl $out/bin/tagtimed 33 + 34 + substituteInPlace util.pl \ 35 + --replace '/usr/bin/touch' \ 36 + '${coreutils}/bin/touch' \ 37 + --replace '/bin/rm -f $lockf' \ 38 + '${coreutils}/bin/rm -f $lockf' \ 39 + --replace '$lockf = "''${path}tagtime.lock";' \ 40 + 'mkdir "$ENV{HOME}/.cache/tagtime"; 41 + $lockf = "$ENV{HOME}/.cache/tagtime/tagtime.lock";' 42 + 43 + mv *.pl $out/libexec/ 44 + mv template.tsk $out/libexec/ 45 + 46 + 47 + # set the default template arguments to sane defaults. 48 + substitute settings.pl.template $out/libexec/settings.pl \ 49 + --replace '"__USER__"' \ 50 + 'getlogin()' \ 51 + --replace '"__PATH__"' \ 52 + '"${placeholder "out"}/libexec/"' \ 53 + --replace '$logf = "$path$usr.log";' \ 54 + 'mkdir "$ENV{HOME}/.local/share/tagtime"; 55 + $logf = "$ENV{HOME}/.local/share/tagtime/pings.log";' \ 56 + --replace '"__ED__ +"' \ 57 + '$ENV{"EDITOR"}' \ 58 + --replace '"__XT__"' \ 59 + '"${xterm}/bin/xterm"' 60 + 61 + runHook postInstall 62 + ''; 63 + 64 + meta = { 65 + description = "Stochastic Time Tracking for Space Cadets"; 66 + longDescription = '' 67 + To determine how you spend your time, TagTime literally randomly samples 68 + you. At random times it pops up and asks what you're doing right at that 69 + moment. You answer with tags. 70 + 71 + See https://messymatters.com/tagtime for the whole story. 72 + 73 + [maintainer’s note]: This is the original perl script implementation. 74 + ''; 75 + homepage = "http://messymatters.com/tagtime/"; 76 + license = lib.licenses.bsd3; 77 + maintainers = [ lib.maintainers.Profpatsch ]; 78 + }; 79 + }
+2
pkgs/top-level/all-packages.nix
··· 10048 10048 inherit (darwin.apple_sdk.frameworks) IOKit; 10049 10049 }; 10050 10050 10051 + tagtime = callPackage ../applications/misc/tagtime { }; 10052 + 10051 10053 inherit (callPackages ../applications/networking/taler { }) 10052 10054 taler-exchange taler-merchant; 10053 10055