nixpkgs/doc/builders/packages/cataclysm-dda.section.md
Ryan Mulligan b8344f9e5c doc: explicit Markdown anchors for top-level headings; remove metadata
I used the existing anchors generated by Docbook, so the anchor part
should be a no-op. This could be useful depending on the
infrastructure we choose to use, and it is better to be explicit than
rely on Docbook's id generating algorithms.

I got rid of the metadata segments of the Markdown files, because they
are outdated, inaccurate, and could make people less willing to change
them without speaking with the author.
2021-01-01 10:02:57 -08:00

2.4 KiB

Cataclysm: Dark Days Ahead

How to install Cataclysm DDA

To install the latest stable release of Cataclysm DDA to your profile, execute nix-env -f "<nixpkgs>" -iA cataclysm-dda. For the curses build (build without tiles), install cataclysmDDA.stable.curses. Note: cataclysm-dda is an alias to cataclysmDDA.stable.tiles.

If you like access to a development build of your favorite git revision, override cataclysm-dda-git (or cataclysmDDA.git.curses if you like curses build):

cataclysm-dda-git.override {
  version = "YYYY-MM-DD";
  rev = "YOUR_FAVORITE_REVISION";
  sha256 = "CHECKSUM_OF_THE_REVISION";
}

The sha256 checksum can be obtained by

nix-prefetch-url --unpack "https://github.com/CleverRaven/Cataclysm-DDA/archive/${YOUR_FAVORITE_REVISION}.tar.gz"

The default configuration directory is ~/.cataclysm-dda. If you prefer $XDG_CONFIG_HOME/cataclysm-dda, override the derivation:

cataclysm-dda.override {
  useXdgDir = true;
}

Customizing with mods

To install Cataclysm DDA with mods of your choice, you can use withMods attribute:

cataclysm-dda.withMods (mods: with mods; [
  tileset.UndeadPeople
])

All mods, soundpacks, and tilesets available in nixpkgs are found in cataclysmDDA.pkgs.

Here is an example to modify existing mods and/or add more mods not available in nixpkgs:

let
  customMods = self: super: lib.recursiveUpdate super {
    # Modify existing mod
    tileset.UndeadPeople = super.tileset.UndeadPeople.overrideAttrs (old: {
      # If you like to apply a patch to the tileset for example
      patches = [ ./path/to/your.patch ];
    });

    # Add another mod
    mod.Awesome = cataclysmDDA.buildMod {
      modName = "Awesome";
      version = "0.x";
      src = fetchFromGitHub {
        owner = "Someone";
        repo = "AwesomeMod";
        rev = "...";
        sha256 = "...";
      };
      # Path to be installed in the unpacked source (default: ".")
      modRoot = "contents/under/this/path/will/be/installed";
    };

    # Add another soundpack
    soundpack.Fantastic = cataclysmDDA.buildSoundPack {
      # ditto
    };

    # Add another tileset
    tileset.SuperDuper = cataclysmDDA.buildTileSet {
      # ditto
    };
  };
in
cataclysm-dda.withMods (mods: with mods.extend customMods; [
  tileset.UndeadPeople
  mod.Awesome
  soundpack.Fantastic
  tileset.SuperDuper
])