1{
2 lib,
3 rustPlatform,
4 fetchFromGitHub,
5 installShellFiles,
6 stdenv,
7}:
8let
9 version = "0.15.2";
10in
11rustPlatform.buildRustPackage {
12 pname = "pace";
13 inherit version;
14
15 src = fetchFromGitHub {
16 owner = "pace-rs";
17 repo = "pace";
18 tag = "pace-rs-v${version}";
19 hash = "sha256-gyyf4GGHIEdiAWvzKbaOApFikoh3RLWBCZUfJ0MjbIE=";
20 };
21
22 cargoHash = "sha256-BuAVwILZCU6+/IBesyK4ZiefNmju49aFPyTcUUT1se8=";
23
24 nativeBuildInputs = [ installShellFiles ];
25
26 postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
27 installShellCompletion --cmd pace \
28 --bash <($out/bin/pace setup completions bash) \
29 --fish <($out/bin/pace setup completions fish) \
30 --zsh <($out/bin/pace setup completions zsh)
31 '';
32
33 meta = {
34 description = "Command-line program for mindful time tracking";
35 homepage = "https://github.com/pace-rs/pace";
36 license = lib.licenses.agpl3Only;
37 maintainers = with lib.maintainers; [ isabelroses ];
38 mainProgram = "pace";
39 };
40}