I’ve been trying all day to get a node/React app (https://github.com/dekkerglen/CubeCobra) running on my new NixOS install. It has been hanging up on canvas. My branch with my attempts at getting it working is https://github.com/ruler501/CubeCobra/tree/fix-install which used node2nix with a wrapper and a
flakes.nix. So my first issue was that canvas couldn’t find
node-pre-gyp to build with so I had to add it to the
buildInputs. Then it was failing to build canvas since it couldn’t download the prebuilt and I hadn’t included the dependencies for it. After spending quite a while down a rabbit hole trying to get the prebuilt working I realized that when building flakes it blocks internet access from the build. In the meantime I tried building new versions of
supplement.json to try and get a fix to an issue with
needle not working. It wouldn’t compile so I ended up using
@discordjs/node-pre-gyp which did work. I finally ended up having to also put all the dependencies for canvas in the
Then I got the environment built, but when trying to run it with
npm run devstart it errored out that it couldn’t find
babel-loader which was missing from the
.bin even though it did seem to list it as a dependency in the generated nix files. I’ve tried adding it to
supplement.json where it failed to build due to missing yarn and then needing an internet connection.
I can get a little farther by running
npm install inside of the
nix develop environment which I know is antithetical to the Nix paradigm. That errors out on devstart as well just this time due to
canvas not being able to find
libuuid.so.1 even though there is
libuuid in the build inputs.
Anyone have any ideas on what I’m doing wrong? I’m quite new to Nix.