Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions pkgs/tools/networking/mpssh/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{ stdenv, fetchFromGitHub, openssh }:

stdenv.mkDerivation rec {
pname = "mpssh";
version = "1.3.3";

src = fetchFromGitHub {
sha256 = "0iibzb9qrwf9wsmp2b8j76qw66ql8fw5jx02x82a22fsaznb5dng";
rev = version;
repo = pname;
owner = "ndenev";
};

buildInputs = [ openssh ];

postPatch = ''
substituteInPlace Makefile --replace /usr/local $out
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

substituteInPlace Makefile --replace "-o root" ""
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps use a patch, it will make it easier to notice when the substitution no longer applies

patches = [
  # Do not install as root
  (fetchpatch {
    url = https://github.com/ndenev/mpssh/commit/3cbb868b6fdf8dff9ab86868510c0455ad1ec1b3.patch;
    sha256 = "0000000000000000000000000000000000000000000000000000000000000000";
  })
];

'';

makeFlags = "CC=cc LD=cc BIN=$(out)/bin SSHPATH=${openssh}/bin/ssh SCPPATH=${openssh}/bin/scp";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please make this a list: #45886


meta = {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is usually nicer to use with stdenv.lib here, so that it does not need to be repeated in meta.

homepage = "https://github.com/ndenev/mpssh";
description = "Mass Parallel SSH";
license = stdenv.lib.licenses.bsd3;

longDescription = ''
mpssh is a parallel ssh tool. What it does is connecting to a number of hosts
specified in the hosts file and execute the same command on all of them,
showing a nicely formatted output with each line prepended with the hostname
that produced the line. It is also possible to specify a script on the local filesystem
that will be first scp copied to the remote host and then executed.
'';

platforms = stdenv.lib.platforms.unix;
maintainers = [ stdenv.lib.maintainers.ktf ];
};
}
2 changes: 2 additions & 0 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4627,6 +4627,8 @@ in

mpw = callPackage ../tools/security/mpw { };

mpssh = callPackage ../tools/networking/mpssh { };

mr = callPackage ../applications/version-management/mr { };

mrtg = callPackage ../tools/misc/mrtg { };
Expand Down