summary refs log tree commit diff
path: root/pkgs/servers/web-apps/whitebophir/default.nix
blob: f9b5aff844778e520b30cc5459c808c301f021e6 (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
{ stdenv
, pkgs
, lib
, nodejs_16
, runtimeShell
}:

let
  nodejs = nodejs_16;

  nodePackages = import ./node-packages.nix {
    inherit pkgs nodejs;
    inherit (stdenv.hostPlatform) system;
  };

  whitebophir = lib.head (lib.attrValues nodePackages);

  combined = whitebophir.override {
    postInstall = ''
      out_whitebophir=$out/lib/node_modules/whitebophir

      mkdir $out/bin
      cat <<EOF > $out/bin/whitebophir
      #!${runtimeShell}
      exec ${nodejs}/bin/node $out_whitebophir/server/server.js
      EOF
      chmod +x $out/bin/whitebophir
    '';

    meta = with lib; {
      description = "Online collaborative whiteboard that is simple, free, easy to use and to deploy";
      license = licenses.agpl3Plus;
      homepage = "https://github.com/lovasoa/whitebophir";
      maintainers = with maintainers; [ iblech ];
      platforms = platforms.unix;
    };
  };
in
  combined