12 rustPlatform.buildRustPackage rec {
16 src = fetchFromGitHub {
20 sha256 = "sha256-4rFtbCfx6QFdp62FPjOYAhSWM03g3rXsF4pD22+EhcA=";
23 cargoSha256 = "sha256-av/F1FHMd0o9NvwA2Q9mqSd89ZEqmUaVxC+JmSwEHhI=";
25 buildFeatures = lib.optional withNativeTls "native-tls";
27 nativeBuildInputs = [ installShellFiles pkg-config ];
29 buildInputs = lib.optionals withNativeTls
30 (if stdenv.isDarwin then [ Security libiconv ] else [ openssl ]);
32 # Get openssl-sys to use pkg-config
33 OPENSSL_NO_VENDOR = 1;
36 installShellCompletion --cmd xh \
37 --bash completions/xh.bash \
38 --fish completions/xh.fish \
41 installManPage doc/xh.1
42 ln -s $out/share/man/man1/xh.1 $out/share/man/man1/xhs.1
44 install -m444 -Dt $out/share/doc/xh README.md CHANGELOG.md
46 # https://github.com/ducaale/xh#xh-and-xhs
47 ln -s $out/bin/xh $out/bin/xhs
50 # Nix build happens in sandbox without internet connectivity
51 # disable tests as some of them require internet due to nature of application
53 doInstallCheck = true;
55 $out/bin/xh --help > /dev/null
56 $out/bin/xhs --help > /dev/null
60 description = "Friendly and fast tool for sending HTTP requests";
61 homepage = "https://github.com/ducaale/xh";
62 changelog = "https://github.com/ducaale/xh/blob/v${version}/CHANGELOG.md";
63 license = licenses.mit;
64 maintainers = with maintainers; [ payas ];