mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-15 22:36:23 +01:00
sshx-server: add web ui
This commit is contained in:
parent
673c8d72ca
commit
54557f8bfa
1 changed files with 28 additions and 1 deletions
|
@ -5,6 +5,7 @@
|
|||
, protobuf
|
||||
, darwin
|
||||
, stdenv
|
||||
, buildNpmPackage
|
||||
}:
|
||||
let
|
||||
version = "unstable-2023-11-23";
|
||||
|
@ -45,8 +46,34 @@ in
|
|||
cargoHash = "sha256-dA5Aen/qANW8si75pj/RsBknvOo3KDyU5UISAmmcfRE=";
|
||||
};
|
||||
|
||||
sshx-server = mkSshxPackage {
|
||||
sshx-server = mkSshxPackage rec {
|
||||
pname = "sshx-server";
|
||||
cargoHash = "sha256-1GRWCMXsOzqvORgtwfuywV4wLyX3r4nURhM3Dl5V9Ss=";
|
||||
|
||||
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")'
|
||||
'';
|
||||
|
||||
passthru.web = buildNpmPackage {
|
||||
pname = "sshx-web";
|
||||
|
||||
inherit
|
||||
version
|
||||
src;
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace vite.config.ts \
|
||||
--replace 'execSync("git rev-parse --short HEAD").toString().trim()' '"${src.rev}"'
|
||||
'';
|
||||
|
||||
npmDepsHash = "sha256-bKePCxo6+n0EG+4tbbMimPedJ0Hu1O8yZsgspmhobOs=";
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p "$out"
|
||||
cp -r build/* "$out"
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue