Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ lib
2, stdenv
3, fetchFromGitHub
4, rustPlatform
5, installShellFiles
6, DiskArbitration
7, Foundation
8, Security
9}:
10
11rustPlatform.buildRustPackage rec {
12 pname = "fnm";
13 version = "1.37.1";
14
15 src = fetchFromGitHub {
16 owner = "Schniz";
17 repo = pname;
18 rev = "v${version}";
19 sha256 = "sha256-x6w2g7U/FbJBycMAF4PUyaoIazp/w6imIpy+N7Cf0qk=";
20 };
21
22 nativeBuildInputs = [ installShellFiles ];
23
24 buildInputs = lib.optionals stdenv.isDarwin [ DiskArbitration Foundation Security ];
25
26 cargoHash = "sha256-b15m5DjTDNWJBHOaKSEMwkO/o+0mV+JMBDBurml7xOs=";
27
28 doCheck = false;
29
30 postInstall = ''
31 installShellCompletion --cmd fnm \
32 --bash <($out/bin/fnm completions --shell bash) \
33 --fish <($out/bin/fnm completions --shell fish) \
34 --zsh <($out/bin/fnm completions --shell zsh)
35 '';
36
37 meta = with lib; {
38 description = "Fast and simple Node.js version manager";
39 mainProgram = "fnm";
40 homepage = "https://github.com/Schniz/fnm";
41 license = licenses.gpl3Only;
42 maintainers = with maintainers; [ kidonng ];
43 };
44}