This project has now been archived. While updating the plain game is fine, getting the mods to ensure it works with the base game is painful (which was one of the biggest reasons I made this flake). Chasing and bugging mod devs to update their voluntarily-made projects to be compatible with the rapidly changing base (experimental) game is not ideal.
If you end up here looking to run a CDDA experimental on NixOS, try FHSEnv instead. It's more flexible although you're on your own when it comes to reproducing a working game environment.
Good luck!
πππ
This is my personal nix flake to run the automatically (experimental) built CDDA game from CDDA's GitHub repo. The executable artifact is fetched from their Github's Action CI system.
My biggest primary motives for this flake are to:
-
Play the somewhat, recently released, experimental game version, without first building it from source which could take a lot of resources and time on my NixOS computer.
-
Reproduce any possible configurations from system level dependencies (SDL2 and other required runtimes) along with CDDA's specific dependencies that didn't come by default including extra mods, sound packs or customized game configurations.
-
Make this flake available for my private CDDA modding project which uses nix. See development.
-
Learn
nix
,nix flake
andNixOS
by developing this flake. What's better way to learn a new technology than to use it for something immediately useful for my own personal use?
For completion, please see what this project is not.
NOTE: This is only tested on NixOS. You may need nixGL if you are running
nix
on other Linux distribution.
- Description
- Installation
- Flake configuration version
- Flake outputs
- Default user directory
- Developing this flake
- What this project is not
- See more
nix profile install --refresh github:cloudyluna/cdda-custom-experimental#extras
nix profile install --refresh .#extras
Once it is installed, run cdda-tiles-launcher
and enjoy the game!
nix run --refresh github:cloudyluna/cdda-custom-experimental#extras
0.8.0
These are the available outputs provided by this project. In general, all the executables and scripts exposed by this flake should work without major crashes.
Due to the experimental nature of the used edition of the game (bugs are to be expected), this flake provided game will seldom be updated for a while (weeks or even months). I will personally test the game and the included extra stuff for stability purposes.
To use run or build these outputs, append #OUTPUT_NAME
to the nix build
or nix run
remote URL or local path.
Example:
- Remotely:
nix run --refresh github:cloudyluna/cdda-custom-experimental#extras
- Locally:
nix run --refresh .#extras
The base and the primary CDDA game version used throughout in other outputs (except for development). You can see the list of pre-built executables from here.
- Edition: Native GUI (tiles) bundled with CC-Sounds sound pack.
Note: If CC-Sounds is not enabled by default, you can enable it manually in your game settings! (Options > General > Soundpack)
- Version: 2024-11-08-2048
- Supported architecture: x86_64-linux
- Release page
- Full changelog since 2024-11-03-0625
-
cdda-tiles-launcher
- Most user should use this. A shell script to launch cataclysm-tiles with the user directory located in custom location. See Default user directory for further information. -
catacylsm-tiles
- The invoked game binary. Call this manually (with--help
for info) if you want more control.
You can manually update the game type (versions, editions, etc) by changing the values within modules/cdda-game-settings.nix file to your liking, locally. There are some comments left in there to explain what the keys and values mean.
Note: Remember to run
nix build .#
once you finished changing the values.
This one is a combination of default output + with some mods bundled which I consider to be "must have", that I personally prefer to have while playing the game.
NOTE: Remember to enable them in your world creation menu by pressing 'm' button and select your mod of choice in the world creation screen.
-
- M1 Abrams, electric powered mini tank, etc. I love battle tanks in this game!
-
- Included submods:
- No Rust because I don't want character skills to decay at all. Enable this in your mod balance's sub-tab menu.
- No Portal Storms in case if I reallly, reaaaaallly don't want portal storms to appear at all π« .
- Included submods:
-
- More cool weapons!!!
- Only additional items mod are added which doesn't include the world content expansion submod. See modules/cdda-extras.nix if you want to add.
- UndeadPeopleTileset
- Really good looking tileset/gfx and I personally favor it for most of my runs.
- Somewhat sizable in download size (20Mb ish) and still small enough. Worth it π!
You can add more mods or sound packs within /modules/cdda-extras.nix file. There are comments and real usage examples in it to guide you on how to do this.
Note: Remember to run
nix build .#extras
once you finished changing the values.
It is also possible to copy your preferred sound pack directory into the sound
directory within $HOME/.cdda-custom-experimental
or into wherever else your
user directory location is. By default, this will be in
$HOME/.cdda-custom-experimental/sound
.
You don't need to run nix build
for this but be warned this is not
reproducible with nix if you switch your computer in the future unlike updating
the cdda-extras.nix
above.
As the title says, this output is expanded on top of extras and it inherits every mods, sound packs and tilesets from it.
Note: It is expected for this output installation to take longer time and probably will consume more system resources to complete.
To add more contents specific for this output, see modules/cdda-extras-expanded.nix.
- Otopack's
- The soundpack that I prefer by default, which sounds fantastic. I excluded this from extras due to the large, archive download size (500MB+).
Why this exists? I also use this flake as a development input for my private CDDA modding projects which I integrate with nix flake for reproducibility purposes (used in devshells).
Note: This output is a special exception where it doesn't bundle CDDA game and data contents.
cdda-tiles-launcher-development
- A script similar to regularcdda-tiles-launcher
but it also copies & points to the content (mod, gfx, sound, doc, etc) into$HOME/.cdda-custom-experimental-development/content
by default on first launch.- This allows user to change & update contents without first requiring to manually edit the cdda-custom-experimental Nix flake files like in traditional Linux system.
json_formatter.cgi
- Format mods JSON file according to CDDA's maintainer preferred style.
flake.nix
description = ''
My flake for developing a cute CDDA mod!
'';
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
cdda-custom-experimental.url = "github:cloudyluna/cdda-custom-experimental";
};
outputs = { self, nixpkgs, flake-utils, cdda-custom-experimental, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
};
in
{
devShells.default = with pkgs; mkShell {
buildInputs = [
gnumake
dhall
dhall-json
dhall-lsp-server
# Exposes cdda-tiles-launcher & cataclysm-tiles to the env.
cdda-custom-experimental.packages.${system}.extras
# Exposes json_formatter.cgi to the env.
cdda-custom-experimental.packages.${system}.development
];
};
}
);
}
cdda-tiles-launcher
will use $HOME/.cdda-custom-experimental
directory by
default.
To override this to any directory you like, append the path of the
location by the end of command call.
Example: cdda-tiles-launcher ~/cdda_cat_development
.
For convenience, I've included a simple devShell
to be used with nix develop
or direnv
to get the tools you need to make updating this flake slightly
easier.
First, from within this repository, run nix develop
or direnv allow
(if you have nix-direnv enabled) and let it load the environment for you.
Then, you can use make
to do most common things. You can change the target
by appending TARGET=PATH#OUTPUT_NAME
.
make build
- Build the flake output.make
- alias tomake build
.make check
- Check if the flake files are syntactically correct.make format
- Format (in-place) all the .nix files in the repository.
Example: make build TARGET=.#extras
As this project and flake is mostly for my own use, this project aren't intended for and is not:
-
A CDDA game launcher/manager for
nix
systems. That is a large scope on its own and I don't have the energy to develop this into something like that. -
A very robust and flexible nix configuration for many different use cases. This project purposes are only for as the ones described in description section.
-
To be a derivation of the cdda-experimental-git from official nixpkgs repo, which means that I would need to build this from source if the one in the repo aren't up to date as I want to.
Also, I wish to keep this flake pure (not depending on dynamic, runtime values), so new updates will reflect this decision. Though this might change if this nix flake feature will get implemented or if there are better ways to do this without significantly sacrificing reproducibility aspect of this flake.