From 3ee0489f3e55da9a8aa88d6e72de72e7bb214e6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristoffer=20Plagborg=20Bak=20S=C3=B8rensen?= Date: Wed, 24 Jun 2026 16:50:08 +0200 Subject: [PATCH] layerx: init at 1.5.0 --- pkgs/by-name/la/layerx/package.nix | 57 ++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 pkgs/by-name/la/layerx/package.nix diff --git a/pkgs/by-name/la/layerx/package.nix b/pkgs/by-name/la/layerx/package.nix new file mode 100644 index 000000000000..0de8d58b7059 --- /dev/null +++ b/pkgs/by-name/la/layerx/package.nix @@ -0,0 +1,57 @@ +{ + lib, + stdenv, + buildGoModule, + fetchFromGitHub, + installShellFiles, + versionCheckHook, + nix-update-script, +}: + +buildGoModule (finalAttrs: { + pname = "layerx"; + version = "1.5.0"; + __structuredAttrs = true; + + src = fetchFromGitHub { + owner = "deveshctl"; + repo = "layerx"; + tag = "v${finalAttrs.version}"; + hash = "sha256-Bkz0ETQEdy0GOlyGFmP8y80NdmNgRvLV0xRf/zd91ZY="; + }; + + vendorHash = "sha256-7wbyz6fKB3HMFhKJVIWrOIczLfqF4yInyszdh2Ky8WU="; + + ldflags = [ + "-s" + "-w" + "-X=main.version=${finalAttrs.version}" + "-X=main.commit=${finalAttrs.src.rev}" + "-X=main.date=1970-01-01T00:00:00Z" + ]; + + nativeBuildInputs = [ installShellFiles ]; + + postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' + installShellCompletion \ + --cmd layerx \ + --bash <($out/bin/layerx completion bash) \ + --fish <($out/bin/layerx completion fish) \ + --zsh <($out/bin/layerx completion zsh) + ''; + + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; + versionCheckProgramArg = [ "version" ]; + + passthru.updateScript = nix-update-script { }; + + meta = { + description = "Terminal-based Docker image layer inspector"; + homepage = "https://github.com/deveshctl/layerx"; + changelog = "https://github.com/deveshctl/layerx/blob/${finalAttrs.src.rev}/CHANGELOG.md"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ kpbaks ]; + mainProgram = "layerx"; + }; +})