2021-01-01 17:45:43 +00:00
|
|
|
# Cataclysm: Dark Days Ahead {#cataclysm-dark-days-ahead}
|
2020-04-09 11:53:02 +01:00
|
|
|
|
2021-06-05 20:22:45 +01:00
|
|
|
## How to install Cataclysm DDA {#how-to-install-cataclysm-dda}
|
2020-04-09 11:53:02 +01:00
|
|
|
|
2020-07-08 03:44:11 +01:00
|
|
|
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`.
|
2020-04-09 11:53:02 +01:00
|
|
|
|
2020-07-08 03:44:11 +01:00
|
|
|
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):
|
2020-04-09 11:53:02 +01:00
|
|
|
|
|
|
|
```nix
|
|
|
|
cataclysm-dda-git.override {
|
|
|
|
version = "YYYY-MM-DD";
|
|
|
|
rev = "YOUR_FAVORITE_REVISION";
|
|
|
|
sha256 = "CHECKSUM_OF_THE_REVISION";
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
The sha256 checksum can be obtained by
|
|
|
|
|
|
|
|
```sh
|
|
|
|
nix-prefetch-url --unpack "https://github.com/CleverRaven/Cataclysm-DDA/archive/${YOUR_FAVORITE_REVISION}.tar.gz"
|
|
|
|
```
|
|
|
|
|
2020-07-08 03:44:11 +01:00
|
|
|
The default configuration directory is `~/.cataclysm-dda`. If you prefer
|
|
|
|
`$XDG_CONFIG_HOME/cataclysm-dda`, override the derivation:
|
|
|
|
|
|
|
|
```nix
|
|
|
|
cataclysm-dda.override {
|
|
|
|
useXdgDir = true;
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
2021-06-05 20:22:45 +01:00
|
|
|
## Important note for overriding packages {#important-note-for-overriding-packages}
|
2020-11-12 03:37:49 +00:00
|
|
|
|
|
|
|
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
|
|
|
|
```
|
|
|
|
|
2021-06-05 20:22:45 +01:00
|
|
|
## Customizing with mods {#customizing-with-mods}
|
2020-04-09 11:53:02 +01:00
|
|
|
|
2020-07-08 03:44:11 +01:00
|
|
|
To install Cataclysm DDA with mods of your choice, you can use `withMods`
|
|
|
|
attribute:
|
2020-04-09 11:53:02 +01:00
|
|
|
|
|
|
|
```nix
|
|
|
|
cataclysm-dda.withMods (mods: with mods; [
|
|
|
|
tileset.UndeadPeople
|
|
|
|
])
|
|
|
|
```
|
|
|
|
|
|
|
|
All mods, soundpacks, and tilesets available in nixpkgs are found in
|
|
|
|
`cataclysmDDA.pkgs`.
|
|
|
|
|
2020-07-08 03:44:11 +01:00
|
|
|
Here is an example to modify existing mods and/or add more mods not available
|
|
|
|
in nixpkgs:
|
2020-04-09 11:53:02 +01:00
|
|
|
|
|
|
|
```nix
|
|
|
|
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 = "...";
|
doc: use sri hash syntax
The nixpkgs manual contains references to both sri hash and explicit
sha256 attributes. This is at best confusing to new users. Since the
final destination is exclusive use of sri hashes, see nixos/rfcs#131,
might as well push new users in that direction gently.
Notable exceptions to sri hash support are builtins.fetchTarball,
cataclysm-dda, coq, dockerTools.pullimage, elixir.override, and
fetchCrate. None, other than builtins.fetchTarball, are fundamentally
incompatible, but all currently accept explicit sha256 attributes as
input. Because adding backwards compatibility is out of scope for this
change, they have been left intact, but migration to sri format has been
made for any using old hash formats.
All hashes have been manually tested to be accurate, and updates were
only made for missing upstream artefacts or bugs.
2022-12-03 19:49:00 +00:00
|
|
|
hash = "...";
|
2020-04-09 11:53:02 +01:00
|
|
|
};
|
|
|
|
# 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
|
|
|
|
])
|
|
|
|
```
|