nixpkgs/pkgs/by-name/op/openfga-cli/package.nix
Alexis Hildebrandt 755b915a15 treewide: Remove indefinite article from meta.description
nix run nixpkgs#silver-searcher -- -G '\.nix$' -0l 'description.*"[Aa]n?' pkgs \
  | xargs -0 nix run nixpkgs#gnused -- -i '' -Ee 's/(description.*")[Aa]n? (.)/\1\U\2/'
2024-06-09 23:07:45 +02:00

56 lines
1.3 KiB
Nix

{
lib,
buildGoModule,
fetchFromGitHub,
installShellFiles,
}:
let
pname = "openfga-cli";
version = "0.4.1";
in
buildGoModule {
inherit pname version;
src = fetchFromGitHub {
owner = "openfga";
repo = "cli";
rev = "v${version}";
hash = "sha256-Eex2Bts0A6Lu5M626idVK3lqVCX+2WosD8YrQP4DuC8=";
};
vendorHash = "sha256-cr9Y72ilUZxAjOIopx7VmZVtE8TxJhxdKSJIj6NawRI=";
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 ];
};
}