lol

coqPackages.mkCoqDerivation: add a coqPackages.lib.overrideCoqDerivation function

`overrideCoqDerivation` allows end-users the ability to easily override
arguments to the underlying call to `mkCoqDerivation` for a given Coq
library.

This is similar to `haskell.lib.overrideCabal` for Haskell packages and
`.overridePythonAttrs` for Python packges.

+38 -1
+37
pkgs/build-support/coq/extra-lib.nix
··· 142 142 if cl?case then compare cl.case var 143 143 else all (equal true) (zipListsWith compare cl.cases var); in 144 144 switch-if (map (cl: { cond = combine cl var; inherit (cl) out; }) clauses) default; 145 + 146 + /* Override arguments to mkCoqDerivation for a Coq library. 147 + 148 + This function allows you to easily override arguments to mkCoqDerivation, 149 + even when they are not exposed by the Coq library directly. 150 + 151 + Type: overrideCoqDerivation :: AttrSet -> CoqLibraryDerivation -> CoqLibraryDerivation 152 + 153 + Example: 154 + 155 + ```nix 156 + coqPackages.lib.overrideCoqDerivation 157 + { 158 + defaultVersion = "9999"; 159 + release."9999".sha256 = "1lq8x86vd3vqqh2yq6hvyagpnhfq5wmk5pg2z0xq7b7dbbbhyfkw"; 160 + } 161 + coqPackages.QuickChick; 162 + ``` 163 + 164 + This example overrides the `defaultVersion` and `release` arguments that 165 + are passed to `mkCoqDerivation` in the QuickChick derivation. 166 + 167 + Note that there is a difference between using `.override` on a Coq 168 + library vs this `overrideCoqDerivation` function. `.override` allows you 169 + to modify arguments to the derivation itself, for instance by passing 170 + different versions of dependencies: 171 + 172 + ```nix 173 + coqPackages.QuickCick.override { ssreflect = my-cool-ssreflect; } 174 + ``` 175 + 176 + whereas `overrideCoqDerivation` allows you to override arguments to the 177 + call to `mkCoqDerivation` in the Coq library. 178 + */ 179 + overrideCoqDerivation = f: drv: (drv.override (args: { 180 + mkCoqDerivation = drv_: (args.mkCoqDerivation drv_).override f; 181 + })); 145 182 })
+1 -1
pkgs/top-level/coq-packages.nix
··· 11 11 12 12 metaFetch = import ../build-support/coq/meta-fetch/default.nix 13 13 {inherit lib stdenv fetchzip; }; 14 - mkCoqDerivation = callPackage ../build-support/coq {}; 14 + mkCoqDerivation = lib.makeOverridable (callPackage ../build-support/coq {}); 15 15 16 16 contribs = recurseIntoAttrs 17 17 (callPackage ../development/coq-modules/contribs {});