Packaging an Electron App

Hi! I was interested in trying this “FOSS Discord clone”, and found that’s an electron app (what a surprise!). I tried using yarn2nix and element-desktop as references, but i’m not a JS guy and idk how can i handle those errors related to package.json (i guess).

default.nix

with (import <nixpkgs> {});
rec {
  revolt = mkYarnPackage {
    name = "revolt";
    src = ./.;
    packageJSON = ./package.json;
    yarnLock = ./yarn.lock;

    buildPhase = ''
      runHook preBuild
      yarn
      yarn build:bundle
      yarn start
      runHook postBuild
    '';
  };
}

Errors:

building '/nix/store/fjbzq61v5p3zim7d3h3zkv7m0hzpjam4-yarn.nix.drv'...
/nix/store/df54xs8v7i74bm0zn84c6zlfmzd7gb64-yarn2nix-1.0.0/libexec/yarn2nix/node_modules/@yarnpkg/lockfile/index.js:5064
    throw new SyntaxError(`${msg} ${this.token.line}:${this.token.col} in ${this.fileLoc}`);
    ^

SyntaxError: Unknown token: { line: 3, col: 2, type: 'INVALID', value: undefined } 3:2 in lockfile
    at Parser.unexpected (/nix/store/df54xs8v7i74bm0zn84c6zlfmzd7gb64-yarn2nix-1.0.0/libexec/yarn2nix/node_modules/@yarnpkg/lockfile/index.js:5064:11)
    at Parser.parse (/nix/store/df54xs8v7i74bm0zn84c6zlfmzd7gb64-yarn2nix-1.0.0/libexec/yarn2nix/node_modules/@yarnpkg/lockfile/index.js:5193:14)
    at parse (/nix/store/df54xs8v7i74bm0zn84c6zlfmzd7gb64-yarn2nix-1.0.0/libexec/yarn2nix/node_modules/@yarnpkg/lockfile/index.js:5262:17)
    at Object.module.exports.exports.default (/nix/store/df54xs8v7i74bm0zn84c6zlfmzd7gb64-yarn2nix-1.0.0/libexec/yarn2nix/node_modules/@yarnpkg/lockfile/index.js:4835:96)
    at Object.<anonymous> (/nix/store/df54xs8v7i74bm0zn84c6zlfmzd7gb64-yarn2nix-1.0.0/libexec/yarn2nix/deps/yarn2nix/bin/yarn2nix.js:48:23)
    at Module._compile (node:internal/modules/cjs/loader:1105:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
error: builder for '/nix/store/fjbzq61v5p3zim7d3h3zkv7m0hzpjam4-yarn.nix.drv' failed with exit code 1;
       last 10 log lines:
       >     at Parser.unexpected (/nix/store/df54xs8v7i74bm0zn84c6zlfmzd7gb64-yarn2nix-1.0.0/libexec/yarn2nix/node_modules/@yarnpkg/lockfile/index.js:5064:11)
       >     at Parser.parse (/nix/store/df54xs8v7i74bm0zn84c6zlfmzd7gb64-yarn2nix-1.0.0/libexec/yarn2nix/node_modules/@yarnpkg/lockfile/index.j
s:5193:14)
       >     at parse (/nix/store/df54xs8v7i74bm0zn84c6zlfmzd7gb64-yarn2
nix-1.0.0/libexec/yarn2nix/node_modules/@yarnpkg/lockfile/index.js:5262:17)
       >     at Object.module.exports.exports.default (/nix/store/df54xs8v7i74bm0zn84c6zlfmzd7gb64-yarn2nix-1.0.0/libexec/yarn2nix/node_modules/@yarnpkg/lockfile/index.js:4835:96)
       >     at Object.<anonymous> (/nix/store/df54xs8v7i74bm0zn84c6zlfmzd7gb64-yarn2nix-1.0.0/libexec/yarn2nix/deps/yarn2nix/bin/yarn2nix.js:48:23)
       >     at Module._compile (node:internal/modules/cjs/loader:1105:14)
       >     at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
       >     at Module.load (node:internal/modules/cjs/loader:981:32)
       >     at Function.Module._load (node:internal/modules/cjs/loader:822:12)
       >     at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
       For full logs, run 'nix log /nix/store/fjbzq61v5p3zim7d3h3zkv7m0hzpjam4-yarn.nix.drv'.
(use '--show-trace' to show detailed location information)

Any ideas?
Thanks in advance