Standardnotes 3.191.4 fails to build

I build a custom package on my NixOS aarch64 machine of the open source Standard Notes app in order to be able to upgrade directly as new versions are released as the version in nixpkgs is not updated very often.

I have not been able to upgrade past version 3.181.32 because newer versions fail with a build error. I tried again today with version 3.191.4 and received the same build error, which is:

building the system configuration...
error: builder for '/nix/store/flm9h14rq9msa0lxdbm5ci9hkxz61v16-standardnotes-3.191.4.drv' failed with exit code 1;
       last 6 log lines:
       > Running phase: unpackPhase
       > Running phase: patchPhase
       > Running phase: updateAutotoolsGnuConfigScriptsPhase
       > Updating Autotools / GNU config script to a newer upstream version: ./opt/Standard
       > Updating Autotools / GNU config script to a newer upstream version: Notes/resources/app.asar.unpacked/node_modules/sqlite3/build/Release/obj/gen/sqlite-autoconf-3410100/config.sub
       > cp: cannot create regular file 'Notes/resources/app.asar.unpacked/node_modules/sqlite3/build/Release/obj/gen/sqlite-autoconf-3410100/config.sub': No such file or directory
       For full logs, run 'nix log /nix/store/flm9h14rq9msa0lxdbm5ci9hkxz61v16-standardnotes-3.191.4.drv'.

Here is my derivation.nix file, I based it on the derivation in nixpkgs (here) which wraps the .deb build.

{ lib, stdenv, fetchurl, dpkg, makeWrapper, electron, libsecret
, desktop-file-utils , callPackage }:

let

  srcjson = builtins.fromJSON (builtins.readFile ./src.json);

  throwSystem = throw "Unsupported system: ${stdenv.hostPlatform.system}";

in

stdenv.mkDerivation rec {

  pname = "standardnotes";

  src = fetchurl (srcjson.deb.${stdenv.hostPlatform.system} or throwSystem);

  inherit (srcjson) version;

  dontConfigure = true;

  dontBuild = true;

  nativeBuildInputs = [ makeWrapper dpkg desktop-file-utils ];

  unpackPhase = "dpkg-deb --fsys-tarfile $src | tar -x --no-same-permissions --no-same-owner";

  installPhase = ''
    runHook preInstall

    mkdir -p $out/bin $out/share/standardnotes

    cp -R usr/share/{applications,icons} $out/share
    cp -R opt/Standard\ Notes/resources/app.asar $out/share/standardnotes/

    makeWrapper ${electron}/bin/electron $out/bin/standardnotes \
      --add-flags $out/share/standardnotes/app.asar \
      --prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ libsecret stdenv.cc.cc.lib ]}

    ${desktop-file-utils}/bin/desktop-file-install --dir $out/share/applications \
      --set-key Exec --set-value standardnotes usr/share/applications/standard-notes.desktop

    runHook postInstall
  '';

  meta = with lib; {
    description = "A simple and private notes app";
    longDescription = ''
      Standard Notes is a private notes app that features unmatched simplicity,
      end-to-end encryption, powerful extensions, and open-source applications.
    '';
    homepage = "https://standardnotes.org";
    license = licenses.agpl3;
    maintainers = with maintainers; [ mgregoire chuangzhu squalus ];
    sourceProvenance = [ sourceTypes.binaryNativeCode ];
    platforms = builtins.attrNames srcjson.deb;
    mainProgram = "standardnotes";
  };
}

I have unpacked the standard-notes-3.191.4-linux-arm64.deb file using dpkg --contents:

