nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ lib }:
2
3lib.recursiveUpdate lib (
4 import ./extra-lib-common.nix { inherit lib; }
5 // {
6
7 /*
8 Override arguments to mkRocqDerivation for a Rocq library.
9
10 This function allows you to easily override arguments to mkRocqDerivation,
11 even when they are not exposed by the Rocq library directly.
12
13 Type: overrideRocqDerivation :: AttrSet -> RocqLibraryDerivation -> RocqLibraryDerivation
14
15 Example:
16
17 ```nix
18 rocqPackages.lib.overrideRocqDerivation
19 {
20 defaultVersion = "9999";
21 release."9999".hash = "sha256-fDoP11rtrIM7+OLdMisv2EF7n/IbGuwFxHiPtg3qCNM=";
22 }
23 rocqPackages.QuickChick;
24 ```
25
26 This example overrides the `defaultVersion` and `release` arguments that
27 are passed to `mkRocqDerivation` in the QuickChick derivation.
28
29 Note that there is a difference between using `.override` on a Rocq
30 library vs this `overrideRocqDerivation` function. `.override` allows you
31 to modify arguments to the derivation itself, for instance by passing
32 different versions of dependencies:
33
34 ```nix
35 rocqPackages.QuickChick.override { ssreflect = my-cool-ssreflect; }
36 ```
37
38 whereas `overrideRocqDerivation` allows you to override arguments to the
39 call to `mkRocqDerivation` in the Rocq library.
40
41 Note that all Rocq libraries in Nixpkgs have a `version` argument for
42 easily using a different version. So if all you want to do is use a
43 different version, and the derivation for the Rocq library already has
44 support for the version you want, you likely only need to update the
45 `version` argument on the library derivation. This is done with
46 `.override`:
47
48 ```nix
49 rocqPackages.QuickChick.override { version = "1.4.0"; }
50 ```
51 */
52 overrideRocqDerivation =
53 f: drv:
54 (drv.override (args: {
55 mkRocqDerivation = drv_: (args.mkRocqDerivation drv_).override f;
56 }));
57 }
58)