2024-05-06 06:43:16 +00:00
|
|
|
{ stdenv, stdenvNoCC, gccStdenv, lib, recurseIntoAttrs, libsForQt5, newScope, perlPackages, jdk8, jre8 }:
|
2018-07-05 19:09:03 +00:00
|
|
|
|
|
|
|
# To whomever it may concern:
|
|
|
|
#
|
|
|
|
# This directory menaces with spikes of Nix code. It is terrifying.
|
|
|
|
#
|
|
|
|
# If this is your first time here, you should probably install the dwarf-fortress-full package,
|
2018-07-12 08:42:52 +00:00
|
|
|
# for instance with:
|
2018-07-15 05:38:30 +00:00
|
|
|
#
|
|
|
|
# environment.systemPackages = [ pkgs.dwarf-fortress-packages.dwarf-fortress-full ];
|
2018-07-05 19:09:03 +00:00
|
|
|
#
|
|
|
|
# You can adjust its settings by using override, or compile your own package by
|
2018-07-15 05:38:30 +00:00
|
|
|
# using the other packages here.
|
|
|
|
#
|
|
|
|
# For example, you can enable the FPS indicator, disable the intro, pick a
|
|
|
|
# theme other than phoebus (the default for dwarf-fortress-full), _and_ use
|
|
|
|
# an older version with something like:
|
|
|
|
#
|
|
|
|
# environment.systemPackages = [
|
|
|
|
# (pkgs.dwarf-fortress-packages.dwarf-fortress-full.override {
|
|
|
|
# dfVersion = "0.44.11";
|
|
|
|
# theme = "cla";
|
|
|
|
# enableIntro = false;
|
|
|
|
# enableFPS = true;
|
|
|
|
# })
|
|
|
|
# ]
|
|
|
|
#
|
|
|
|
# Take a look at lazy-pack.nix to see all the other options.
|
2018-07-05 19:09:03 +00:00
|
|
|
#
|
|
|
|
# You will find the configuration files in ~/.local/share/df_linux/data/init. If
|
|
|
|
# you un-symlink them and edit, then the scripts will avoid overwriting your
|
|
|
|
# changes on later launches, but consider extending the wrapper with your
|
|
|
|
# desired options instead.
|
2018-07-15 05:38:30 +00:00
|
|
|
|
2014-11-07 16:06:56 +00:00
|
|
|
let
|
2024-03-14 18:32:35 +00:00
|
|
|
inherit (lib)
|
|
|
|
attrNames
|
|
|
|
getAttr
|
|
|
|
importJSON
|
|
|
|
listToAttrs
|
2024-04-07 06:30:44 +00:00
|
|
|
optionalAttrs
|
2024-03-14 18:32:35 +00:00
|
|
|
recurseIntoAttrs
|
|
|
|
replaceStrings
|
2024-04-07 06:30:44 +00:00
|
|
|
versionAtLeast
|
2024-03-14 18:32:35 +00:00
|
|
|
;
|
|
|
|
|
2021-06-29 02:42:37 +00:00
|
|
|
callPackage = newScope self;
|
2014-11-07 16:06:56 +00:00
|
|
|
|
2018-07-15 05:38:30 +00:00
|
|
|
# The latest Dwarf Fortress version. Maintainers: when a new version comes
|
|
|
|
# out, ensure that (unfuck|dfhack|twbt) are all up to date before changing
|
2024-04-07 06:30:44 +00:00
|
|
|
# this. Note that unfuck and twbt are not required for 50.
|
2024-06-04 06:24:09 +00:00
|
|
|
latestVersion = if stdenv.hostPlatform.isLinux then "50.13"
|
|
|
|
else if stdenv.hostPlatform.isDarwin then "0.47.05"
|
|
|
|
else throw "Unsupported system";
|
2018-07-15 05:38:30 +00:00
|
|
|
|
|
|
|
# Converts a version to a package name.
|
2024-03-14 18:32:35 +00:00
|
|
|
versionToName = version: "dwarf-fortress_${replaceStrings ["."] ["_"] version}";
|
2018-07-15 05:38:30 +00:00
|
|
|
|
|
|
|
# A map of names to each Dwarf Fortress package we know about.
|
2024-03-14 18:32:35 +00:00
|
|
|
df-games = listToAttrs (map
|
2021-06-29 02:42:37 +00:00
|
|
|
(dfVersion: {
|
|
|
|
name = versionToName dfVersion;
|
|
|
|
value =
|
|
|
|
let
|
2024-04-07 06:30:44 +00:00
|
|
|
isAtLeast50 = versionAtLeast dfVersion "50.0";
|
2024-03-31 03:36:51 +00:00
|
|
|
|
2024-06-04 06:24:09 +00:00
|
|
|
dwarf-fortress-unfuck = optionalAttrs (!isAtLeast50 && stdenv.hostPlatform.isLinux) (callPackage ./unfuck.nix { inherit dfVersion; });
|
2024-03-31 03:36:51 +00:00
|
|
|
|
2021-06-29 02:42:37 +00:00
|
|
|
dwarf-fortress = callPackage ./game.nix {
|
|
|
|
inherit dfVersion;
|
|
|
|
inherit dwarf-fortress-unfuck;
|
|
|
|
};
|
|
|
|
|
2024-04-07 06:30:44 +00:00
|
|
|
twbt = optionalAttrs (!isAtLeast50) (callPackage ./twbt { inherit dfVersion; });
|
2021-06-29 02:42:37 +00:00
|
|
|
|
|
|
|
dfhack = callPackage ./dfhack {
|
|
|
|
inherit (perlPackages) XMLLibXML XMLLibXSLT;
|
2022-11-15 17:41:36 +00:00
|
|
|
inherit dfVersion;
|
2021-06-29 02:42:37 +00:00
|
|
|
stdenv = gccStdenv;
|
|
|
|
};
|
|
|
|
|
|
|
|
dwarf-therapist = libsForQt5.callPackage ./dwarf-therapist/wrapper.nix {
|
|
|
|
inherit dwarf-fortress;
|
2024-05-06 06:43:16 +00:00
|
|
|
dwarf-therapist = (libsForQt5.callPackage ./dwarf-therapist {}).override (optionalAttrs (!isAtLeast50) {
|
2024-04-07 06:30:44 +00:00
|
|
|
# 41.2.5 is the last version to support Dwarf Fortress 0.47.
|
|
|
|
version = "41.2.5";
|
|
|
|
hash = "sha256-xfYBtnO1n6OcliVt07GsQ9alDJIfWdVhtuyWwuvXSZs=";
|
|
|
|
});
|
2021-06-29 02:42:37 +00:00
|
|
|
};
|
|
|
|
in
|
|
|
|
callPackage ./wrapper {
|
|
|
|
inherit (self) themes;
|
2022-10-27 16:57:12 +00:00
|
|
|
inherit dwarf-fortress twbt dfhack dwarf-therapist;
|
2021-06-29 02:42:37 +00:00
|
|
|
|
|
|
|
jdk = jdk8; # TODO: remove override https://github.com/NixOS/nixpkgs/pull/89731
|
2018-07-12 08:42:52 +00:00
|
|
|
};
|
2021-06-29 02:42:37 +00:00
|
|
|
})
|
2024-03-14 18:32:35 +00:00
|
|
|
(attrNames self.df-hashes));
|
2018-07-08 19:44:29 +00:00
|
|
|
|
|
|
|
self = rec {
|
2024-03-14 18:32:35 +00:00
|
|
|
df-hashes = importJSON ./game.json;
|
2018-07-15 06:41:27 +00:00
|
|
|
|
|
|
|
# Aliases for the latest Dwarf Fortress and the selected Therapist install
|
2018-07-15 05:38:30 +00:00
|
|
|
dwarf-fortress = getAttr (versionToName latestVersion) df-games;
|
2018-07-15 06:41:27 +00:00
|
|
|
dwarf-therapist = dwarf-fortress.dwarf-therapist;
|
|
|
|
dwarf-fortress-original = dwarf-fortress.dwarf-fortress;
|
2015-09-26 23:13:06 +00:00
|
|
|
|
2018-07-15 05:38:30 +00:00
|
|
|
dwarf-fortress-full = callPackage ./lazy-pack.nix {
|
2018-07-15 06:41:27 +00:00
|
|
|
inherit df-games versionToName latestVersion;
|
2018-07-15 05:38:30 +00:00
|
|
|
};
|
2020-02-13 23:35:23 +00:00
|
|
|
|
2017-06-19 00:48:02 +00:00
|
|
|
soundSense = callPackage ./soundsense.nix { };
|
|
|
|
|
2020-09-19 11:52:36 +00:00
|
|
|
legends-browser = callPackage ./legends-browser {
|
2021-06-29 02:42:37 +00:00
|
|
|
jre = jre8; # TODO: remove override https://github.com/NixOS/nixpkgs/pull/89731
|
2020-09-19 11:52:36 +00:00
|
|
|
};
|
2018-07-04 20:04:19 +00:00
|
|
|
|
2018-07-12 08:42:52 +00:00
|
|
|
themes = recurseIntoAttrs (callPackage ./themes {
|
|
|
|
stdenv = stdenvNoCC;
|
|
|
|
});
|
2018-06-06 21:05:02 +00:00
|
|
|
|
2018-07-15 06:41:27 +00:00
|
|
|
# Theme aliases
|
2018-06-06 21:05:02 +00:00
|
|
|
phoebus-theme = themes.phoebus;
|
|
|
|
cla-theme = themes.cla;
|
2010-10-30 06:00:44 +00:00
|
|
|
};
|
2016-01-12 17:56:59 +00:00
|
|
|
|
2021-06-29 02:42:37 +00:00
|
|
|
in
|
|
|
|
self // df-games
|