^ more above
drwxr-xr-x 0/0               0 2024-02-21 08:45 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/
drwxr-xr-x 0/0               0 2024-02-21 08:45 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/cbor-extract/
drwxr-xr-x 0/0               0 2024-02-21 08:45 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/cbor-extract/src/
-rw-r--r-- 0/0            6010 2024-02-21 08:37 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/cbor-extract/src/extract.cpp
-rw-r--r-- 0/0             977 2024-02-21 08:45 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/cbor-extract/package.json
-rw-r--r-- 0/0              72 2024-02-21 08:37 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/cbor-extract/index.js
-rw-r--r-- 0/0            1065 2024-02-21 08:37 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/cbor-extract/LICENSE
drwxr-xr-x 0/0               0 2024-02-21 08:45 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/cbor-extract/bin/
-rwxr-xr-x 0/0             290 2024-02-21 08:37 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/cbor-extract/bin/download-prebuilds.js
drwxr-xr-x 0/0               0 2024-02-21 08:45 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/cbor-extract/bin/linux-x64-118/
-rwxr-xr-x 0/0           16584 2024-02-21 08:38 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/cbor-extract/bin/linux-x64-118/cbor-extract.node
drwxr-xr-x 0/0               0 2024-02-21 08:45 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/cbor-extract/build/
drwxr-xr-x 0/0               0 2024-02-21 08:45 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/cbor-extract/build/Release/
-rwxr-xr-x 0/0           16584 2024-02-21 08:38 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/cbor-extract/build/Release/extract.node
drwxr-xr-x 0/0               0 2024-02-21 08:45 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/cbor-extract/build/node_gyp_bins/
lrwxrwxrwx 0/0               0 2024-02-21 08:38 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/cbor-extract/build/node_gyp_bins/python3 -> /opt/hostedtoolcache/Python/3.10.13/x64/bin/python3
drwxr-xr-x 0/0               0 2024-02-21 08:45 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/sqlite3/
drwxr-xr-x 0/0               0 2024-02-21 08:45 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/sqlite3/deps/
-rw-r--r-- 0/0            1322 2024-02-21 08:37 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/sqlite3/deps/common-sqlite.gypi
-rw-r--r-- 0/0         3125153 2024-02-21 08:37 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/sqlite3/deps/sqlite-autoconf-3410100.tar.gz
-rw-r--r-- 0/0             224 2024-02-21 08:37 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/sqlite3/deps/extract.js
-rwxr-xr-x 0/0            3021 2024-02-21 08:37 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/sqlite3/deps/sqlite3.gyp
drwxr-xr-x 0/0               0 2024-02-21 08:45 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/sqlite3/src/
-rw-r--r-- 0/0            1952 2024-02-21 08:37 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/sqlite3/src/async.h
-rw-r--r-- 0/0             861 2024-02-21 08:37 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/sqlite3/src/gcc-preinclude.h
-rw-r--r-- 0/0           12074 2024-02-21 08:37 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/sqlite3/src/macros.h
-rw-r--r-- 0/0            6028 2024-02-21 08:37 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/sqlite3/src/database.h
-rw-r--r-- 0/0            7058 2024-02-21 08:37 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/sqlite3/src/backup.h
-rw-r--r-- 0/0            6644 2024-02-21 08:37 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/sqlite3/src/statement.h
-rw-r--r-- 0/0             388 2024-02-21 08:37 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/sqlite3/src/threading.h
-rw-r--r-- 0/0            1380 2024-02-21 08:45 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/sqlite3/package.json
drwxr-xr-x 0/0               0 2024-02-21 08:45 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/sqlite3/lib/
-rw-r--r-- 0/0            6365 2024-02-21 08:37 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/sqlite3/lib/sqlite3.js
-rw-r--r-- 0/0             241 2024-02-21 08:37 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/sqlite3/lib/sqlite3-binding.js
drwxr-xr-x 0/0               0 2024-02-21 08:45 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/sqlite3/lib/binding/
drwxr-xr-x 0/0               0 2024-02-21 08:45 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/sqlite3/lib/binding/napi-v{napi_build_version}-linux-glibc-x64/
-rwxr-xr-x 0/0         2182224 2024-02-21 08:39 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/sqlite3/lib/binding/napi-v{napi_build_version}-linux-glibc-x64/node_sqlite3.node
drwxr-xr-x 0/0               0 2024-02-21 08:45 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/sqlite3/lib/binding/napi-v6-linux-glibc-arm64/
-rwxr-xr-x 0/0         1979984 2023-03-15 02:21 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/sqlite3/lib/binding/napi-v6-linux-glibc-arm64/node_sqlite3.node
drwxr-xr-x 0/0               0 2024-02-21 08:45 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/sqlite3/lib/binding/napi-v6-linux-glibc-x64/
-rwxr-xr-x 0/0         2158008 2023-03-15 01:50 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/sqlite3/lib/binding/napi-v6-linux-glibc-x64/node_sqlite3.node
-rw-r--r-- 0/0            1357 2024-02-21 08:37 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/sqlite3/lib/trace.js
drwxr-xr-x 0/0               0 2024-02-21 08:45 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/sqlite3/node-addon-api/
-rw-r--r-- 0/0             145 2024-02-21 08:38 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/sqlite3/node-addon-api/node_api.Makefile
-rw-r--r-- 0/0            1460 2024-02-21 08:37 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/sqlite3/LICENSE
drwxr-xr-x 0/0               0 2024-02-21 08:45 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/sqlite3/bin/
drwxr-xr-x 0/0               0 2024-02-21 08:45 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/sqlite3/bin/linux-x64-118/
-rwxr-xr-x 0/0         2182224 2024-02-21 08:39 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/sqlite3/bin/linux-x64-118/sqlite3.node
drwxr-xr-x 0/0               0 2024-02-21 08:45 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/sqlite3/build/
drwxr-xr-x 0/0               0 2024-02-21 08:45 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/sqlite3/build/deps/
-rw-r--r-- 0/0             146 2024-02-21 08:38 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/sqlite3/build/deps/sqlite3.Makefile
drwxr-xr-x 0/0               0 2024-02-21 08:45 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/sqlite3/build/Release/
hrwxr-xr-x 0/0               0 2024-02-21 08:39 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/sqlite3/build/Release/node_sqlite3.node link to ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/sqlite3/lib/binding/napi-v{napi_build_version}-linux-glibc-x64/node_sqlite3.node
drwxr-xr-x 0/0               0 2024-02-21 08:45 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/sqlite3/build/Release/obj/
drwxr-xr-x 0/0               0 2024-02-21 08:45 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/sqlite3/build/Release/obj/gen/
drwxr-xr-x 0/0               0 2024-02-21 08:45 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/sqlite3/build/Release/obj/gen/sqlite-autoconf-3410100/
-rwxr-xr-x 0/0            6878 2023-03-11 02:59 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/sqlite3/build/Release/obj/gen/sqlite-autoconf-3410100/missing
-rw-r--r-- 0/0             267 2023-03-11 02:59 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/sqlite3/build/Release/obj/gen/sqlite-autoconf-3410100/sqlite3.pc.in
-rwxr-xr-x 0/0          327299 2023-03-11 02:59 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/sqlite3/build/Release/obj/gen/sqlite-autoconf-3410100/ltmain.sh
drwxr-xr-x 0/0               0 2024-02-21 08:45 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/sqlite3/build/Release/obj/gen/sqlite-autoconf-3410100/tea/
drwxr-xr-x 0/0               0 2024-02-21 08:45 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/sqlite3/build/Release/obj/gen/sqlite-autoconf-3410100/tea/generic/
-rw-r--r-- 0/0          127534 2023-03-11 02:59 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/sqlite3/build/Release/obj/gen/sqlite-autoconf-3410100/tea/generic/tclsqlite3.c
-rw-r--r-- 0/0             334 2023-03-11 02:59 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/sqlite3/build/Release/obj/gen/sqlite-autoconf-3410100/tea/pkgIndex.tcl.in
-rw-r--r-- 0/0            9128 2023-03-11 02:59 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/sqlite3/build/Release/obj/gen/sqlite-autoconf-3410100/tea/configure.ac
drwxr-xr-x 0/0               0 2024-02-21 08:45 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/sqlite3/build/Release/obj/gen/sqlite-autoconf-3410100/tea/tclconfig/
-rw-r--r-- 0/0          132584 2023-03-11 02:59 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/sqlite3/build/Release/obj/gen/sqlite-autoconf-3410100/tea/tclconfig/tcl.m4
-rw-r--r-- 0/0           13868 2023-03-11 02:59 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/sqlite3/build/Release/obj/gen/sqlite-autoconf-3410100/tea/tclconfig/install-sh
drwxr-xr-x 0/0               0 2024-02-21 08:45 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/sqlite3/build/Release/obj/gen/sqlite-autoconf-3410100/tea/win/
-rw-r--r-- 0/0           18743 2023-03-11 02:59 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/sqlite3/build/Release/obj/gen/sqlite-autoconf-3410100/tea/win/rules.vc
-rw-r--r-- 0/0           21125 2023-03-11 02:59 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/sqlite3/build/Release/obj/gen/sqlite-autoconf-3410100/tea/win/nmakehlp.c
-rw-r--r-- 0/0           14816 2023-03-11 02:59 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/sqlite3/build/Release/obj/gen/sqlite-autoconf-3410100/tea/win/makefile.vc
-rwxr-xr-x 0/0          281929 2023-03-11 02:59 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/sqlite3/build/Release/obj/gen/sqlite-autoconf-3410100/tea/configure
-rw-r--r-- 0/0           17319 2023-03-11 02:59 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/sqlite3/build/Release/obj/gen/sqlite-autoconf-3410100/tea/Makefile.in
-rw-r--r-- 0/0             257 2023-03-11 02:59 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/sqlite3/build/Release/obj/gen/sqlite-autoconf-3410100/tea/license.terms
drwxr-xr-x 0/0               0 2024-02-21 08:45 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/sqlite3/build/Release/obj/gen/sqlite-autoconf-3410100/tea/doc/
-rw-r--r-- 0/0             494 2023-03-11 02:59 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/sqlite3/build/Release/obj/gen/sqlite-autoconf-3410100/tea/doc/sqlite3.n
-rw-r--r-- 0/0            1338 2023-03-11 02:59 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/sqlite3/build/Release/obj/gen/sqlite-autoconf-3410100/tea/README
-rw-r--r-- 0/0             147 2023-03-11 02:59 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/sqlite3/build/Release/obj/gen/sqlite-autoconf-3410100/tea/aclocal.m4
-rw-r--r-- 0/0            8742 2023-03-11 02:59 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/sqlite3/build/Release/obj/gen/sqlite-autoconf-3410100/configure.ac
-rw-r--r-- 0/0         8668959 2023-03-11 02:59 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/sqlite3/build/Release/obj/gen/sqlite-autoconf-3410100/sqlite3.c
-rw-r--r-- 0/0             547 2023-03-11 02:59 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/sqlite3/build/Release/obj/gen/sqlite-autoconf-3410100/Makefile.fallback
-rw-r--r-- 0/0            7272 2023-03-11 02:59 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/sqlite3/build/Release/obj/gen/sqlite-autoconf-3410100/Replace.cs
-rwxr-xr-x 0/0           35406 2023-03-11 02:59 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/sqlite3/build/Release/obj/gen/sqlite-autoconf-3410100/config.sub
-rwxr-xr-x 0/0          497049 2023-03-11 02:59 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/sqlite3/build/Release/obj/gen/sqlite-autoconf-3410100/configure
-rw-r--r-- 0/0           38354 2023-03-11 02:59 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/sqlite3/build/Release/obj/gen/sqlite-autoconf-3410100/Makefile.in
-rw-r--r-- 0/0            1992 2023-03-11 02:59 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/sqlite3/build/Release/obj/gen/sqlite-autoconf-3410100/sqlite3.rc
-rw-r--r-- 0/0            3555 2023-03-11 02:59 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/sqlite3/build/Release/obj/gen/sqlite-autoconf-3410100/README.txt
-rw-r--r-- 0/0           28818 2023-03-11 02:59 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/sqlite3/build/Release/obj/gen/sqlite-autoconf-3410100/Makefile.msc
-rw-r--r-- 0/0          620239 2023-03-11 02:59 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/sqlite3/build/Release/obj/gen/sqlite-autoconf-3410100/sqlite3.h
-rwxr-xr-x 0/0           15358 2023-03-11 02:59 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/sqlite3/build/Release/obj/gen/sqlite-autoconf-3410100/install-sh
-rwxr-xr-x 0/0            7400 2023-03-11 02:59 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/sqlite3/build/Release/obj/gen/sqlite-autoconf-3410100/compile
-rwxr-xr-x 0/0           23568 2023-03-11 02:59 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/sqlite3/build/Release/obj/gen/sqlite-autoconf-3410100/depcomp
-rwxr-xr-x 0/0           49482 2023-03-11 02:59 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/sqlite3/build/Release/obj/gen/sqlite-autoconf-3410100/config.guess
-rw-r--r-- 0/0            8928 2023-03-11 02:59 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/sqlite3/build/Release/obj/gen/sqlite-autoconf-3410100/sqlite3.1
-rw-r--r-- 0/0          854289 2023-03-11 02:59 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/sqlite3/build/Release/obj/gen/sqlite-autoconf-3410100/shell.c
-rw-r--r-- 0/0              78 2023-03-11 02:59 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/sqlite3/build/Release/obj/gen/sqlite-autoconf-3410100/sqlite3rc.h
-rw-r--r-- 0/0             729 2023-03-11 02:59 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/sqlite3/build/Release/obj/gen/sqlite-autoconf-3410100/Makefile.am
-rw-r--r-- 0/0          373506 2023-03-11 02:59 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/sqlite3/build/Release/obj/gen/sqlite-autoconf-3410100/aclocal.m4
-rw-r--r-- 0/0           15744 2023-03-11 02:59 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/sqlite3/build/Release/obj/gen/sqlite-autoconf-3410100/INSTALL
-rw-r--r-- 0/0           37660 2023-03-11 02:59 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/sqlite3/build/Release/obj/gen/sqlite-autoconf-3410100/sqlite3ext.h
drwxr-xr-x 0/0               0 2024-02-21 08:45 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/sqlite3/build/Release/node-addon-api/
-rw-r--r-- 0/0              55 2024-02-21 08:38 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/sqlite3/build/Release/node-addon-api/nothing.a.ar-file-list
drwxr-xr-x 0/0               0 2024-02-21 08:45 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/sqlite3/build/node_gyp_bins/
lrwxrwxrwx 0/0               0 2024-02-21 08:38 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/sqlite3/build/node_gyp_bins/python3 -> /opt/hostedtoolcache/Python/3.10.13/x64/bin/python3
drwxr-xr-x 0/0               0 2024-02-21 08:45 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/microtime/
-rw-r--r-- 0/0             688 2024-02-21 08:45 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/microtime/package.json
-rw-r--r-- 0/0              54 2024-02-21 08:37 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/microtime/index.js
-rw-r--r-- 0/0            1072 2024-02-21 08:37 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/microtime/LICENSE
drwxr-xr-x 0/0               0 2024-02-21 08:45 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/microtime/prebuilds/
drwxr-xr-x 0/0               0 2024-02-21 08:45 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/microtime/prebuilds/darwin-x64+arm64/
-rwxr-xr-x 0/0          119792 2024-02-21 08:37 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/microtime/prebuilds/darwin-x64+arm64/electron.napi.node
-rwxr-xr-x 0/0          119792 2024-02-21 08:37 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/microtime/prebuilds/darwin-x64+arm64/node.napi.node
drwxr-xr-x 0/0               0 2024-02-21 08:45 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/microtime/prebuilds/linux-arm64/
-rwxr-xr-x 0/0           35520 2024-02-21 08:37 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/microtime/prebuilds/linux-arm64/node.napi.armv8.node
drwxr-xr-x 0/0               0 2024-02-21 08:45 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/microtime/prebuilds/win32-ia32/
-rwxr-xr-x 0/0          509440 2024-02-21 08:37 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/microtime/prebuilds/win32-ia32/electron.napi.node
-rwxr-xr-x 0/0          509440 2024-02-21 08:37 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/microtime/prebuilds/win32-ia32/node.napi.node
drwxr-xr-x 0/0               0 2024-02-21 08:45 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/microtime/prebuilds/linux-x64/
-rwxr-xr-x 0/0           39816 2024-02-21 08:37 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/microtime/prebuilds/linux-x64/electron.napi.node
-rwxr-xr-x 0/0           39816 2024-02-21 08:37 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/microtime/prebuilds/linux-x64/node.napi.node
drwxr-xr-x 0/0               0 2024-02-21 08:45 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/microtime/prebuilds/win32-x64/
-rwxr-xr-x 0/0          670208 2024-02-21 08:37 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/microtime/prebuilds/win32-x64/electron.napi.node
-rwxr-xr-x 0/0          670208 2024-02-21 08:37 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/microtime/prebuilds/win32-x64/node.napi.node
drwxr-xr-x 0/0               0 2024-02-21 08:45 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/microtime/prebuilds/linux-arm/
-rwxr-xr-x 0/0           22304 2024-02-21 08:37 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/microtime/prebuilds/linux-arm/node.napi.armv7.node
drwxr-xr-x 0/0               0 2024-02-21 08:45 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/microtime/build/
drwxr-xr-x 0/0               0 2024-02-21 08:45 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/microtime/build/Release/
-rwxr-xr-x 0/0           51448 2024-02-21 08:45 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/microtime/build/Release/microtime.node
drwxr-xr-x 0/0               0 2024-02-21 08:45 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/microtime/build/node_gyp_bins/
lrwxrwxrwx 0/0               0 2024-02-21 08:45 ./opt/Standard Notes/resources/app.asar.unpacked/node_modules/microtime/build/node_gyp_bins/python3 -> /opt/hostedtoolcache/Python/3.10.13/x64/bin/python3
-rw-r--r-- 0/0             107 2024-02-21 08:45 ./opt/Standard Notes/resources/app-update.yml
-rw-r--r-- 0/0       189378961 2024-02-21 08:45 ./opt/Standard Notes/resources/app.asar
-rw-r--r-- 0/0               3 2024-02-21 08:45 ./opt/Standard Notes/resources/package-type
-rw-r--r-- 0/0         5499620 2024-02-21 08:45 ./opt/Standard Notes/resources.pak
drwxr-xr-x 0/0               0 2024-02-21 08:45 ./opt/Standard Notes/locales/
-rw-r--r-- 0/0          544118 2024-02-21 08:45 ./opt/Standard Notes/locales/hu.pak
-rw-r--r-- 0/0          527179 2024-02-21 08:45 ./opt/Standard Notes/locales/pl.pak
-rw-r--r-- 0/0          546408 2024-02-21 08:45 ./opt/Standard Notes/locales/lv.pak
-rw-r--r-- 0/0          653522 2024-02-21 08:45 ./opt/Standard Notes/locales/he.pak
-rw-r--r-- 0/0          501414 2024-02-21 08:45 ./opt/Standard Notes/locales/es-419.pak
-rw-r--r-- 0/0          505925 2024-02-21 08:45 ./opt/Standard Notes/locales/de.pak
-rw-r--r-- 0/0          974460 2024-02-21 08:45 ./opt/Standard Notes/locales/th.pak
-rw-r--r-- 0/0         1060145 2024-02-21 08:45 ./opt/Standard Notes/locales/gu.pak
-rw-r--r-- 0/0          789531 2024-02-21 08:45 ./opt/Standard Notes/locales/sr.pak
-rw-r--r-- 0/0          584850 2024-02-21 08:45 ./opt/Standard Notes/locales/vi.pak
-rw-r--r-- 0/0          803666 2024-02-21 08:45 ./opt/Standard Notes/locales/ar.pak
-rw-r--r-- 0/0          549210 2024-02-21 08:45 ./opt/Standard Notes/locales/lt.pak
-rw-r--r-- 0/0          451541 2024-02-21 08:45 ./opt/Standard Notes/locales/af.pak
-rw-r--r-- 0/0          603773 2024-02-21 08:45 ./opt/Standard Notes/locales/ja.pak
-rw-r--r-- 0/0         1114435 2024-02-21 08:45 ./opt/Standard Notes/locales/hi.pak
-rw-r--r-- 0/0          532162 2024-02-21 08:45 ./opt/Standard Notes/locales/sk.pak
-rw-r--r-- 0/0         1157594 2024-02-21 08:45 ./opt/Standard Notes/locales/te.pak
-rw-r--r-- 0/0          418276 2024-02-21 08:45 ./opt/Standard Notes/locales/zh-TW.pak
-rw-r--r-- 0/0          523187 2024-02-21 08:45 ./opt/Standard Notes/locales/cs.pak
-rw-r--r-- 0/0          524995 2024-02-21 08:45 ./opt/Standard Notes/locales/fil.pak
-rw-r--r-- 0/0          745956 2024-02-21 08:45 ./opt/Standard Notes/locales/fa.pak
-rw-r--r-- 0/0          415979 2024-02-21 08:45 ./opt/Standard Notes/locales/en-US.pak
-rw-r--r-- 0/0          493806 2024-02-21 08:45 ./opt/Standard Notes/locales/tr.pak
-rw-r--r-- 0/0          735462 2024-02-21 08:45 ./opt/Standard Notes/locales/am.pak
-rw-r--r-- 0/0          845755 2024-02-21 08:45 ./opt/Standard Notes/locales/uk.pak
-rw-r--r-- 0/0          412667 2024-02-21 08:45 ./opt/Standard Notes/locales/en-GB.pak
-rw-r--r-- 0/0          469443 2024-02-21 08:45 ./opt/Standard Notes/locales/ms.pak
-rw-r--r-- 0/0          515690 2024-02-21 08:45 ./opt/Standard Notes/locales/ro.pak
-rw-r--r-- 0/0         1081054 2024-02-21 08:45 ./opt/Standard Notes/locales/bn.pak
-rw-r--r-- 0/0         1252194 2024-02-21 08:45 ./opt/Standard Notes/locales/ta.pak
-rw-r--r-- 0/0          509875 2024-02-21 08:45 ./opt/Standard Notes/locales/ko.pak
-rw-r--r-- 0/0          501007 2024-02-21 08:45 ./opt/Standard Notes/locales/es.pak
-rw-r--r-- 0/0          463850 2024-02-21 08:45 ./opt/Standard Notes/locales/fi.pak
-rw-r--r-- 0/0          505871 2024-02-21 08:45 ./opt/Standard Notes/locales/hr.pak
-rw-r--r-- 0/0          496831 2024-02-21 08:45 ./opt/Standard Notes/locales/pt-PT.pak
-rw-r--r-- 0/0          447868 2024-02-21 08:45 ./opt/Standard Notes/locales/id.pak
-rw-r--r-- 0/0          422306 2024-02-21 08:45 ./opt/Standard Notes/locales/zh-CN.pak
-rw-r--r-- 0/0          495618 2024-02-21 08:45 ./opt/Standard Notes/locales/pt-BR.pak
-rw-r--r-- 0/0          459232 2024-02-21 08:45 ./opt/Standard Notes/locales/sv.pak
-rw-r--r-- 0/0         1215602 2024-02-21 08:45 ./opt/Standard Notes/locales/kn.pak
-rw-r--r-- 0/0         1265435 2024-02-21 08:45 ./opt/Standard Notes/locales/ml.pak
-rw-r--r-- 0/0          471508 2024-02-21 08:45 ./opt/Standard Notes/locales/nl.pak
-rw-r--r-- 0/0          739685 2024-02-21 08:45 ./opt/Standard Notes/locales/ur.pak
-rw-r--r-- 0/0          508523 2024-02-21 08:45 ./opt/Standard Notes/locales/ca.pak
-rw-r--r-- 0/0         1039382 2024-02-21 08:45 ./opt/Standard Notes/locales/mr.pak
-rw-r--r-- 0/0          916984 2024-02-21 08:45 ./opt/Standard Notes/locales/el.pak
-rw-r--r-- 0/0          457053 2024-02-21 08:45 ./opt/Standard Notes/locales/nb.pak
-rw-r--r-- 0/0          511673 2024-02-21 08:45 ./opt/Standard Notes/locales/sl.pak
-rw-r--r-- 0/0          494512 2024-02-21 08:45 ./opt/Standard Notes/locales/it.pak
-rw-r--r-- 0/0          453926 2024-02-21 08:45 ./opt/Standard Notes/locales/et.pak
-rw-r--r-- 0/0          543070 2024-02-21 08:45 ./opt/Standard Notes/locales/fr.pak
-rw-r--r-- 0/0          846649 2024-02-21 08:45 ./opt/Standard Notes/locales/ru.pak
-rw-r--r-- 0/0          483799 2024-02-21 08:45 ./opt/Standard Notes/locales/sw.pak
-rw-r--r-- 0/0          837594 2024-02-21 08:45 ./opt/Standard Notes/locales/bg.pak
-rw-r--r-- 0/0          473489 2024-02-21 08:45 ./opt/Standard Notes/locales/da.pak
drwxr-xr-x 0/0               0 2024-02-21 08:45 ./usr/
drwxr-xr-x 0/0               0 2024-02-21 08:45 ./usr/share/
drwxr-xr-x 0/0               0 2024-02-21 08:45 ./usr/share/icons/
drwxr-xr-x 0/0               0 2024-02-21 08:45 ./usr/share/icons/hicolor/
drwxr-xr-x 0/0               0 2024-02-21 08:45 ./usr/share/icons/hicolor/512x512/
drwxr-xr-x 0/0               0 2024-02-21 08:45 ./usr/share/icons/hicolor/512x512/apps/
-rw-r--r-- 0/0           15785 2024-02-21 08:37 ./usr/share/icons/hicolor/512x512/apps/standard-notes.png
drwxr-xr-x 0/0               0 2024-02-21 08:45 ./usr/share/doc/
drwxr-xr-x 0/0               0 2024-02-21 08:45 ./usr/share/doc/standard-notes/
-rw-r--r-- 0/0             148 2024-02-21 08:45 ./usr/share/doc/standard-notes/changelog.gz
drwxr-xr-x 0/0               0 2024-02-21 08:45 ./usr/share/applications/
-rw-r--r-- 0/0             300 2024-02-21 08:45 ./usr/share/applications/standard-notes.desktop

