From e2a7510f3db12db9820fd45c8edcb6f5c4b33935 Mon Sep 17 00:00:00 2001 From: Aaron Bieber Date: Fri, 13 Jan 2023 05:47:24 -0700 Subject: [PATCH] rex: install shell completions --- pkgs/tools/system/rex/default.nix | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/system/rex/default.nix b/pkgs/tools/system/rex/default.nix index 2bb67333121e..cf59a22cecee 100644 --- a/pkgs/tools/system/rex/default.nix +++ b/pkgs/tools/system/rex/default.nix @@ -1,4 +1,4 @@ -{ pkgs, lib, fetchurl, perlPackages, rsync, ... }: +{ pkgs, lib, fetchurl, perlPackages, rsync, installShellFiles, ... }: perlPackages.buildPerlPackage rec { pname = "Rex"; @@ -18,7 +18,7 @@ perlPackages.buildPerlPackage rec { rsync ]; - nativeBuildInputs = with perlPackages; [ ParallelForkManager ]; + nativeBuildInputs = with perlPackages; [ installShellFiles ParallelForkManager ]; propagatedBuildInputs = with perlPackages; [ AWSSignature4 @@ -44,6 +44,17 @@ perlPackages.buildPerlPackage rec { doCheck = false; + outputs = [ "out" ]; + + fixupPhase = '' + for sh in bash zsh; do + substituteInPlace ./share/rex-tab-completion.$sh \ + --replace 'perl' "${pkgs.perl.withPackages (ps: [ ps.YAML ])}/bin/perl" + done + installShellCompletion --name _rex --zsh ./share/rex-tab-completion.zsh + installShellCompletion --name rex --bash ./share/rex-tab-completion.bash + ''; + meta = { homepage = "https://www.rexify.org"; description = "The friendly automation framework";