Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nzbr/pnpm2nix-nzbr
Build packages using pnpm with nix
https://github.com/nzbr/pnpm2nix-nzbr
javascript nix nixos node nodejs pnpm
Last synced: 1 day ago
JSON representation
Build packages using pnpm with nix
- Host: GitHub
- URL: https://github.com/nzbr/pnpm2nix-nzbr
- Owner: nzbr
- License: isc
- Created: 2023-01-25T09:38:10.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-12-16T21:04:39.000Z (about 1 month ago)
- Last Synced: 2025-01-17T15:06:39.738Z (8 days ago)
- Topics: javascript, nix, nixos, node, nodejs, pnpm
- Language: Nix
- Homepage:
- Size: 199 KB
- Stars: 64
- Watchers: 2
- Forks: 26
- Open Issues: 15
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- stars - nzbr/pnpm2nix-nzbr
README
# pnpm2nix
Provides a `mkPnpmPackage` function that can be used to build a pnpm package with nix.
The function can be accessed either by importing this repo as a flake input or though `pkgs.callPackage /path/to/this/repo/derivation.nix {}`.
In addition to all arguments accepted by `stdenv.mkDerivation`, the `mkPnpmPackage` function accepts the following arguments:
| argument | description | default |
| ------------------------ | --------------------------------------------------------------------------- | ---------------------------- |
| `src` | The path to the package sources (required) | |
| `packageJSON` | Override the path to `package.json` | `${src}/package.json` |
| `pnpmLockYaml` | Override the path to `pnpm-lock.yaml` | `${src}/pnpm-lock.yaml` |
| `pname` | Override the package name | read from `package.json` |
| `version` | Override the package version | read from `package.json` |
| `name` | Override the combined package name | `${pname}-${version}` |
| `nodejs` | Override the nodejs package that is used | `pkgs.nodejs` |
| `pnpm` | Override the pnpm package that is used | `pkgs.nodejs.pkgs.pnpm` |
| `registry` | The registry where the dependencies are downloaded from | `https://registry.npmjs.org` |
| `script` | The npm script that is executed | `build` |
| `distDir` | The directory that should be copied to the output | `dist` |
| `installInPlace` | Run `pnpm install` in the source directory instead of a separate derivation | `false` |
| `installEnv` | Environment variables that should be present during `pnpm install` | `{}` |
| `noDevDependencies` | Only download and install `dependencies`, not `devDependencies` | `false` |
| `extraNodeModuleSources` | Additional files that should be available during `pnpm install` | `[]` |
| `copyPnpmStore` | Copy the pnpm store into the build directory instead of linking it | `true` |
| `copyNodeModules` | Copy the `node_modules` into the build directory instead of linking it | `false` |
| `extraBuildInputs` | Additional entries for `nativeBuildInputs` | `[]` |