The failing builds error message appears to show it is breaking up the particular path inside the .deb file into two parts. However I have viewed the contents of the .deb. file for version 3.181.32 which does build and it also has pathes that start with /opt/Standard Notes/ where there is no backslash after “Standard”.

Is anyone able to please help me figure out what the issue is and how to get it building successfully? :slight_smile:

Update: Simplified by patching the phases from nixpkgs.

@kereru I just got the latest release working. Haven’t cleaned it up yet as I just wanted to get it working. I can probably simplify with an overload of nixpkgs. It is an overlay which pretty closely mirrors nixpkgs unstable and I use nvfetcher to stay up to date.

The error you are seeing is because whatever is triggering updateAutotoolsGnuConfigScriptsPhase is not handling the space in “Standard Notes”. I am pretty new to Nix, so no idea why that is happening yet, but the quick hack was to rename the directory after unpacking. I had to update the install phase to handle that.

I also had to pin it to electron 27 or nothing would display. This is the dependency version in the node package: app/packages/desktop/package.json at 4b19076f9b549a00c98eca8e1c35ee0d62e05155 · standardnotes/app · GitHub.

My repo is pretty messy as I work towards my first working daily driver, but the full implementation is here: nixos-config/overlays/standardnotes-overlay.nix at 22fb58af5348684ceb2f612af54afa47840059db · higherorderfunctor/nixos-config · GitHub

