sshx: unstable-2023-11-23 -> 0.2.4

Changelog: https://github.com/ekzhang/sshx/releases/tag/v0.2.4
This commit is contained in:
Fabian Affolter 2024-09-19 22:53:26 +02:00
parent 44b4f9573f
commit 3c3e6d155d

View File

@ -8,13 +8,13 @@
, buildNpmPackage
}:
let
version = "unstable-2023-11-23";
version = "0.2.4";
src = fetchFromGitHub {
owner = "ekzhang";
repo = "sshx";
rev = "2677f7e1fa3b369132cc7f27f6028a04b92ba5cf";
hash = "sha256-9fo8hNUzJr4gse0J2tw7j+alqE82+y8McADzTkxryWk=";
rev = "refs/tags/v${version}";
hash = "sha256-RIQRX4sXlMl73Opi6hK2WD/erdAMNrm40IasHasikuw=";
};
mkSshxPackage = { pname, cargoHash, ... }@args:
@ -26,14 +26,17 @@ let
cargoHash;
nativeBuildInputs = [ protobuf ];
buildInputs = lib.optional stdenv.isDarwin darwin.apple_sdk.frameworks.Security;
cargoBuildFlags = [ "--package" pname ];
cargoTestFlags = cargoBuildFlags;
meta = {
description = "Fast, collaborative live terminal sharing over the web";
homepage = "https://github.com/ekzhang/sshx";
changelog = "https://github.com/ekzhang/sshx/releases/tag/v${version}";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ pinpox kranzes ];
mainProgram = pname;
@ -43,17 +46,17 @@ in
{
sshx = mkSshxPackage {
pname = "sshx";
cargoHash = "sha256-dA5Aen/qANW8si75pj/RsBknvOo3KDyU5UISAmmcfRE=";
cargoHash = "sha256-PMSKhlHSjXKh/Jxvl2z+c1zDDyuVPzQapvdCdcuaFYc=";
};
sshx-server = mkSshxPackage rec {
pname = "sshx-server";
cargoHash = "sha256-1GRWCMXsOzqvORgtwfuywV4wLyX3r4nURhM3Dl5V9Ss=";
cargoHash = "sha256-ySsTjNoI/nuz2qtZ4M2Fd9zy239+E61hUCq1r/ahgsA=";
postPatch = ''
substituteInPlace crates/sshx-server/src/web.rs \
--replace 'ServeDir::new("build")' 'ServeDir::new("${passthru.web.outPath}")' \
--replace 'ServeFile::new("build/spa.html")' 'ServeFile::new("${passthru.web.outPath}/spa.html")'
--replace-fail 'ServeDir::new("build")' 'ServeDir::new("${passthru.web.outPath}")' \
--replace-fail 'ServeFile::new("build/spa.html")' 'ServeFile::new("${passthru.web.outPath}/spa.html")'
'';
passthru.web = buildNpmPackage {
@ -65,7 +68,7 @@ in
postPatch = ''
substituteInPlace vite.config.ts \
--replace 'execSync("git rev-parse --short HEAD").toString().trim()' '"${src.rev}"'
--replace-fail 'execSync("git rev-parse --short HEAD").toString().trim()' '"${src.rev}"'
'';
npmDepsHash = "sha256-bKePCxo6+n0EG+4tbbMimPedJ0Hu1O8yZsgspmhobOs=";