From 1dafc2cd56f9f6aebc60212be36fb5be1ebc342c Mon Sep 17 00:00:00 2001 From: David Warde-Farley Date: Tue, 30 Aug 2022 02:08:06 +0100 Subject: [PATCH] novnc: use installed package files as default for `--web` This allows novnc to run without manually supplying the location of `vnc.html` in the Nix store or assembled environment. --- .../applications/networking/novnc/default.nix | 6 +++++ .../networking/novnc/fix-paths.patch | 22 +++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 pkgs/applications/networking/novnc/fix-paths.patch diff --git a/pkgs/applications/networking/novnc/default.nix b/pkgs/applications/networking/novnc/default.nix index 269944324c64..a4efc6889ad4 100644 --- a/pkgs/applications/networking/novnc/default.nix +++ b/pkgs/applications/networking/novnc/default.nix @@ -11,6 +11,12 @@ stdenv.mkDerivation rec { sha256 = "sha256-Z+bks7kcwj+Z3uf/t0u25DnGOM60QhSH6uuoIi59jqU="; }; + patches = [ ./fix-paths.patch ]; + + postPatch = '' + substituteAllInPlace utils/novnc_proxy + ''; + installPhase = '' runHook preInstall diff --git a/pkgs/applications/networking/novnc/fix-paths.patch b/pkgs/applications/networking/novnc/fix-paths.patch new file mode 100644 index 000000000000..cb160320dd53 --- /dev/null +++ b/pkgs/applications/networking/novnc/fix-paths.patch @@ -0,0 +1,22 @@ +diff --git a/utils/novnc_proxy b/utils/novnc_proxy +index 0900f7e..a931763 100755 +--- a/utils/novnc_proxy ++++ b/utils/novnc_proxy +@@ -22,7 +22,7 @@ usage() { + echo " Default: self.pem" + echo " --key KEY Path to key file, when not combined with cert" + echo " --web WEB Path to web files (e.g. vnc.html)" +- echo " Default: ./" ++ echo " Default: @out@/share/webapps/novnc" + echo " --ssl-only Disable non-https connections." + echo " " + echo " --record FILE Record traffic to FILE.session.js" +@@ -44,7 +44,7 @@ PORT="6080" + VNC_DEST="localhost:5900" + CERT="" + KEY="" +-WEB="" ++WEB="@out@/share/webapps/novnc" + proxy_pid="" + SSLONLY="" + RECORD_ARG=""