biome: 1.9.2 -> 1.9.3
[NixPkgs.git] / pkgs / tools / nix / fh / default.nix
blobba745f60b6f812346c279c6ebb3fa51d3d7064ef
1 { lib
2 , rustPlatform
3 , fetchFromGitHub
4 , installShellFiles
5 , stdenv
6 , darwin
7 , gcc
8 , libcxx
9 , cacert
12 rustPlatform.buildRustPackage rec {
13   pname = "fh";
14   version = "0.1.18";
16   src = fetchFromGitHub {
17     owner = "DeterminateSystems";
18     repo = "fh";
19     rev = "v${version}";
20     hash = "sha256-McfJXbr/oadsfQV7hzB6sEMy9sfXthHcjsbOiQs2+rU=";
21   };
23   cargoHash = "sha256-PGXd4spD2gNyQIloVZuhWZ1VQtacXPLMCQiBekZbEp4=";
25   nativeBuildInputs = [
26     installShellFiles
27     rustPlatform.bindgenHook
28   ];
30   checkInputs = [ cacert ];
32   buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [
33     darwin.apple_sdk.frameworks.Security
34     darwin.apple_sdk.frameworks.SystemConfiguration
35     gcc.cc.lib
36   ];
38   env = lib.optionalAttrs stdenv.hostPlatform.isDarwin {
39     NIX_CFLAGS_COMPILE = "-I${lib.getDev libcxx}/include/c++/v1";
40   };
42   postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
43     installShellCompletion --cmd fh \
44       --bash <($out/bin/fh completion bash) \
45       --fish <($out/bin/fh completion fish) \
46       --zsh <($out/bin/fh completion zsh)
47   '';
49   __darwinAllowLocalNetworking = true;
51   meta = with lib; {
52     description = "Official FlakeHub CLI";
53     homepage = "https://github.com/DeterminateSystems/fh";
54     changelog = "https://github.com/DeterminateSystems/fh/releases/tag/${src.rev}";
55     license = licenses.asl20;
56     maintainers = with maintainers; [ figsoda ];
57     mainProgram = "fh";
58   };