Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/dominicegginton/noxide
- Owner: dominicegginton
- Created: 2024-02-19T17:28:19.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2024-04-28T00:13:42.000Z (10 months ago)
- Last Synced: 2024-05-01T17:36:28.701Z (10 months ago)
- Topics: nix, nix-flake, nodejs, npm
- Language: Nix
- Homepage:
- Size: 44.9 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[](https://npmjs.com)
[](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 recommendedoutputs = { 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 recommendedoutputs = { 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 = ./.;
};
};
};
}
```