Skip to content

Commit

Permalink
containerlab: add shell completions
Browse files Browse the repository at this point in the history
  • Loading branch information
Janik-Haag authored and yayayayaka committed Aug 8, 2023
1 parent 78c4c23 commit 9331708
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions pkgs/tools/networking/containerlab/default.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{ lib
, buildGoModule
, fetchFromGitHub
, installShellFiles
}:

buildGoModule rec {
Expand All @@ -14,6 +15,8 @@ buildGoModule rec {
hash = "sha256-Wo6Dfcdax8EjZRP5JBKrnxpFTVx0GV+7uaDgBY/zg6I=";
};

nativeBuildInputs = [ installShellFiles ];

vendorHash = "sha256-uaYeFzG74VTUrtql6mSi+LNh6IjDomixrWwGQMgmONc=";

ldflags = [
Expand All @@ -24,6 +27,14 @@ buildGoModule rec {
"-X" "github.com/srl-labs/containerlab/cmd.date=1970-01-01T00:00:00Z"
];

postInstall = ''
local INSTALL="$out/bin/containerlab"
installShellCompletion --cmd containerlab \
--bash <($out/bin/containerlab completion bash) \
--fish <($out/bin/containerlab completion fish) \
--zsh <($out/bin/containerlab completion zsh)
'';

meta = with lib; {
description = "Container-based networking lab";
homepage = "https://containerlab.dev/";
Expand Down

0 comments on commit 9331708

Please sign in to comment.