diff options
author | superherointj <5861043+superherointj@users.noreply.github.com> | 2023-02-04 17:30:38 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-04 17:30:38 -0300 |
commit | 491dd41d7855bf2b3d350eb04118ed49741fffb5 (patch) | |
tree | 04c0e5b2cd88f318696db8dea5ab3310e754f778 | |
parent | 5a6b558d0023c6a5551b4fac6d811be3c8837309 (diff) | |
parent | 617158eaf6ad8f79e5789b0e184ab03a770e1804 (diff) |
Merge pull request #214386 from doronbehar/pkg/arduino-cli
arduino-cli: Install shell completion files
-rw-r--r-- | pkgs/development/embedded/arduino/arduino-cli/default.nix | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/pkgs/development/embedded/arduino/arduino-cli/default.nix b/pkgs/development/embedded/arduino/arduino-cli/default.nix index 3fbeaab38739..99f1f6e78407 100644 --- a/pkgs/development/embedded/arduino/arduino-cli/default.nix +++ b/pkgs/development/embedded/arduino/arduino-cli/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, buildGoModule, fetchFromGitHub, buildFHSUserEnv }: +{ lib, stdenv, buildGoModule, fetchFromGitHub, buildFHSUserEnv, installShellFiles }: let @@ -13,6 +13,10 @@ let sha256 = "sha256-jew4KLpOOXE9N/h4qFqof8y26DQrvm78E/ARbbwocD4="; }; + nativeBuildInputs = [ + installShellFiles + ]; + subPackages = [ "." ]; vendorSha256 = "sha256-BunonnjzGnpcmGJXxEQXvjJLGvdSXUOK9zAhXoAemHY="; @@ -23,6 +27,15 @@ let "-s" "-w" "-X github.com/arduino/arduino-cli/version.versionString=${version}" "-X github.com/arduino/arduino-cli/version.commit=unknown" ] ++ lib.optionals stdenv.isLinux [ "-extldflags '-static'" ]; + postInstall = '' + export HOME="$(mktemp -d)" + for s in {bash,zsh,fish}; do + $out/bin/arduino-cli completion $s > completion.$s + installShellCompletion --cmd arduino-cli --$s completion.$s + done + unset HOME + ''; + meta = with lib; { inherit (src.meta) homepage; description = "Arduino from the command line"; @@ -46,7 +59,9 @@ if stdenv.isLinux then extraInstallCommands = '' mv $out/bin/$name $out/bin/arduino-cli + cp -r ${pkg.outPath}/share $out/share ''; + passthru.pureGoPkg = pkg; targetPkgs = pkgs: with pkgs; [ zlib |