push sheeet
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

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,65 @@
{
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";
};
})

View File

@@ -0,0 +1,24 @@
diff --git a/cmd/version.go b/cmd/version.go
index 816f044..ef107be 100644
--- a/cmd/version.go
+++ b/cmd/version.go
@@ -31,8 +31,7 @@ type BuildInfo struct {
}
func (b BuildInfo) String() string {
- return fmt.Sprintf("az-pim-cli version %s (built with %s from %s on %s)",
- b.Version, b.GoVersion, b.Commit, b.Date)
+ return fmt.Sprintf("az-pim-cli version %s", b.Version)
}
func printVersion(w io.Writer, info BuildInfo) {
@@ -47,8 +46,8 @@ func createBuildInfo() BuildInfo {
Date: date,
}
- buildInfo, available := debug.ReadBuildInfo()
- if !available {
+ buildInfo, _ := debug.ReadBuildInfo()
+ if true {
return info
}