| 10 Nov 2023 |
peter-lustig | that probably complicates stuff even more | 22:50:20 |
Lily Foster | i mean how are you running it now? | 22:51:17 |
peter-lustig | all these build scripts are so user unfriendly | 22:51:18 |
peter-lustig | only experts can know how to do stuff | 22:51:24 |
peter-lustig | like you | 22:51:26 |
daniel | https://nodejs.org/en/blog/release/v20.6.0
There is built-in support for env files. No need for dotenv | 22:54:10 |
Lily Foster | In reply to @daniel:nopemail.org https://nodejs.org/en/blog/release/v20.6.0
There is built-in support for env files. No need for dotenv oh neat! | 22:54:50 |
Lily Foster | so yeah i guess you could just change the makeWrapper to this:
makeWrapper ${pkgs.nodejs-slim_20}/bin/node $out/bin/sveltepackage \
--add-flags --env-file=.env \
--add-flags $out/lib/node_modules/sveltepackage
| 22:55:53 |
Lily Foster | if you reallyyy need to do complicated .env file stuff from the current dir | 22:56:08 |
daniel | I'm successfully deploying a SvelteKit project without issues using buildNpmPackage, can be seen here: https://github.com/danielalvsaaker/tf-viewer-net/blob/main/frontend/default.nix | 22:56:11 |
daniel | * I'm successfully deploying a SvelteKit project without issues using buildNpmPackage, can be seen here for reference: https://github.com/danielalvsaaker/tf-viewer-net/blob/main/frontend/default.nix | 22:56:55 |
peter-lustig | In reply to @lily:lily.flowers
so yeah i guess you could just change the makeWrapper to this:
makeWrapper ${pkgs.nodejs-slim_20}/bin/node $out/bin/sveltepackage \
--add-flags --env-file=.env \
--add-flags $out/lib/node_modules/sveltepackage
do I need that wrapper? | 22:57:43 |
Lily Foster | i guess you don't need it | 22:58:10 |
daniel | * I'm successfully packaging a SvelteKit project without issues using buildNpmPackage, can be seen here for reference: https://github.com/danielalvsaaker/tf-viewer-net/blob/main/frontend/default.nix | 22:58:10 |
Lily Foster | i assumed you wanted something to run it like the sveltekit docs were suggesting | 22:58:20 |
peter-lustig | In reply to @lily:lily.flowers i assumed you wanted something to run it like the sveltekit docs were suggesting basically, my goal is to just get it with inputs.sveltekit-package.${pkgs.system}.default; and it does all the stuff. I run it on nginx | 22:59:51 |
peter-lustig | then I would just set the proxypass and it communicates with the db and done | 23:00:20 |
peter-lustig | that is the plan at least | 23:00:29 |
Lily Foster | What's it there? Like do you want a script to run it? (like the wrapper makes?) | 23:01:44 |
peter-lustig | In reply to @lily:lily.flowers What's it there? Like do you want a script to run it? (like the wrapper makes?) yes, I guess it needs to somehow run permanently. SvelteKit docs say: You can then start your app with this command: node build | 23:03:25 |
Lily Foster | yeah the wrapper would replace that | 23:03:57 |
Lily Foster | and do that for you | 23:04:00 |
Lily Foster | but like, you'd still have to start the wrapper somehow | 23:04:16 |
Lily Foster | If it's nixos, just making it a systemd service would be easiest, but otherwise you could come up with something else | 23:04:42 |
peter-lustig | how do I start the wrapper with systemd | 23:05:03 |
peter-lustig | problem is i do not even understand the wrapper | 23:05:15 |
peter-lustig | all of this is black magic to me right now | 23:06:23 |
Lily Foster | It is a shell script that basically makes a file in ${drv}/bin/sveltepackage and that shell script does ${nodejs-slim_20}/bin/node ${drv}/lib/node_modules/sveltepackage (which is where the above derivation moved build to) | 23:06:28 |
Lily Foster | so it is effectively a node build that doesn't have environment requirements that like node is in PATH or build is in current working directory and such | 23:06:57 |
Lily Foster | (so you don't need to do more than just run the wrapper. since node build would require a bunch of environment nonsense to get to work) | 23:07:20 |