From 4a68ad730a1130eafe4660b33479fb903b802ca1 Mon Sep 17 00:00:00 2001 From: whoomee Date: Thu, 25 Dec 2025 12:15:36 +0100 Subject: [PATCH] mosh: add withClient to allow perlless server-only builds --- pkgs/by-name/mo/mosh/package.nix | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/pkgs/by-name/mo/mosh/package.nix b/pkgs/by-name/mo/mosh/package.nix index b5b016340d27..362835e86745 100644 --- a/pkgs/by-name/mo/mosh/package.nix +++ b/pkgs/by-name/mo/mosh/package.nix @@ -15,6 +15,8 @@ fetchpatch, withUtempter ? stdenv.hostPlatform.isLinux && !stdenv.hostPlatform.isMusl, libutempter, + # build server binary only when set to false (useful for perlless systems) + withClient ? true, }: stdenv.mkDerivation rec { @@ -41,6 +43,8 @@ stdenv.mkDerivation rec { zlib openssl bash-completion + ] + ++ lib.optionals withClient [ perl ] ++ lib.optional withUtempter libutempter; @@ -70,9 +74,17 @@ stdenv.mkDerivation rec { configureFlags = [ "--enable-completion" ] ++ lib.optional withUtempter "--with-utempter"; - postInstall = '' - wrapProgram $out/bin/mosh --prefix PERL5LIB : $PERL5LIB - ''; + postInstall = + if withClient then + '' + wrapProgram $out/bin/mosh --prefix PERL5LIB : $PERL5LIB + '' + else + '' + rm $out/bin/mosh + rm $out/bin/mosh-client + rm -r $out/share/{man,bash-completion} + ''; meta = { homepage = "https://mosh.org/";