1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 rustPlatform,
6 pkg-config,
7 openssl,
8 installShellFiles,
9 curl,
10}:
11
12rustPlatform.buildRustPackage rec {
13 pname = "sheldon";
14 version = "0.8.5";
15
16 src = fetchFromGitHub {
17 owner = "rossmacarthur";
18 repo = "sheldon";
19 rev = version;
20 hash = "sha256-zVwqVYaUY8LJhWENDiD89p/CzvsEVkpaPnYVyCJUf3s=";
21 };
22
23 cargoHash = "sha256-4TDDNqlcs7LTmL9uHBjE8SHft38juUJUj8sLCimnTyc=";
24
25 buildInputs = [
26 openssl
27 ]
28 ++ lib.optionals stdenv.hostPlatform.isDarwin [
29 curl
30 ];
31 nativeBuildInputs = [
32 installShellFiles
33 pkg-config
34 ];
35
36 # Needs network connection
37 checkFlags = [
38 "--skip lock::plugin::tests::external_plugin_lock_git_with_matches"
39 "--skip lock::plugin::tests::external_plugin_lock_git_with_matches_not_each"
40 "--skip lock::plugin::tests::external_plugin_lock_git_with_uses"
41 "--skip lock::plugin::tests::external_plugin_lock_remote"
42 "--skip lock::source::git::tests::git_checkout_resolve_branch"
43 "--skip lock::source::git::tests::git_checkout_resolve_rev"
44 "--skip lock::source::git::tests::git_checkout_resolve_tag"
45 "--skip lock::source::git::tests::lock_git_and_reinstall"
46 "--skip lock::source::git::tests::lock_git_https_with_checkout"
47 "--skip lock::source::local::tests::lock_local"
48 "--skip lock::source::remote::tests::lock_remote_and_reinstall"
49 "--skip lock::source::tests::lock_with_git"
50 "--skip lock::source::tests::lock_with_remote"
51 "--skip lock::tests::locked_config_clean"
52 "--skip directories_default"
53 "--skip directories_old"
54 "--skip directories_xdg_from_env"
55 "--skip lock_and_source_github"
56 "--skip lock_and_source_hooks"
57 "--skip lock_and_source_inline"
58 "--skip lock_and_source_profiles"
59 ];
60
61 postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
62 installShellCompletion --cmd sheldon \
63 --bash <($out/bin/sheldon completions --shell bash) \
64 --zsh <($out/bin/sheldon completions --shell zsh)
65 '';
66
67 meta = with lib; {
68 description = "Fast and configurable shell plugin manager";
69 homepage = "https://github.com/rossmacarthur/sheldon";
70 license = with licenses; [ mit ];
71 maintainers = with maintainers; [ seqizz ];
72 platforms = platforms.unix;
73 mainProgram = "sheldon";
74 };
75}