node2nix VS relocatable.nix

Compare node2nix vs relocatable.nix and see what are their differences.

node2nix

Generate Nix expressions to build NPM packages (by svanderburg)

relocatable.nix

A nix bundler that produces relocatable deployment script for nix store paths. (by Ninlives)
Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
node2nix relocatable.nix
4 2
486 57
- -
0.0 1.8
6 months ago almost 2 years ago
Nix Shell
MIT License -
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.

node2nix

Posts with mentions or reviews of node2nix. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2023-06-26.
  • The Magic Nix Cache
    9 projects | news.ycombinator.com | 26 Jun 2023
    You may find something like node2nix helpful (https://github.com/svanderburg/node2nix). This converts your package.json into a Nix expression that can then be cached. You're right that it does require some setup and a bit of Nix knowledge but could yield significant benefits and take a good chunk out of that 20 minutes.

    Another option might be to use pnpm instead of Yarn and cache your pnpm dependencies. pnpm actually works a bit like Nix in that it creates a pnpm-lock.yaml file with content-based hashes for the full package.json dependency tree. This enables it to quickly determine which parts of the dependency tree it needs to build and which are already available.

  • Override `nodePackages' with the `default.nix' from `node2nix' multiple times
    2 projects | /r/NixOS | 6 Jul 2022
    I got it from this github issue in the node2nix repo.
  • how to install Mozilla's readability library?
    3 projects | /r/NixOS | 30 Dec 2021
    As Gerschtli commented, it may be possible to generate a Nix expression for @mozilla/readability using node2nix. Then get its node_modules path like this and set NODE_PATH to the value.
  • How to install dependencies with Nix?
    3 projects | /r/NixOS | 16 Feb 2021
    For node programs, you may be able to find the commands as just packages, or look at https://github.com/svanderburg/node2nix for creating the nix equivalent of a node-modules

relocatable.nix

Posts with mentions or reviews of relocatable.nix. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2023-06-26.
  • The Magic Nix Cache
    9 projects | news.ycombinator.com | 26 Jun 2023
    - the caching works across branches, so for example merging a feature branch to master, if nothing changes the build on master will be very quick

    I created something similar to nix-cache for gitlab, but I had to create a dedicated runner running NixOS.

    If I could use NixOS for deployment, at that point I would just point the same binary cache to the machine and use the same derivation to build the app. Because the app was already build by CI, it would just download the compiled version. No need for artifactory or similar. In that scenario (you using poetry) you probably would just use poetry2nix to generate the application.

    If the OS is not NixOS, but you still want to deploy via nix, then IMO this[2] looks interesting, basically it packages everything in self extracting archive. That you can extract and then run the app.

    Other alternatives are these bundlers[3], which includes building toArx (works in a way similar to the previous one but pretends everything is in a single file), RPM, DEB, docker (you would have more control over it if you would use the code directly instead of a bundler though)

    And the last option (probably the most obvious one) is that you can simply just use the tool to build the package. Since you're using poetry, then you can generate a wheel from it.

    [1] https://github.com/takeda/nix-cde/blob/master/contrib/gitlab...

    [2] https://github.com/Ninlives/relocatable.nix

    [3] https://github.com/NixOS/bundlers/blob/master/flake.nix

  • Introducing relocatable.nix
    1 project | /r/NixOS | 17 Jun 2022

What are some alternatives?

When comparing node2nix and relocatable.nix you can also consider the following projects:

nixpkgs - Nix Packages collection & NixOS

hasql-interpolate

nix-npm-buildpackage - Build nix packages that use npm/yarn

bundlers

nur-packages - My NUR packages

flakeforge - Container registry generating container image tarfiles on the fly

readability-cli

at-node-nix - Node.js Nix expressions