doc: use finalAttrs pattern

This commit is contained in:
Pol Dellaiera 2025-04-19 22:09:31 +02:00
parent 47f000d991
commit b4515ff6c2
8 changed files with 57 additions and 55 deletions

View file

@ -23,15 +23,15 @@ In Nixpkgs, `cargo-tauri.hook` overrides the default build and install phases.
wrapGAppsHook4,
}:
rustPlatform.buildRustPackage rec {
# . . .
rustPlatform.buildRustPackage (finalAttrs: {
# ...
useFetchCargoVendor = true;
cargoHash = "...";
# Assuming our app's frontend uses `npm` as a package manager
npmDeps = fetchNpmDeps {
name = "${pname}-npm-deps-${version}";
name = "${finalAttrs.pname}-npm-deps-${finalAttrs.version}";
inherit src;
hash = "...";
};
@ -61,8 +61,8 @@ rustPlatform.buildRustPackage rec {
# And make sure we build there too
buildAndTestSubdir = cargoRoot;
# . . .
}
# ...
})
```
## Variables controlling cargo-tauri {#tauri-hook-variables-controlling}