Files
nixpkgs/pkgs/by-name/op/openfga-cli/package.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

56 lines
1.3 KiB
Nix

{
lib,
buildGoModule,
fetchFromGitHub,
installShellFiles,
}:
let
pname = "openfga-cli";
version = "0.7.4";
in
buildGoModule {
inherit pname version;
src = fetchFromGitHub {
owner = "openfga";
repo = "cli";
rev = "v${version}";
hash = "sha256-kskPQyMzFgCOIaHmN/iZbRDPR6wbYp8kBcf+51cniSk=";
};
vendorHash = "sha256-e/w1KGVzrZPp8KTP0paCRcE9OYkZMmEmmIZmKmPtx5s=";
nativeBuildInputs = [ installShellFiles ];
ldflags =
let
buildInfoPkg = "github.com/openfga/cli/internal/build";
in
[
"-s"
"-w"
"-X ${buildInfoPkg}.Version=${version}"
"-X ${buildInfoPkg}.Commit=${version}"
"-X ${buildInfoPkg}.Date=19700101"
];
postInstall = ''
completions_dir=$TMPDIR/fga_completions
mkdir $completions_dir
$out/bin/fga completion bash > $completions_dir/fga.bash
$out/bin/fga completion zsh > $completions_dir/_fga.zsh
$out/bin/fga completion fish > $completions_dir/fga.fish
installShellCompletion $completions_dir/*
'';
meta = {
description = "Cross-platform CLI to interact with an OpenFGA server";
homepage = "https://github.com/openfga/cli";
license = lib.licenses.asl20;
mainProgram = "fga";
maintainers = with lib.maintainers; [ jlesquembre ];
};
}