-
Notifications
You must be signed in to change notification settings - Fork 24
nix: implicitly install pm2-prom-module on startup #319
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -44,8 +44,9 @@ | |||||||||||||||||||||
| cat <<EOF > $out/bin/${name} | ||||||||||||||||||||||
| #!${pkgs.runtimeShell} | ||||||||||||||||||||||
| echo "Starting ${name}..."; | ||||||||||||||||||||||
| ${nodePackages.pm2}/bin/pm2 delete all; \ | ||||||||||||||||||||||
| ${nodePackages.pm2}/bin/pm2 start \ | ||||||||||||||||||||||
| ${nodePackages.pm2}/bin/pm2 delete all | ||||||||||||||||||||||
| ${nodePackages.pm2}/bin/pm2 install pm2-prom-module || true | ||||||||||||||||||||||
| ${nodePackages.pm2}/bin/pm2 start \ | ||||||||||||||||||||||
| $out/libexec/source/dist/server.js \ | ||||||||||||||||||||||
|
Comment on lines
+47
to
50
|
||||||||||||||||||||||
| ${nodePackages.pm2}/bin/pm2 delete all | |
| ${nodePackages.pm2}/bin/pm2 install pm2-prom-module || true | |
| ${nodePackages.pm2}/bin/pm2 start \ | |
| $out/libexec/source/dist/server.js \ | |
| pm2AppName="${name}" | |
| ${nodePackages.pm2}/bin/pm2 delete "$pm2AppName" || true | |
| ${nodePackages.pm2}/bin/pm2 install pm2-prom-module || true | |
| ${nodePackages.pm2}/bin/pm2 start \ | |
| $out/libexec/source/dist/server.js \ | |
| --name "$pm2AppName" \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Installing
pm2-prom-moduleat runtime (pm2 install ...) makes startup depend on external network availability and an unpinned npm artifact, which hurts reproducibility and can break cold starts/offline deployments. If this is required, prefer packaging/pinning it in Nix (or at least pinning the version in the install command) and handle failures explicitly rather than swallowing them with|| true(e.g., log and continue, or gate install on module not already being present).