Skip to content

Commit

Permalink
nix: add headless variant
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperSandro2000 authored and wez committed Nov 4, 2024
1 parent 0983ae9 commit c57b3ee
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions nix/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,13 @@
# 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'
'';

preFixup = lib.optionalString stdenv.isLinux ''
Expand Down Expand Up @@ -154,6 +161,28 @@
'';

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

nativeBuildInputs = [ pkgs.pkg-config ];

buildInputs = [ pkgs.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 =
pkgs.runCommand "wezterm-terminfo"
{
Expand Down

0 comments on commit c57b3ee

Please sign in to comment.