fork
Configure Feed
Select the types of activity you want to include in your feed.
lol
fork
Configure Feed
Select the types of activity you want to include in your feed.
1{ lib
2, callPackage
3, rustPlatform
4, fetchFromGitHub
5, protobuf
6, darwin
7, stdenv
8, buildNpmPackage
9}:
10let
11 version = "unstable-2023-11-23";
12
13 src = fetchFromGitHub {
14 owner = "ekzhang";
15 repo = "sshx";
16 rev = "2677f7e1fa3b369132cc7f27f6028a04b92ba5cf";
17 hash = "sha256-9fo8hNUzJr4gse0J2tw7j+alqE82+y8McADzTkxryWk=";
18 };
19
20 mkSshxPackage = { pname, cargoHash, ... }@args:
21 rustPlatform.buildRustPackage (rec {
22 inherit
23 pname
24 version
25 src
26 cargoHash;
27
28 nativeBuildInputs = [ protobuf ];
29 buildInputs = lib.optional stdenv.isDarwin darwin.apple_sdk.frameworks.Security;
30
31 cargoBuildFlags = [ "--package" pname ];
32 cargoTestFlags = cargoBuildFlags;
33
34 meta = {
35 description = "Fast, collaborative live terminal sharing over the web";
36 homepage = "https://github.com/ekzhang/sshx";
37 license = lib.licenses.mit;
38 maintainers = with lib.maintainers; [ pinpox kranzes ];
39 mainProgram = pname;
40 };
41 } // args);
42in
43{
44 sshx = mkSshxPackage {
45 pname = "sshx";
46 cargoHash = "sha256-dA5Aen/qANW8si75pj/RsBknvOo3KDyU5UISAmmcfRE=";
47 };
48
49 sshx-server = mkSshxPackage rec {
50 pname = "sshx-server";
51 cargoHash = "sha256-1GRWCMXsOzqvORgtwfuywV4wLyX3r4nURhM3Dl5V9Ss=";
52
53 postPatch = ''
54 substituteInPlace crates/sshx-server/src/web.rs \
55 --replace 'ServeDir::new("build")' 'ServeDir::new("${passthru.web.outPath}")' \
56 --replace 'ServeFile::new("build/spa.html")' 'ServeFile::new("${passthru.web.outPath}/spa.html")'
57 '';
58
59 passthru.web = buildNpmPackage {
60 pname = "sshx-web";
61
62 inherit
63 version
64 src;
65
66 postPatch = ''
67 substituteInPlace vite.config.ts \
68 --replace 'execSync("git rev-parse --short HEAD").toString().trim()' '"${src.rev}"'
69 '';
70
71 npmDepsHash = "sha256-bKePCxo6+n0EG+4tbbMimPedJ0Hu1O8yZsgspmhobOs=";
72
73 installPhase = ''
74 mkdir -p "$out"
75 cp -r build/* "$out"
76 '';
77 };
78 };
79}