9 # this expression is mostly automated, and you are STRONGLY
10 # RECOMMENDED to use to nix-update for updating this expression when new
11 # releases come out, which runs the sibling `update.sh` script.
13 # from the root of the nixpkgs git repository, run:
15 # nix-shell maintainers/scripts/update.nix \
16 # --argstr commit true \
17 # --argstr package infisical
20 # build hashes, which correspond to the hashes of the precompiled binaries procured by GitHub Actions.
21 buildHashes = builtins.fromJSON (builtins.readFile ./hashes.json);
23 # the version of infisical
26 # the platform-specific, statically linked binary
31 # map the platform name to the golang toolchain suffix
32 # NOTE: must be synchronized with update.sh!
33 x86_64-linux = "linux_amd64";
34 x86_64-darwin = "darwin_amd64";
35 aarch64-linux = "linux_arm64";
36 aarch64-darwin = "darwin_arm64";
38 ."${stdenv.hostPlatform.system}" or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
40 name = "infisical_${version}_${suffix}.tar.gz";
41 hash = buildHashes."${stdenv.hostPlatform.system}";
42 url = "https://github.com/Infisical/infisical/releases/download/infisical-cli%2Fv${version}/${name}";
44 fetchurl { inherit name url hash; };
47 stdenv.mkDerivation (finalAttrs: {
52 nativeBuildInputs = [ installShellFiles ];
59 buildPhase = "chmod +x ./infisical";
60 checkPhase = "./infisical --version";
62 mkdir -p $out/bin/ $out/share/completions/ $out/share/man/
64 cp completions/* $out/share/completions/
65 cp manpages/* $out/share/man/
68 installManPage share/man/infisical.1.gz
69 installShellCompletion share/completions/infisical.{bash,fish,zsh}
73 updateScript = ./update.sh;
74 tests.version = testers.testVersion { package = finalAttrs.finalPackage; };
78 description = "Official Infisical CLI";
80 Infisical is the open-source secret management platform:
81 Sync secrets across your team/infrastructure and prevent secret leaks.
83 homepage = "https://infisical.com";
84 changelog = "https://github.com/infisical/infisical/releases/tag/infisical-cli%2Fv${version}";
85 license = licenses.mit;
86 mainProgram = "infisical";
87 maintainers = teams.infisical.members ++ (with maintainers; [ hausken ]);