depot/third_party/nixpkgs/pkgs/applications/office/timetrap/default.nix
Default email bcb2f287e1 Project import generated by Copybara.
GitOrigin-RevId: d603719ec6e294f034936c0d0dc06f689d91b6c3
2024-06-20 20:27:18 +05:30

55 lines
1.1 KiB
Nix

{ stdenv
, lib
, pkgs
, bundlerEnv
, bundlerApp
, bundlerUpdateScript
, installShellFiles
}:
let
ttBundlerApp = bundlerApp {
pname = "timetrap";
gemdir = ./.;
exes = [ "t" "timetrap" ];
passthru.updateScript = bundlerUpdateScript "timetrap";
};
ttGem = bundlerEnv {
pname = "timetrap";
gemdir = ./.;
};
in
stdenv.mkDerivation {
name = "timetrap";
dontUnpack = true;
nativeBuildInputs = [ installShellFiles ];
installPhase = ''
mkdir $out;
cd $out;
mkdir bin; pushd bin;
ln -vs ${ttBundlerApp}/bin/t;
ln -vs ${ttBundlerApp}/bin/timetrap;
popd;
for c in t timetrap; do
installShellCompletion --cmd $c --bash ${ttGem}/lib/ruby/gems/*/gems/timetrap*/completions/bash/*;
installShellCompletion --cmd $c --zsh ${ttGem}/lib/ruby/gems/*/gems/timetrap*/completions/zsh/*;
done;
'';
meta = with lib; {
description = "Simple command line time tracker written in ruby";
homepage = "https://github.com/samg/timetrap";
license = licenses.mit;
maintainers = with maintainers; [ jerith666 manveru nicknovitski ];
platforms = platforms.unix;
};
}