Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/dominicegginton/noxide

Support for building npm package in Nix. Think Napalm without the registry.
https://github.com/dominicegginton/noxide

nix nix-flake nodejs npm

Last synced: about 10 hours ago
JSON representation

Support for building npm package in Nix. Think Napalm without the registry.

Awesome Lists containing this project

README

        

[NPM](https://npmjs.com)
[NixOS](https://nixos.org)

# Noxide

> [!CAUTION]
>
> Noxide should be considered unstable.

Support for building npm package in Nix. More information to coming soon ...

## How does Noxide work ?

1. Noxide loads the `package-lock.json` file and parses it. Then it fetches all specified packages into the Nix Store.
2. Noxide uses `npm cache` on the stored packages to allow install to work.
3. Noxide calls all the npm commands.
4. Noxide installs everything automatically or based on what was specified in `installPhase`.

## Documentation

### `noxide.lib.buildNpmPackage`

```nix
{
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 = ./.;
};
};
};
}
```

### `noxide.overlays.default`

```nix
{
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 = ./.;
};
};
};
}
```