{ prev, ... }: {
  worktime = prev.stdenv.mkDerivation rec {
    name = "worktime";
    src = ./worktime.py;

    phases = [ "buildPhase" "checkPhase" "installPhase" ];

    python = prev.python39.withPackages (ps: with ps; [pyxdg dateutil uritools requests configparser tabulate]);
    buildInputs = [ python ];

    buildPhase = ''
      substituteAll $src worktime
    '';

    doCheck = true;
    checkPhase = ''
      python -m py_compile worktime
    '';

    installPhase = ''
      install -m 0755 -D -t $out/bin \
        worktime
    '';
  };
}