Caution
Noxide should be considered unstable.
Support for building npm package in Nix. More information to coming soon ...
- Noxide loads the
package-lock.json
file and parses it. Then it fetches all specified packages into the Nix Store. - Noxide uses
npm cache
on the stored packages to allow install to work. - Noxide calls all the npm commands.
- Noxide installs everything automatically or based on what was specified in
installPhase
.
{
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
inputs.noxide.url = "github:dominicegginton/noxide";
inputs.noxide.inputs.nixpkgs.follows = "nixpkgs"; # optional but recommended
outputs = { self, nixpkgs, noxide }:
{
packages = {
my-package = noxide.lib.buildNpmPackage {
name = "my-package";
src = ./.;
};
};
};
}
{
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
inputs.noxide.url = "github:dominicegginton/noxide";
inputs.noxide.inputs.nixpkgs.follows = "nixpkgs"; # optional but recommended
outputs = { self, nixpkgs, noxide }:
let
pkgs = import nixpkgs {
system = "x86_64-linux";
overlays = [ noxide.overlays.default ];
};
in
{
packages = {
my-package = pkgs.lib.buildNpmPackage {
name = "my-package";
src = ./.;
};
};
};
}