_: (final: prev: let
  systemMap = {
    x86_64-linux = "linux-amd64";
    aarch64-linux = "linux-arm64";
  };
  nv = (import ./nvpkgs.nix)."standardnotes-${systemMap.${final.system}}-deb";
in {
  standardnotes = (prev.standardnotes.override {electron = final.electron_27;}).overrideAttrs (attrs: {
    inherit (nv) version;

    src = final.fetchurl {
      inherit (nv.src) url sha256;
      name = "${nv.name}-${nv.version}.deb";
    };

    unpackPhase = ''
      ${attrs.unpackPhase}
      mv opt/Standard\ Notes opt/standardnotes
    '';

    installPhase =
      builtins.replaceStrings
      ["Standard\\ Notes"]
      ["standardnotes"]
      attrs.installPhase;
  });
})

Hi @obliged5595!

Nice to know there is someone else out there trying to get the latest release running on their NixOS system!

Okay, nice one! Thanks for posting here. I had a go modifying my config with the same changes you have made (looked at your latest version in your github :-)) and it does build but then it does not run when launched :frowning:

Uncaught Exception:
Error: ENOENT: no such file or directory, open '/nix/store/6vwkhz5wia4yjb17lz1yz8npgk6mffpb-standardnotes-3.194.0/share/standardnotes/app.asar.unpacked/node_modules/microtime/package.json'
    at Object.openSync (node:fs:603:3)
    at Object.func [as openSync] (node:electron/js2c/node_init:2:2107)
    at Object.readFileSync (node:fs:471:35)
    at Object.readFileSync (node:electron/js2c/node_init:2:9456)
    at BaseObject.internalModuleReadJSON (node:electron/js2c/node_init:2:11687)
    at Object.read (node:internal/modules/package_json_reader:21:60)
    at readPackage (node:internal/modules/cjs/loader:377:36)
    at resolveExports (node:internal/modules/cjs/loader:571:15)
    at Function._findPath (node:internal/modules/cjs/loader:643:31)
    at node:internal/modules/cjs/loader:1070:27
DRI driver not from this Mesa build ('24.1.0-devel' vs '24.0.5')
failed to bind extensions
DRI driver not from this Mesa build ('24.1.0-devel' vs '24.0.5')
failed to bind extensions
DRI driver not from this Mesa build ('24.1.0-devel' vs '24.0.5')
failed to bind extensions

I have tried updating the line that copy’s the app.asar to instead copy everything which does result in that file being there but a new error message is then thrown