Building Electron App from Gitlab with Yarn2Nix

Hi,

I want to build this app: RemixDev / deemix-gui · GitLab

Steps I’ve taken.

  1. Cloned the repository
  2. Cloned the webui repository to a webui directory.
  3. Used the nixpkgs version of yarn2nix to generate a yarn.nix file.
  4. Made this default.nix:
let 
  pkgs = import <nixpkgs> {};
  electron_t = pkgs.electron_22;
in 
    rec {
     deemix-gui = pkgs.mkYarnPackage {
        name = "deemix-gui";
        src = ./.;
        nativeBuildInputs = [ electron_t ];
        packageJSON = ./package.json;
        yarnLock = ./yarn.lock;
        # NOTE: this is optional and generated dynamically if omitted
        yarnNix = ./yarn.nix;
      };
}
  1. Running nix-build

When I try to start the app with yarn start I get this error though.

$ yarn start
yarn run v1.22.19
$ electron . --dev
App threw an error during load
Error: Cannot find module 'electron-context-menu'
Require stack:
- ~/deemix-gui/index.js
- /nix/store/d0yi5ahbr0rfba256d28gvyca06g6hv1-electron-22.3.27/libexec/electron/resources/default_app.asar/main.js
- 
    at Module._resolveFilename (node:internal/modules/cjs/loader:963:15)
    at n._resolveFilename (node:electron/js2c/browser_init:2:109827)
    at Module._load (node:internal/modules/cjs/loader:811:27)
    at f._load (node:electron/js2c/asar_bundle:2:13377)
    at Module.require (node:internal/modules/cjs/loader:1035:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/home/tobioloke/deemix-gui/index.js:2:21)
    at Module._compile (node:internal/modules/cjs/loader:1141:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1196:10)
    at Module.load (node:internal/modules/cjs/loader:1011:32)
A JavaScript error occurred in the main process
Uncaught Exception:
Error: Cannot find module 'electron-context-menu'
Require stack:
- ~/deemix-gui/index.js
- /nix/store/d0yi5ahbr0rfba256d28gvyca06g6hv1-electron-22.3.27/libexec/electron/resources/default_app.asar/main.js
- 
    at Module._resolveFilename (node:internal/modules/cjs/loader:963:15)
    at n._resolveFilename (node:electron/js2c/browser_init:2:109827)
    at Module._load (node:internal/modules/cjs/loader:811:27)
    at f._load (node:electron/js2c/asar_bundle:2:13377)
    at Module.require (node:internal/modules/cjs/loader:1035:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/home/tobioloke/deemix-gui/index.js:2:21)
    at Module._compile (node:internal/modules/cjs/loader:1141:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1196:10)
    at Module.load (node:internal/modules/cjs/loader:1011:32)
[576627:1228/094247.277460:ERROR:angle_platform_impl.cc(43)] Display.cpp:1004 (initialize): ANGLE Display::initialize error 12289: Could not dlopen libGL.so.1: libGL.so.1: cannot open shared object file: No such file or directory
ERR: Display.cpp:1004 (initialize): ANGLE Display::initialize error 12289: Could not dlopen libGL.so.1: libGL.so.1: cannot open shared object file: No such file or directory
[576627:1228/094247.277729:ERROR:gl_display.cc(508)] EGL Driver message (Critical) eglInitialize: Could not dlopen libGL.so.1: libGL.so.1: cannot open shared object file: No such file or directory
[576627:1228/094247.277872:ERROR:gl_display.cc(920)] eglInitialize OpenGL failed with error EGL_NOT_INITIALIZED, trying next display type
[576627:1228/094247.278040:ERROR:angle_platform_impl.cc(43)] Display.cpp:1004 (initialize): ANGLE Display::initialize error 12289: Could not dlopen libGL.so.1: libGL.so.1: cannot open shared object file: No such file or directory
ERR: Display.cpp:1004 (initialize): ANGLE Display::initialize error 12289: Could not dlopen libGL.so.1: libGL.so.1: cannot open shared object file: No such file or directory
[576627:1228/094247.278126:ERROR:gl_display.cc(508)] EGL Driver message (Critical) eglInitialize: Could not dlopen libGL.so.1: libGL.so.1: cannot open shared object file: No such file or directory
[576627:1228/094247.278189:ERROR:gl_display.cc(920)] eglInitialize OpenGLES failed with error EGL_NOT_INITIALIZED
[576627:1228/094247.278249:ERROR:gl_ozone_egl.cc(23)] GLDisplayEGL::Initialize failed.
[576627:1228/094247.280307:ERROR:viz_main_impl.cc(186)] Exiting GPU process due to errors during initialization
[576635:1228/094247.310049:ERROR:angle_platform_impl.cc(43)] Display.cpp:1004 (initialize): ANGLE Display::initialize error 12289: Could not dlopen libGL.so.1: libGL.so.1: cannot open shared object file: No such file or directory
ERR: Display.cpp:1004 (initialize): ANGLE Display::initialize error 12289: Could not dlopen libGL.so.1: libGL.so.1: cannot open shared object file: No such file or directory
[576635:1228/094247.310278:ERROR:gl_display.cc(508)] EGL Driver message (Critical) eglInitialize: Could not dlopen libGL.so.1: libGL.so.1: cannot open shared object file: No such file or directory
[576635:1228/094247.310378:ERROR:gl_display.cc(920)] eglInitialize OpenGL failed with error EGL_NOT_INITIALIZED, trying next display type
[576635:1228/094247.310574:ERROR:angle_platform_impl.cc(43)] Display.cpp:1004 (initialize): ANGLE Display::initialize error 12289: Could not dlopen libGL.so.1: libGL.so.1: cannot open shared object file: No such file or directory
ERR: Display.cpp:1004 (initialize): ANGLE Display::initialize error 12289: Could not dlopen libGL.so.1: libGL.so.1: cannot open shared object file: No such file or directory
[576635:1228/094247.310656:ERROR:gl_display.cc(508)] EGL Driver message (Critical) eglInitialize: Could not dlopen libGL.so.1: libGL.so.1: cannot open shared object file: No such file or directory
[576635:1228/094247.310727:ERROR:gl_display.cc(920)] eglInitialize OpenGLES failed with error EGL_NOT_INITIALIZED
[576635:1228/094247.310793:ERROR:gl_ozone_egl.cc(23)] GLDisplayEGL::Initialize failed.
[576635:1228/094247.313440:ERROR:viz_main_impl.cc(186)] Exiting GPU process due to errors during initialization
^C

Any ideas what I do next?