mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-11 20:25:32 +03:00
containerlab: use finalAttrs
This commit is contained in:
parent
f9969bf7f6
commit
8ad45dfec6
1 changed files with 10 additions and 10 deletions
|
@ -6,26 +6,29 @@
|
|||
versionCheckHook,
|
||||
}:
|
||||
|
||||
buildGoModule rec {
|
||||
buildGoModule (finalAttrs: {
|
||||
pname = "containerlab";
|
||||
version = "0.68.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "srl-labs";
|
||||
repo = "containerlab";
|
||||
rev = "v${version}";
|
||||
tag = "v${finalAttrs.version}";
|
||||
hash = "sha256-x6QDwduAMCD+Trj0awQXW0Tdleb2U6YBi/7mdMB6V/8=";
|
||||
};
|
||||
|
||||
vendorHash = "sha256-XRgKfRw6VGg+lkbtPWUVNfAk5a7ZdFwVmhjtM7uSwHs=";
|
||||
|
||||
nativeBuildInputs = [ installShellFiles ];
|
||||
nativeBuildInputs = [
|
||||
installShellFiles
|
||||
versionCheckHook
|
||||
];
|
||||
|
||||
ldflags = [
|
||||
"-s"
|
||||
"-w"
|
||||
"-X github.com/srl-labs/containerlab/cmd/version.Version=${version}"
|
||||
"-X github.com/srl-labs/containerlab/cmd/version.commit=${src.rev}"
|
||||
"-X github.com/srl-labs/containerlab/cmd/version.Version=${finalAttrs.version}"
|
||||
"-X github.com/srl-labs/containerlab/cmd/version.commit=${finalAttrs.src.rev}"
|
||||
"-X github.com/srl-labs/containerlab/cmd/version.date=1970-01-01T00:00:00Z"
|
||||
];
|
||||
|
||||
|
@ -42,19 +45,16 @@ buildGoModule rec {
|
|||
--zsh <($out/bin/containerlab completion zsh)
|
||||
'';
|
||||
|
||||
nativeInstallCheckInputs = [
|
||||
versionCheckHook
|
||||
];
|
||||
doInstallCheck = true;
|
||||
versionCheckProgramArg = "version";
|
||||
|
||||
meta = {
|
||||
description = "Container-based networking lab";
|
||||
homepage = "https://containerlab.dev/";
|
||||
changelog = "https://github.com/srl-labs/containerlab/releases/tag/${src.rev}";
|
||||
changelog = "https://github.com/srl-labs/containerlab/releases/tag/v${finalAttrs.version}";
|
||||
license = lib.licenses.bsd3;
|
||||
platforms = lib.platforms.linux;
|
||||
maintainers = with lib.maintainers; [ aaronjheng ];
|
||||
mainProgram = "containerlab";
|
||||
};
|
||||
}
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue