1 { stdenv, lib, fetchurl, testers, infisical, installShellFiles }:
3 # this expression is mostly automated, and you are STRONGLY
4 # RECOMMENDED to use to nix-update for updating this expression when new
5 # releases come out, which runs the sibling `update.sh` script.
7 # from the root of the nixpkgs git repository, run:
9 # nix-shell maintainers/scripts/update.nix \
10 # --argstr commit true \
11 # --argstr package infisical
14 # build hashes, which correspond to the hashes of the precompiled binaries procured by GitHub Actions.
15 buildHashes = builtins.fromJSON (builtins.readFile ./hashes.json);
17 # the version of infisical
20 # the platform-specific, statically linked binary
24 # map the platform name to the golang toolchain suffix
25 # NOTE: must be synchronized with update.sh!
26 x86_64-linux = "linux_amd64";
27 x86_64-darwin = "darwin_amd64";
28 aarch64-linux = "linux_arm64";
29 aarch64-darwin = "darwin_arm64";
30 }."${stdenv.hostPlatform.system}" or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
32 name = "infisical_${version}_${suffix}.tar.gz";
33 hash = buildHashes."${stdenv.hostPlatform.system}";
34 url = "https://github.com/Infisical/infisical/releases/download/infisical-cli%2Fv${version}/${name}";
36 fetchurl { inherit name url hash; };
44 nativeBuildInputs = [ installShellFiles ];
51 buildPhase = "chmod +x ./infisical";
52 checkPhase = "./infisical --version";
54 mkdir -p $out/bin/ $out/share/completions/ $out/share/man/
56 cp completions/* $out/share/completions/
57 cp manpages/* $out/share/man/
60 installManPage share/man/infisical.1.gz
61 installShellCompletion share/completions/infisical.{bash,fish,zsh}
65 updateScript = ./update.sh;
66 tests.version = testers.testVersion { package = infisical; };
70 description = "The official Infisical CLI";
72 Infisical is the open-source secret management platform:
73 Sync secrets across your team/infrastructure and prevent secret leaks.
75 homepage = "https://infisical.com";
76 changelog = "https://github.com/infisical/infisical/releases/tag/infisical-cli%2Fv${version}";
77 license = licenses.mit;
78 mainProgram = "infisical";
79 maintainers = [ maintainers.ivanmoreau maintainers.jgoux ];