mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-10 19:55:41 +03:00
doc: use finalAttrs
pattern
This commit is contained in:
parent
47f000d991
commit
b4515ff6c2
8 changed files with 57 additions and 55 deletions
|
@ -198,14 +198,14 @@ Here's an example:
|
|||
fetchFromGitHub,
|
||||
}:
|
||||
|
||||
buildNpmPackage rec {
|
||||
buildNpmPackage (finalAttrs: {
|
||||
pname = "flood";
|
||||
version = "4.7.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "jesec";
|
||||
repo = pname;
|
||||
rev = "v${version}";
|
||||
rev = "v${finalAttrs.version}";
|
||||
hash = "sha256-BR+ZGkBBfd0dSQqAvujsbgsEPFYw/ThrylxUbOksYxM=";
|
||||
};
|
||||
|
||||
|
@ -222,7 +222,7 @@ buildNpmPackage rec {
|
|||
license = lib.licenses.gpl3Only;
|
||||
maintainers = with lib.maintainers; [ winter ];
|
||||
};
|
||||
}
|
||||
})
|
||||
```
|
||||
|
||||
In the default `installPhase` set by `buildNpmPackage`, it uses `npm pack --json --dry-run` to decide what files to install in `$out/lib/node_modules/$name/`, where `$name` is the `name` string defined in the package's `package.json`.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue