···8888 };8989}9090```9191+9292+## Three ways of overriding Coq packages {#coq-overriding-packages}9393+9494+There are three distinct ways of changing a Coq package by overriding one of its values: `.override`, `overrideCoqDerivation`, and `.overrideAttrs`. This section explains what sort of values can be overridden with each of these methods.9595+9696+### `.override` {#coq-override}9797+9898+`.override` lets you change arguments to a Coq derivation. In the case of the `multinomials` package above, `.override` would let you override arguments like `mkCoqDerivation`, `version`, `coq`, `mathcomp`, `mathcom-finmap`, etc.9999+100100+For example, assuming you have a special `mathcomp` dependency you want to use, here is how you could override the `mathcomp` dependency:101101+102102+```nix103103+multinomials.override {104104+ mathcomp = my-special-mathcomp;105105+}106106+```107107+108108+In Nixpkgs, all Coq derivations take a `version` argument. This can be overridden in order to easily use a different version:109109+110110+```nix111111+coqPackages.multinomials.override {112112+ version = "1.5.1";113113+}114114+```115115+116116+Refer to [](#coq-packages-attribute-sets-coqpackages) for all the different formats that you can potentially pass to `version`, as well as the restrictions.117117+118118+### `overrideCoqDerivation` {#coq-overrideCoqDerivation}119119+120120+The `overrideCoqDerivation` function lets you easily change arguments to `mkCoqDerivation`. These arguments are described in [](#coq-packages-attribute-sets-coqpackages).121121+122122+For example, here is how you could locally add a new release of the `multinomials` library, and set the `defaultVersion` to use this release:123123+124124+```nix125125+coqPackages.lib.overrideCoqDerivation126126+ {127127+ defaultVersion = "2.0";128128+ release."2.0".sha256 = "1lq8x86vd3vqqh2yq6hvyagpnhfq5wmk5pg2z0xq7b7dbbbhyfkk";129129+ }130130+ coqPackages.multinomials131131+```132132+133133+### `.overrideAttrs` {#coq-overrideAttrs}134134+135135+`.overrideAttrs` lets you override arguments to the underlying `stdenv.mkDerivation` call. Internally, `mkCoqDerivation` uses `stdenv.mkDerivation` to create derivations for Coq libraries. You can override arguments to `stdenv.mkDerivation` with `.overrideAttrs`.136136+137137+For instance, here is how you could add some code to be performed in the derivation after installation is complete:138138+139139+```nix140140+coqPackages.multinomials.overrideAttrs (oldAttrs: {141141+ postInstall = oldAttrs.postInstall or "" + ''142142+ echo "you can do anything you want here"143143+ '';144144+})145145+```
···2233let44 sets = [55+ # The compact, sans-serif set:56 "comfy"67 "comfy-fixed"78 "comfy-duo"99+ # The compact, serif set:1010+ "comfy-motion"1111+ "comfy-motion-fixed"1212+ "comfy-motion-duo"1313+ # The wide, sans-serif set:814 "comfy-wide"915 "comfy-wide-fixed"1010- "comfy-motion"1111- "comfy-motion-duo"1616+ "comfy-wide-duo"1217 ];1313- version = "0.4.0";1818+ version = "1.0.0";1419 src = fetchFromSourcehut {1520 owner = "~protesilaos";1621 repo = "iosevka-comfy";1722 rev = version;1818- sha256 = "sha256-d3C5HNiZCd0xva6zvMP9NmvmeU4uXuaO04pbgIepwfw=";2323+ sha256 = "0psbz40hicv3v3x7yq26hy6nfbzml1kha24x6a88rfrncdp6bds7";1924 };2025 privateBuildPlan = src.outPath + "/private-build-plans.toml";2126 overrideAttrs = (attrs: {···2924 meta = with lib; {3025 inherit (src.meta) homepage;3126 description = ''3232- Custom build of Iosevka with a rounded style and open shapes,3333- adjusted metrics, and overrides for almost all individual glyphs2727+ Customised build of the Iosevka typeface, with a consistent2828+ rounded style and overrides for almost all individual glyphs3429 in both roman (upright) and italic (slanted) variants.3530 '';3631 license = licenses.ofl;
+7
pkgs/development/beam-modules/mix-release.nix
···1818, mixNixDeps ? { }1919, elixir ? inputs.elixir2020, hex ? inputs.hex.override { inherit elixir; }2121+, stripDebug ? true2122, ...2223}@attrs:2324let···2625 overridable = builtins.removeAttrs attrs [ "compileFlags" "mixNixDeps" ];2726in2827assert mixNixDeps != { } -> mixFodDeps == null;2828+assert stripDebug -> !enableDebugInfo;2929+2930stdenv.mkDerivation (overridable // {3031 # rg is used as a better grep to search for erlang references in the final release3132 nativeBuildInputs = nativeBuildInputs ++ [ erlang hex elixir makeWrapper git ripgrep ];···119116 substituteInPlace "$file" --replace "${erlang}/lib/erlang" "$out"120117 done121118 fi119119+ '' + lib.optionalString stripDebug ''120120+ # strip debug symbols to avoid hardreferences to "foreign" closures actually121121+ # not needed at runtime, while at the same time reduce size of BEAM files.122122+ erl -noinput -eval 'lists:foreach(fun(F) -> io:format("Stripping ~p.~n", [F]), beam_lib:strip(F) end, filelib:wildcard("'"$out"'/**/*.beam"))' -s init stop122123 '';123124124125 # TODO investigate why the resulting closure still has