about summary refs log tree commit diff
path: root/pkgs/applications/networking/novnc/default.nix
blob: 17d32b84a78f68cd909e0f0ea4830bab0f3e6d69 (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
{ lib, python3, stdenv, substituteAll, fetchFromGitHub }:

stdenv.mkDerivation rec {
  pname = "novnc";
  version = "1.4.0";

  src = fetchFromGitHub {
    owner = "novnc";
    repo = "noVNC";
    rev = "v${version}";
    sha256 = "sha256-G7Rtv7pQFR9UrzhYXDyBf+FRqtjo5NAXU7m/HeXhI1k=";
  };

  patches = with python3.pkgs; [
    (substituteAll {
      src = ./websockify.patch;
      inherit websockify;
    })
  ] ++ [ ./fix-paths.patch ];

  postPatch = ''
    substituteAllInPlace utils/novnc_proxy
  '';

  installPhase = ''
    runHook preInstall

    install -Dm755 utils/novnc_proxy "$out/bin/novnc"
    install -dm755 "$out/share/webapps/novnc/"
    cp -a app core po vendor vnc.html karma.conf.js package.json vnc_lite.html "$out/share/webapps/novnc/"

    runHook postInstall
  '';

  meta = with lib; {
    description = "VNC client web application";
    homepage = "https://novnc.com";
    license = with licenses; [ mpl20 ofl bsd3 bsd2 mit ];
    maintainers = with maintainers; [ neverbehave ];
  };
}