btrbk: add mainProgram (#356350)
[NixPkgs.git] / pkgs / by-name / wh / whitebophir / package.nix
blobb3401ff78fc7424a6d3de04fe8cfd8d581a60b17
1 { lib
2 , buildNpmPackage
3 , fetchFromGitHub
4 , nodejs_20
5 , runtimeShell
6 }:
8 let
9   nodejs = nodejs_20;
10 in buildNpmPackage rec {
11   pname = "whitebophir";
12   version = "1.19.1";
14   src = fetchFromGitHub {
15     owner = "lovasoa";
16     repo = "whitebophir";
17     rev = "v${version}";
18     hash = "sha256-4T7s9WrpyHVPcw0QY0C0sczDJYKzA4bAAfEv8q2pOy4=";
19   };
21   inherit nodejs;
23   npmDepsHash = "sha256-mKDkkX7vWrnfEg1D65bqn/MtyUS0DKjTtkDW6ebso7g=";
25   # geckodriver tries to access network
26   npmFlags = [ "--ignore-scripts" ];
28   dontNpmBuild = true;
30   postInstall = ''
31     out_whitebophir=$out/lib/node_modules/whitebophir
33     mkdir $out/bin
34     cat <<EOF > $out/bin/whitebophir
35     #!${runtimeShell}
36     exec ${nodejs}/bin/node $out_whitebophir/server/server.js
37     EOF
38     chmod +x $out/bin/whitebophir
39   '';
41   meta = with lib; {
42     description = "Online collaborative whiteboard that is simple, free, easy to use and to deploy";
43     license = licenses.agpl3Plus;
44     homepage = "https://github.com/lovasoa/whitebophir";
45     mainProgram = "whitebophir";
46     maintainers = with maintainers; [ iblech ];
47     platforms = platforms.unix;
48   };