about summary refs log tree commit diff
path: root/nixpkgs/pkgs/by-name/ss/sshx/package.nix
blob: ff3de67054534821a4f5384ea9e1df23c7f169f3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
{ lib
, rustPlatform
, fetchFromGitHub
, pkg-config
, protobuf
, zstd
, stdenv
, darwin
}:

rustPlatform.buildRustPackage rec {
  pname = "sshx";
  version = "unstable-2023-11-04";

  src = fetchFromGitHub {
    owner = "ekzhang";
    repo = "sshx";
    rev = "91c82d46cde4d1ffa0ae34e2a9a49911e2e53baa";
    hash = "sha256-X9c7ZKIpWI5EsbkgB8FJWlwQQXHAcPjLKp2Bvo0fo/w=";
  };

  cargoHash = "sha256-mOK5gpPuUKzN5xnJs5nFyslxr9IIHtiCylMP53ObDqg=";

  nativeBuildInputs = [
    pkg-config
    protobuf
  ];

  buildInputs = [
    zstd
  ] ++ lib.optionals stdenv.isDarwin [
    darwin.apple_sdk.frameworks.Security
  ];

  env = {
    ZSTD_SYS_USE_PKG_CONFIG = true;
  };

  outputs = [ "out" "server" ];

  postInstall = ''
    moveToOutput 'bin/sshx' "$out"
    moveToOutput 'bin/sshx-server' "$server"
  '';

  meta = with lib; {
    description = "Fast, collaborative live terminal sharing over the web";
    homepage = "https://github.com/ekzhang/sshx";
    license = licenses.mit;
    maintainers = with maintainers; [ pinpox ];
    mainProgram = "sshx";
  };
}