2018-07-21 02:44:44 +02:00
|
|
|
{ pkgs, stdenv, stdenvNoCC, gccStdenv, lib, recurseIntoAttrs }:
|
2018-07-05 21:09:03 +02: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 10:42:52 +02:00
|
|
|
# for instance with:
|
2018-07-15 07:38:30 +02:00
|
|
|
#
|
|
|
|
# environment.systemPackages = [ pkgs.dwarf-fortress-packages.dwarf-fortress-full ];
|
2018-07-05 21:09:03 +02:00
|
|
|
#
|
|
|
|
# You can adjust its settings by using override, or compile your own package by
|
2018-07-15 07:38:30 +02: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 21:09:03 +02: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 07:38:30 +02:00
|
|
|
|
|
|
|
with lib;
|
2014-11-07 17:06:56 +01:00
|
|
|
|
|
|
|
let
|
2016-01-12 18:56:59 +01:00
|
|
|
callPackage = pkgs.newScope self;
|
2014-11-07 17:06:56 +01:00
|
|
|
|
2018-07-15 07:38:30 +02: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
|
|
|
|
# this.
|
2020-03-12 19:40:32 +01:00
|
|
|
latestVersion = "0.47.04";
|
2018-07-15 07:38:30 +02:00
|
|
|
|
|
|
|
# Converts a version to a package name.
|
|
|
|
versionToName = version: "dwarf-fortress_${lib.replaceStrings ["."] ["_"] version}";
|
|
|
|
|
2019-06-10 17:26:09 +02:00
|
|
|
dwarf-therapist-original = pkgs.qt5.callPackage ./dwarf-therapist {
|
|
|
|
texlive = pkgs.texlive.combine {
|
|
|
|
inherit (pkgs.texlive) scheme-basic float caption wrapfig adjmulticol sidecap preprint enumitem;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2018-07-15 07:38:30 +02:00
|
|
|
# A map of names to each Dwarf Fortress package we know about.
|
2018-07-08 21:44:29 +02:00
|
|
|
df-games = lib.listToAttrs (map (dfVersion: {
|
2018-07-15 07:38:30 +02:00
|
|
|
name = versionToName dfVersion;
|
2018-07-12 10:42:52 +02:00
|
|
|
value =
|
|
|
|
let
|
|
|
|
# I can't believe this syntax works. Spikes of Nix code indeed...
|
|
|
|
dwarf-fortress = callPackage ./game.nix {
|
|
|
|
inherit dfVersion;
|
|
|
|
inherit dwarf-fortress-unfuck;
|
|
|
|
};
|
|
|
|
|
|
|
|
# unfuck is linux-only right now, we will only use it there.
|
|
|
|
dwarf-fortress-unfuck = if stdenv.isLinux then callPackage ./unfuck.nix { inherit dfVersion; }
|
|
|
|
else null;
|
|
|
|
|
|
|
|
twbt = callPackage ./twbt { inherit dfVersion; };
|
|
|
|
|
|
|
|
dfhack = callPackage ./dfhack {
|
|
|
|
inherit (pkgs.perlPackages) XMLLibXML XMLLibXSLT;
|
2018-07-15 08:41:27 +02:00
|
|
|
inherit dfVersion twbt;
|
2018-07-12 10:42:52 +02:00
|
|
|
stdenv = gccStdenv;
|
|
|
|
};
|
2018-07-15 08:41:27 +02:00
|
|
|
|
|
|
|
dwarf-therapist = callPackage ./dwarf-therapist/wrapper.nix {
|
|
|
|
inherit dwarf-fortress;
|
2019-06-10 17:26:09 +02:00
|
|
|
dwarf-therapist = dwarf-therapist-original;
|
2018-07-15 08:41:27 +02:00
|
|
|
};
|
2018-07-12 10:42:52 +02:00
|
|
|
in
|
|
|
|
callPackage ./wrapper {
|
|
|
|
inherit (self) themes;
|
|
|
|
|
|
|
|
dwarf-fortress = dwarf-fortress;
|
|
|
|
twbt = twbt;
|
|
|
|
dfhack = dfhack;
|
2018-07-15 08:41:27 +02:00
|
|
|
dwarf-therapist = dwarf-therapist;
|
2020-09-19 13:52:36 +02:00
|
|
|
|
|
|
|
jdk = pkgs.jdk8; # TODO: remove override https://github.com/NixOS/nixpkgs/pull/89731
|
2018-07-12 10:42:52 +02:00
|
|
|
};
|
2018-07-08 21:44:29 +02:00
|
|
|
}) (lib.attrNames self.df-hashes));
|
|
|
|
|
|
|
|
self = rec {
|
|
|
|
df-hashes = builtins.fromJSON (builtins.readFile ./game.json);
|
2018-07-15 08:41:27 +02:00
|
|
|
|
|
|
|
# Aliases for the latest Dwarf Fortress and the selected Therapist install
|
2018-07-15 07:38:30 +02:00
|
|
|
dwarf-fortress = getAttr (versionToName latestVersion) df-games;
|
2019-06-10 17:26:09 +02:00
|
|
|
inherit dwarf-therapist-original;
|
2018-07-15 08:41:27 +02:00
|
|
|
dwarf-therapist = dwarf-fortress.dwarf-therapist;
|
|
|
|
dwarf-fortress-original = dwarf-fortress.dwarf-fortress;
|
2015-09-27 01:13:06 +02:00
|
|
|
|
2018-07-15 07:38:30 +02:00
|
|
|
dwarf-fortress-full = callPackage ./lazy-pack.nix {
|
2018-07-15 08:41:27 +02:00
|
|
|
inherit df-games versionToName latestVersion;
|
2018-07-15 07:38:30 +02:00
|
|
|
};
|
2020-02-14 00:35:23 +01:00
|
|
|
|
2017-06-19 02:48:02 +02:00
|
|
|
soundSense = callPackage ./soundsense.nix { };
|
|
|
|
|
2020-09-19 13:52:36 +02:00
|
|
|
legends-browser = callPackage ./legends-browser {
|
|
|
|
jre = pkgs.jre8; # TODO: remove override https://github.com/NixOS/nixpkgs/pull/89731
|
|
|
|
};
|
2018-07-04 22:04:19 +02:00
|
|
|
|
2018-07-12 10:42:52 +02:00
|
|
|
themes = recurseIntoAttrs (callPackage ./themes {
|
|
|
|
stdenv = stdenvNoCC;
|
|
|
|
});
|
2018-06-06 23:05:02 +02:00
|
|
|
|
2018-07-15 08:41:27 +02:00
|
|
|
# Theme aliases
|
2018-06-06 23:05:02 +02:00
|
|
|
phoebus-theme = themes.phoebus;
|
|
|
|
cla-theme = themes.cla;
|
2010-10-30 08:00:44 +02:00
|
|
|
};
|
2016-01-12 18:56:59 +01:00
|
|
|
|
2018-07-08 21:44:29 +02:00
|
|
|
in self // df-games
|