I spent the last few days moving my server infrastructure to NixOS, and so far I’m very happy with it. However, I’m unsure how to deploy some of my applications.
My goal here is to reduce the necessary maintenance to a manageable level, as I was not able to keep up with updates and fixes with the approach I used before (systemd-nspawn containers on Arch).
So…: My first application is NodeJS-based. I packaged the current version using node2nix, but I wondered, since all the information is in the package.json and lockfile, would it be possible to do that at build time? Basically, can I just point to a git commit and let it generate derivations for all the dependencies of that commit, without running node2nix for every update manually?
If that’s not possible, what are the practical disadvantages of including all the NodeJS dependencies in the application’s derivation, by running
npm install --production at build time?
The thing I would like to achieve in the end is the following: When there’s an update of the upstream application, I have to update the revision in the system configuration, and run
nixos- rebuild switch to update.
Thanks in advance