Skip to content

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

Notifications You must be signed in to change notification settings

dominicegginton/noxide

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NPM NixOS

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

{
  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

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

About

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

Topics

Resources

Stars

Watchers

Forks

Sponsor this project