about summary refs log tree commit diff
path: root/pkgs/tools/misc/sheldon/default.nix
blob: cf48868097b54c9801b8a5d0e6b86bdfa7aec8c5 (plain) (blame)
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
55
56
57
58
59
60
61
62
63
64
65
66
67
{ lib
, stdenv
, fetchFromGitHub
, rustPlatform
, pkg-config
, openssl
, installShellFiles
, Security
, curl
}:

rustPlatform.buildRustPackage rec {
  pname = "sheldon";
  version = "0.8.0";

  src = fetchFromGitHub {
    owner = "rossmacarthur";
    repo = pname;
    rev = version;
    hash = "sha256-eyfIPO1yXvb+0SeAx+F6/z5iDUA2GfWOiElfjn6abJM=";
  };

  cargoHash = "sha256-+yTX1wUfVVjsM42X0QliL+0xbzTPheADZibPh/5Czh8=";

  buildInputs = [ openssl ] ++ lib.optionals stdenv.isDarwin [ Security curl ];
  nativeBuildInputs = [ installShellFiles pkg-config ];

  # Needs network connection
  checkFlags = [
    "--skip lock::plugin::tests::external_plugin_lock_git_with_matches"
    "--skip lock::plugin::tests::external_plugin_lock_git_with_matches_not_each"
    "--skip lock::plugin::tests::external_plugin_lock_git_with_uses"
    "--skip lock::plugin::tests::external_plugin_lock_remote"
    "--skip lock::source::git::tests::git_checkout_resolve_branch"
    "--skip lock::source::git::tests::git_checkout_resolve_rev"
    "--skip lock::source::git::tests::git_checkout_resolve_tag"
    "--skip lock::source::git::tests::lock_git_and_reinstall"
    "--skip lock::source::git::tests::lock_git_https_with_checkout"
    "--skip lock::source::local::tests::lock_local"
    "--skip lock::source::remote::tests::lock_remote_and_reinstall"
    "--skip lock::source::tests::lock_with_git"
    "--skip lock::source::tests::lock_with_remote"
    "--skip lock::tests::locked_config_clean"
    "--skip directories_default"
    "--skip directories_old"
    "--skip directories_xdg_from_env"
    "--skip lock_and_source_github"
    "--skip lock_and_source_hooks"
    "--skip lock_and_source_inline"
    "--skip lock_and_source_profiles"
  ];

  postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
    installShellCompletion --cmd sheldon \
      --bash <($out/bin/sheldon completions --shell bash) \
      --zsh <($out/bin/sheldon completions --shell zsh)
  '';

  meta = with lib; {
    description = "Fast and configurable shell plugin manager";
    homepage = "https://github.com/rossmacarthur/sheldon";
    license = with licenses; [ mit ];
    maintainers = with maintainers; [ seqizz ];
    platforms = platforms.unix;
    mainProgram = "sheldon";
  };
}