diff options
author | Sandro <sandro.jaeckel@gmail.com> | 2021-04-12 16:31:01 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-12 16:31:01 +0200 |
commit | e355946df1ba59072329653507113b7d9ed5dedd (patch) | |
tree | b3789385e4bda38ff15d353fe48769ac5f32e433 /doc/builders | |
parent | b50d86446a40c3645cb3c64123b198cf576ca8ba (diff) | |
parent | cdfbdb0b2c0eab92079d1e477a93781d7b9e2cc2 (diff) |
Merge pull request #103546 from mnacamura/cdda-small-fix
Diffstat (limited to 'doc/builders')
-rw-r--r-- | doc/builders/packages/cataclysm-dda.section.md | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/doc/builders/packages/cataclysm-dda.section.md b/doc/builders/packages/cataclysm-dda.section.md index 1173fe32adae9..0f908cb75909c 100644 --- a/doc/builders/packages/cataclysm-dda.section.md +++ b/doc/builders/packages/cataclysm-dda.section.md @@ -34,6 +34,41 @@ cataclysm-dda.override { } ``` +## Important note for overriding packages + +After applying `overrideAttrs`, you need to fix `passthru.pkgs` and +`passthru.withMods` attributes either manually or by using `attachPkgs`: + +```nix +let + # You enabled parallel building. + myCDDA = cataclysm-dda-git.overrideAttrs (_: { + enableParallelBuilding = true; + }); + + # Unfortunately, this refers to the package before overriding and + # parallel building is still disabled. + badExample = myCDDA.withMods (_: []); + + inherit (cataclysmDDA) attachPkgs pkgs wrapCDDA; + + # You can fix it by hand + goodExample1 = myCDDA.overrideAttrs (old: { + passthru = old.passthru // { + pkgs = pkgs.override { build = goodExample1; }; + withMods = wrapCDDA goodExample1; + }; + }); + + # or by using a helper function `attachPkgs`. + goodExample2 = attachPkgs pkgs myCDDA; +in + +# badExample # parallel building disabled +# goodExample1.withMods (_: []) # parallel building enabled +goodExample2.withMods (_: []) # parallel building enabled +``` + ## Customizing with mods To install Cataclysm DDA with mods of your choice, you can use `withMods` |