Files
nixpkgs/pkgs/by-name/az/az-pim-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

66 lines
1.6 KiB
Nix

{
lib,
buildGoModule,
fetchFromGitHub,
installShellFiles,
stdenv,
versionCheckHook,
writableTmpDirAsHomeHook,
nix-update-script,
}:
buildGoModule (finalAttrs: {
pname = "az-pim-cli";
version = "1.7.0";
src = fetchFromGitHub {
owner = "netr0m";
repo = "az-pim-cli";
tag = "v${finalAttrs.version}";
hash = "sha256-X7+/2pXbpHFm22lwWy6LvyjIy6sxmYSiMrYV3faAZl4=";
};
patches = [
# removes info we don't have from version command
./version-build-info.patch
];
vendorHash = "sha256-PHrpUlAG/PBe3NKUGBQ1U7dCcqkSlErWX2dp9ZPB3+8=";
nativeBuildInputs = [
installShellFiles
];
env.CGO_ENABLED = 0;
ldflags = [
"-s"
"-X github.com/netr0m/az-pim-cli/cmd.version=v${finalAttrs.version}"
];
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd az-pim-cli \
--bash <($out/bin/az-pim-cli completion bash) \
--fish <($out/bin/az-pim-cli completion fish) \
--zsh <($out/bin/az-pim-cli completion zsh)
'';
doInstallCheck = true;
nativeInstallCheckInputs = [
writableTmpDirAsHomeHook
versionCheckHook
];
versionCheckProgramArg = "version";
versionCheckKeepEnvironment = [ "HOME" ];
passthru.updateScript = nix-update-script { };
meta = {
description = "List and activate Azure Entra ID Privileged Identity Management roles from the CLI";
homepage = "https://github.com/netr0m/az-pim-cli";
changelog = "https://github.com/netr0m/az-pim-cli/releases/tag/v${finalAttrs.version}";
license = lib.licenses.mit;
maintainers = [ lib.maintainers.awwpotato ];
mainProgram = "az-pim-cli";
};
})