As I mentioned in the other issue I just opened, I've managed to get this working on my NixOS server (in case it's of interest: https://code.tecosaur.net/tec/golgi/commit/53f3218c28168c7f619a1fd8de2093fe823d2f83)
Packaging was rather straightforward, except for these two hacks I seemed to need to do:
sed -i 's;/build/source/node_modules/react-router/dist/development/index.mjs;react-router;' $out/share/headplane/build/headplane/server.js because the build path was hardcoded into some of the bundled code
sed -i 's;define_process_env_default.PORT;process.env.PORT;' $out/share/headplane/build/headplane/server.js because the PORT envvar wasn't being loaded correctly
To work around the read-only config file issue mentioned in #48, I run cp ${headscale-config-copy} /tmp/headscale.yaml; chmod u+w /tmp/headscale.yaml' as a ExecStartPre step in the service. I figure it will just get overwritten every time the service is started, but that's fine as a stop-gap.
I thought I'd mention this here in case there's anything that can be done to remove the need for the packaging hacks I mention, and in case it helps anyone else :)
As I mentioned in the other issue I just opened, I've managed to get this working on my NixOS server (in case it's of interest: https://code.tecosaur.net/tec/golgi/commit/53f3218c28168c7f619a1fd8de2093fe823d2f83)
Packaging was rather straightforward, except for these two hacks I seemed to need to do:
sed -i 's;/build/source/node_modules/react-router/dist/development/index.mjs;react-router;' $out/share/headplane/build/headplane/server.jsbecause the build path was hardcoded into some of the bundled codesed -i 's;define_process_env_default.PORT;process.env.PORT;' $out/share/headplane/build/headplane/server.jsbecause thePORTenvvar wasn't being loaded correctlyTo work around the read-only config file issue mentioned in #48, I run
cp ${headscale-config-copy} /tmp/headscale.yaml; chmod u+w /tmp/headscale.yaml'as aExecStartPrestep in the service. I figure it will just get overwritten every time the service is started, but that's fine as a stop-gap.I thought I'd mention this here in case there's anything that can be done to remove the need for the packaging hacks I mention, and in case it helps anyone else :)