docs: fix nix code blocks in override page

This commit is contained in:
DavHau 2024-04-06 09:36:44 +07:00 committed by mergify[bot]
parent da4f6430ce
commit f4f1106a23

View File

@ -20,11 +20,11 @@ Global overrides apply universally to all dependencies within a specific languag
By default, the `pip` module disables testing for dependencies. To enable testing globally, use `overrideAll` as shown below: By default, the `pip` module disables testing for dependencies. To enable testing globally, use `overrideAll` as shown below:
```nix ```nix
{config, lib, ...}: { {config, lib, ...}: {
pip.overrideAll.mkDerivation.doCheck = true; pip.overrideAll.mkDerivation.doCheck = true;
} }
``` ```
## Local Overrides ## Local Overrides
@ -34,8 +34,8 @@ Local overrides are specific to individual packages. This method allows for prec
The following override applies exclusively to the `opencv-python` package, ensuring specific build dependencies are included: The following override applies exclusively to the `opencv-python` package, ensuring specific build dependencies are included:
```nix ```nix
{config, lib, ...}: { {config, lib, ...}: {
pip.overrides.opencv-python = { pip.overrides.opencv-python = {
env.autoPatchelfIgnoreMissingDeps = true; env.autoPatchelfIgnoreMissingDeps = true;
mkDerivation.buildInputs = [ mkDerivation.buildInputs = [
@ -43,8 +43,8 @@ The following override applies exclusively to the `opencv-python` package, ensur
pkgs.glib pkgs.glib
]; ];
}; };
} }
``` ```
Note: For ecosystems like Node.js that may include multiple versions of a dependency, local overrides affect all versions by default. For version-specific overrides, refer to the [Conditionals](#conditionals) section. Note: For ecosystems like Node.js that may include multiple versions of a dependency, local overrides affect all versions by default. For version-specific overrides, refer to the [Conditionals](#conditionals) section.
@ -64,16 +64,16 @@ Conditional overrides offer flexibility by allowing overrides to be applied base
The following conditional override disables tests for versions of the `pillow` package version `10.0.0` or higher: The following conditional override disables tests for versions of the `pillow` package version `10.0.0` or higher:
```nix ```nix
{config, lib, ...}: { {config, lib, ...}: {
pip.overrides.pillow = { pip.overrides.pillow = {
mkDerivation.doCheck = mkDerivation.doCheck =
if lib.versionAtLeast "10.0.0" config.version if lib.versionAtLeast "10.0.0" config.version
then false then false
else true; else true;
}; };
} }
``` ```
## List of Options ## List of Options