Unverified Commit e6e229dc authored by Sandro Jäckel's avatar Sandro Jäckel
Browse files

wezterm: add headless package for mux server

parent 03aa7e6e
Loading
Loading
Loading
Loading
+30 −1
Original line number Diff line number Diff line
@@ -36,7 +36,7 @@ rustPlatform.buildRustPackage rec {

  src = fetchFromGitHub {
    owner = "wez";
    repo = pname;
    repo = "wezterm";
    rev = version;
    fetchSubmodules = true;
    hash = "sha256-Az+HlnK/lRJpUSGm5UKyma1l2PaBKNCGFiaYnLECMX8=";
@@ -49,6 +49,13 @@ rustPlatform.buildRustPackage rec {

    # tests are failing with: Unable to exchange encryption keys
    rm -r wezterm-ssh/tests

    # hash does not work well with NixOS
    substituteInPlace assets/shell-integration/wezterm.sh \
      --replace-fail 'hash wezterm 2>/dev/null' 'command type -P wezterm &>/dev/null' \
      --replace-fail 'hash base64 2>/dev/null' 'command type -P base64 &>/dev/null' \
      --replace-fail 'hash hostname 2>/dev/null' 'command type -P hostname &>/dev/null' \
      --replace-fail 'hash hostnamectl 2>/dev/null' 'command type -P hostnamectl &>/dev/null'
  '';

  cargoLock = {
@@ -123,6 +130,28 @@ rustPlatform.buildRustPackage rec {
  '';

  passthru = {
    # the headless variant is useful when deploying wezterm's mux server on remote severs
    headless = rustPlatform.buildRustPackage {
      pname = "${pname}-headless";
      inherit version src postPatch cargoLock meta;

      nativeBuildInputs = [ pkg-config ];

      buildInputs = [ openssl ];

      cargoBuildFlags = [
        "--package" "wezterm"
        "--package" "wezterm-mux-server"
      ];

      doCheck = false;

      postInstall = ''
        install -Dm644 assets/shell-integration/wezterm.sh -t $out/etc/profile.d
        install -Dm644 ${passthru.terminfo}/share/terminfo/w/wezterm -t $out/share/terminfo/w
      '';
    };

    terminfo = runCommand "wezterm-terminfo" {
      nativeBuildInputs = [ ncurses ];
    } ''