1 { lib, stdenv, fetchFromGitHub, zlib, protobuf, ncurses, pkg-config
2 , makeWrapper, perl, openssl, autoreconfHook, openssh, bash-completion, fetchpatch
3 , withUtempter ? stdenv.hostPlatform.isLinux && !stdenv.hostPlatform.isMusl, libutempter }:
5 stdenv.mkDerivation rec {
9 src = fetchFromGitHub {
10 owner = "mobile-shell";
12 rev = "mosh-${version}";
13 hash = "sha256-tlSsHu7JnXO+sorVuWWubNUNdb9X0/pCaiGG5Y0X/g8=";
16 nativeBuildInputs = [ autoreconfHook pkg-config makeWrapper protobuf perl ];
17 buildInputs = [ protobuf ncurses zlib openssl bash-completion perl ]
18 ++ lib.optional withUtempter libutempter;
22 enableParallelBuilding = true;
26 ./mosh-client_path.patch
27 # Fix build with bash-completion 2.10
28 ./bash_completion_datadir.patch
30 # Fixes build with protobuf3 23.x
32 url = "https://github.com/mobile-shell/mosh/commit/eee1a8cf413051c2a9104e8158e699028ff56b26.patch";
33 hash = "sha256-CouLHWSsyfcgK3k7CvTK3FP/xjdb1pfsSXYYQj3NmCQ=";
38 substituteInPlace scripts/mosh.pl \
39 --subst-var-by ssh "${openssh}/bin/ssh" \
40 --subst-var-by mosh-client "$out/bin/mosh-client"
43 configureFlags = [ "--enable-completion" ]
44 ++ lib.optional withUtempter "--with-utempter";
47 wrapProgram $out/bin/mosh --prefix PERL5LIB : $PERL5LIB
51 homepage = "https://mosh.org/";
52 description = "Mobile shell (ssh replacement)";
54 Remote terminal application that allows roaming, supports intermittent
55 connectivity, and provides intelligent local echo and line editing of
58 Mosh is a replacement for SSH. It's more robust and responsive,
59 especially over Wi-Fi, cellular, and long-distance links.
61 license = licenses.gpl3Plus;
62 maintainers = with lib.maintainers; [ skeuchel ];
63 platforms = platforms.unix;