summaryrefslogtreecommitdiffstats
path: root/pkgs/by-name/ju/jump/package.nix
blob: eb080e8c11a5bbb38a535bb1acffb7d87eecd7e9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
{
  buildGoModule,
  fetchFromGitHub,
  lib,
  installShellFiles,
  stdenv,
  writableTmpDirAsHomeHook,
}:
buildGoModule (finalAttrs: {
  pname = "jump";
  version = "0.67.0";

  src = fetchFromGitHub {
    owner = "gsamokovarov";
    repo = "jump";
    rev = "v${finalAttrs.version}";
    hash = "sha256-/vMQIbpfnEzBhyCUgSd4XpeC9cEX/+AYIRDTOqgmCec=";
  };

  vendorHash = "sha256-nMUqZWdq//q/DNthvpKiYLq8f95O0QoItyX5w4vHzSA=";

  nativeBuildInputs = [
    installShellFiles
    writableTmpDirAsHomeHook
  ];

  ldflags = [
    "-s"
    "-w"
  ];

  postInstall = ''
    installManPage man/j.1 man/jump.1
  ''
  + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
    installShellCompletion --cmd jump \
       --bash <($out/bin/jump shell bash) \
       --fish <($out/bin/jump shell fish) \
       --zsh <($out/bin/jump shell zsh)
  '';

  meta = {
    description = "Navigate directories faster by learning your habits";
    longDescription = ''
      Jump integrates with the shell and learns about your
      navigational habits by keeping track of the directories you visit. It
      strives to give you the best directory for the shortest search term.
    '';
    homepage = "https://github.com/gsamokovarov/jump";
    license = lib.licenses.mit;
    maintainers = [ ];
    mainProgram = "jump";
  };
})