| 12 Nov 2023 |
Lily Foster | In reply to @szucsitg:matrix.org Maybe now? So I was meaning the actual like workspaces field in package.json | 13:28:51 |
Lily Foster | if you're not using it, then they are entirely separate packages | 13:28:57 |
Lily Foster | In reply to @peter-lustig:matrix.org
systemd.services.myapp = {
description = "My application";
wantedBy = ["multi-user.target"];
wants = ["network-online.target"];
serviceConfig = {
Type = "simple";
Environment = "PORT=5173";
ExecStart = "${pkgs.nodejs_20}/bin/node .";
WorkingDirectory = inputs.myapp.packages.${pkgs.system}.default;
Restart = "always";
};
};
Could you share /etc/systemd/system/services/myapp.service from the system too, so we can see what like the workingdirectory and stuff expanded to? | 13:29:28 |
peter-lustig | In reply to @lily:lily.flowers Could you share /etc/systemd/system/services/myapp.service from the system too, so we can see what like the workingdirectory and stuff expanded to? yes | 13:31:32 |
peter-lustig | [Unit]
Description=My application
Wants=network-online.target
[Service]
Environment="LOCALE_ARCHIVE=/nix/store/zi9m92xiz904cc6d9w41mb6c95q7yahn-glibc-locales-2.38-23/lib/locale/locale-archive"
Environment="PATH=/nix/store/vwkvhj69z4qqgmpa2lwm97kabf12p26r-coreutils-9.3/bin:/nix/store/qyzfglbrqb5ck0dgljplin2bvc4995w7-findutils-4.9.0/bin:/nix/store/p2r51wfg9m3ga7pp7avslpfhfa7w5y83-gnugrep-3.11/bin:/nix/store/g5p3ky90xa05ggg5szyb0pbbl2vp7n03-gnused-4.9/bin:/nix/store/vapnrxrw3b21c7ji61bmnbzl2cj1vl96-systemd-254.3/bin:/nix/store/vwkvhj69z4qqgmpa2lwm97kabf12p26r-coreutils-9.3/sbin:/nix/store/qyzfglbrqb5ck0dgljplin2bvc4995w7-findutils-4.9.0/sbin:/nix/store/p2r51wfg9m3ga7pp7avslpfhfa7w5y83-gnugrep-3.11/sbin:/nix/store/g5p3ky90xa05ggg5szyb0pbbl2vp7n03-gnused-4.9/sbin:/nix/store/vapnrxrw3b21c7ji61bmnbzl2cj1vl96-systemd-254.3/sbin"
Environment="TZDIR=/nix/store/cf0gxd6nyr6shkkn0ca82bap1x8r0f9x-tzdata-2023c/share/zoneinfo"
Environment=PORT=5173
ExecStart=/nix/store/17g2kfxglsl3rncfasqrxqs2g3bjin3k-nodejs-20.9.0/bin/node .
Restart=always
Type=simple
WorkingDirectory=/nix/store/xixmhd827wd95j6748xv3zyn5cf3kb9x-build-my-application
Lily Foster
| 13:32:45 |
Lily Foster | What's in /nix/store/xixmhd827wd95j6748xv3zyn5cf3kb9x-build-my-application? should just be the build dir with index.js, right? | 13:33:21 |
Lily Foster | because yeah, no that looks like it should work now | 13:33:29 |
peter-lustig | In reply to @lily:lily.flowers What's in /nix/store/xixmhd827wd95j6748xv3zyn5cf3kb9x-build-my-application? should just be the build dir with index.js, right? yep there is everything in there that is also there if I test it locally and run node . | 13:33:51 |
peter-lustig | so idk why it is not working | 13:33:54 |
peter-lustig | ok Lily Foster so i think i found the culprit | 13:34:33 |
peter-lustig | when I do cd that path and then node . | 13:34:39 |
peter-lustig | this comes | 13:34:42 |
peter-lustig |  Download image.png | 13:35:12 |
peter-lustig | but this only comes when I use nix to run the build stuff, not when I just do npm run build on my own Lily Foster | 13:35:43 |
Lily Foster | that's just a warning, right? are there more messages? | 13:35:45 |
Lily Foster | what happens if you do /nix/store/17g2kfxglsl3rncfasqrxqs2g3bjin3k-nodejs-20.9.0/bin/node . from that dir? | 13:35:59 |
peter-lustig |  Download image.png | 13:36:08 |
Lily Foster | uhhh | 13:36:29 |
Lily Foster | syntax error...? | 13:36:35 |
peter-lustig | In reply to @lily:lily.flowers uhhh note this does not happen when I do not do it with nix | 13:36:44 |
peter-lustig | when I just do npm run build locally | 13:36:51 |
peter-lustig | so it is not my applications fault | 13:36:57 |
Lily Foster | but wait does node . fail similarly? | 13:37:04 |
peter-lustig | the errors I sent come from cd /nix/store/... and then running node . | 13:37:29 |
peter-lustig | but when I build locally with npm run build, then cd buildand run node ., everything just works | 13:37:44 |
Lily Foster | yeah then you're build dir that you made in your derivation is busted | 13:37:45 |
Lily Foster | * yeah then your build dir that you made in your derivation is busted | 13:37:52 |
Lily Foster | hmmm | 13:37:55 |
Lily Foster | In reply to @peter-lustig:matrix.org but when I build locally with npm run build, then cd buildand run node ., everything just works can you share your derivation that you used to make the build dir? | 13:38:08 |
peter-lustig | In reply to @lily:lily.flowers can you share your derivation that you used to make the build dir? yes | 13:38:15 |