1 { pkgs, lib, fetchurl, fetchpatch, perlPackages, rsync, which, installShellFiles, ... }:
2 perlPackages.buildPerlPackage rec {
6 url = "mirror://cpan/authors/id/F/FE/FERKI/Rex-${version}.tar.gz";
7 hash = "sha256-An0wQu+UC2dZDlmJ6W8irh5nunRIlcXdPbVpwFE3Alw=";
10 buildInputs = with perlPackages; [
25 # These are part of a greater effort to add better support upstream:
26 # https://github.com/RexOps/Rex/compare/master...nixos
28 # Fix rex's ability to execute things on NixOS managed hosts
30 url = "https://github.com/RexOps/Rex/commit/c71f3b255dac8f929abea46913798f132566af55.patch";
31 hash = "sha256-S2tF3IZ96QrxDN3HfBk7RWDZcEwukQYAkSId51dATiU=";
33 # Fix explicit calls to /bin/mv and /bin/rm
35 url = "https://github.com/RexOps/Rex/commit/2782e80bb9789d3afb42e08904c28a4366a58334.patch";
36 hash = "sha256-htm39fF2tumG5b5E1ZBRX5n3vRaZZZzn2lfSN1omP8s=";
38 # Fix for PATH assumptions
40 url = "https://github.com/RexOps/Rex/commit/ec72c8d1fdddf9116afdb21091100fe7cc20f41a.patch";
41 hash = "sha256-a/Sns2f596dbAWbuIveNldc/V3MwR08/ocXVgx0Tbcw=";
43 # Fix explicit path in Sudo.pm
45 url = "https://github.com/RexOps/Rex/commit/f0b312f42178e7e4271b5b010c00efb5cdba2970.patch";
46 hash = "sha256-n/+huVCM8zpgx2LZgMB41PPIYgNhF6AK8+4FGPQH+FU=";
50 nativeBuildInputs = with perlPackages; [ installShellFiles ParallelForkManager ];
52 propagatedBuildInputs = with perlPackages; [
81 for sh in bash zsh; do
82 substituteInPlace ./share/rex-tab-completion.$sh \
83 --replace 'perl' "${pkgs.perl.withPackages (ps: [ ps.YAML ])}/bin/perl"
85 installShellCompletion --name _rex --zsh ./share/rex-tab-completion.zsh
86 installShellCompletion --name rex --bash ./share/rex-tab-completion.bash
90 homepage = "https://www.rexify.org";
91 description = "Friendly automation framework";
92 license = lib.licenses.asl20;
93 maintainers = with lib.maintainers; [ qbit ];