nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at devShellTools-shell 67 lines 1.3 kB view raw
1{ 2 stdenv, 3 lib, 4 ruby_3_4, 5 bundlerEnv, 6 bundlerApp, 7 bundlerUpdateScript, 8 installShellFiles, 9}: 10 11let 12 ttBundlerApp = (bundlerApp.override { ruby = ruby_3_4; }) { 13 pname = "timetrap"; 14 gemdir = ./.; 15 exes = [ 16 "t" 17 "timetrap" 18 ]; 19 20 passthru.updateScript = bundlerUpdateScript "timetrap"; 21 }; 22 23 ttGem = (bundlerEnv.override { ruby = ruby_3_4; }) { 24 pname = "timetrap"; 25 gemdir = ./.; 26 }; 27 28in 29 30stdenv.mkDerivation { 31 name = "timetrap"; 32 33 dontUnpack = true; 34 35 nativeBuildInputs = [ installShellFiles ]; 36 37 installPhase = '' 38 mkdir $out 39 cd $out 40 41 mkdir bin; pushd bin 42 ln -vs ${ttBundlerApp}/bin/t 43 ln -vs ${ttBundlerApp}/bin/timetrap 44 popd 45 46 for c in t timetrap; do 47 installShellCompletion --cmd $c --bash ${ttGem}/lib/ruby/gems/*/gems/timetrap*/completions/bash/* 48 installShellCompletion --cmd $c --zsh ${ttGem}/lib/ruby/gems/*/gems/timetrap*/completions/zsh/* 49 done 50 ''; 51 52 meta = with lib; { 53 description = "Simple command line time tracker written in ruby"; 54 homepage = "https://github.com/samg/timetrap"; 55 license = licenses.mit; 56 maintainers = with maintainers; [ 57 jerith666 58 manveru 59 nicknovitski 60 ]; 61 platforms = platforms.unix; 62 }; 63 64 passthru = { 65 updateScript = ttBundlerApp.passthru.updateScript; 66 }; 67}