dwarf-fortress: Add "lazy pack", config flags and some comments.
This commit is contained in:
parent
5012ce727a
commit
b0c7245ee5
|
@ -1,9 +1,32 @@
|
||||||
{ pkgs, stdenv, stdenvNoCC, gccStdenv }:
|
{ pkgs, stdenv, stdenvNoCC, buildEnv, gccStdenv }:
|
||||||
|
|
||||||
|
# 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,
|
||||||
|
# for instance with `environment.systempackages = [ pkgs.dwarf-fortress.dwarf-fortress-full ];`.
|
||||||
|
#
|
||||||
|
# You can adjust its settings by using override, or compile your own package by
|
||||||
|
# using the other packages here. Take a look at lazy-pack.nix to get an idea of
|
||||||
|
# how.
|
||||||
|
#
|
||||||
|
# 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.
|
||||||
|
#
|
||||||
|
# Although both dfhack and dwarf therapist are included in the lazy pack, you
|
||||||
|
# can only use one at a time. DFHack does have therapist-like features, so this
|
||||||
|
# may or may not be a problem.
|
||||||
|
|
||||||
let
|
let
|
||||||
callPackage = pkgs.newScope self;
|
callPackage = pkgs.newScope self;
|
||||||
|
|
||||||
self = rec {
|
self = rec {
|
||||||
|
|
||||||
|
dwarf-fortress-full = callPackage ./lazy-pack.nix { };
|
||||||
|
|
||||||
dwarf-fortress-original = callPackage ./game.nix { };
|
dwarf-fortress-original = callPackage ./game.nix { };
|
||||||
|
|
||||||
dfhack = callPackage ./dfhack {
|
dfhack = callPackage ./dfhack {
|
||||||
|
@ -13,7 +36,7 @@ let
|
||||||
|
|
||||||
soundSense = callPackage ./soundsense.nix { };
|
soundSense = callPackage ./soundsense.nix { };
|
||||||
|
|
||||||
# unfuck is linux-only right now, we will just use it there
|
# unfuck is linux-only right now, we will only use it there.
|
||||||
dwarf-fortress-unfuck = if stdenv.isLinux then callPackage ./unfuck.nix { }
|
dwarf-fortress-unfuck = if stdenv.isLinux then callPackage ./unfuck.nix { }
|
||||||
else null;
|
else null;
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,36 @@
|
||||||
|
{ stdenvNoCC, lib, buildEnv, callPackage
|
||||||
|
, dwarf-fortress, themes
|
||||||
|
# This package should, at any given time, provide an opinionated "optimal"
|
||||||
|
# DF experience. It's the equivalent of the Lazy Newbie Pack, that is, and
|
||||||
|
# should contain every utility available.
|
||||||
|
, enableDFHack ? stdenvNoCC.isLinux
|
||||||
|
, enableTWBT ? enableDFHack
|
||||||
|
, enableSoundSense ? true
|
||||||
|
, enableStoneSense ? false # StoneSense is currently broken.
|
||||||
|
, enableDwarfTherapist ? true, dwarf-therapist
|
||||||
|
, enableLegendsBrowser ? true, legends-browser
|
||||||
|
, theme ? themes.phoebus
|
||||||
|
# General config options:
|
||||||
|
, enableIntro ? true
|
||||||
|
, enableTruetype ? true
|
||||||
|
, enableFPS ? false
|
||||||
|
}:
|
||||||
|
|
||||||
|
buildEnv {
|
||||||
|
name = "dwarf-fortress-full";
|
||||||
|
paths = [
|
||||||
|
(dwarf-fortress.override {
|
||||||
|
inherit enableDFHack enableTWBT enableSoundSense enableStoneSense theme
|
||||||
|
enableIntro enableTruetype enableFPS;
|
||||||
|
})]
|
||||||
|
++ lib.optional enableDwarfTherapist dwarf-therapist
|
||||||
|
++ lib.optional enableLegendsBrowser legends-browser;
|
||||||
|
|
||||||
|
meta = with stdenvNoCC.lib; {
|
||||||
|
description = "An opinionated wrapper for Dwarf Fortress";
|
||||||
|
maintainers = with maintainers; [ Baughn ];
|
||||||
|
license = licenses.mit;
|
||||||
|
platforms = platforms.all;
|
||||||
|
homepage = https://github.com/NixOS/nixpkgs/;
|
||||||
|
};
|
||||||
|
}
|
|
@ -3,12 +3,12 @@
|
||||||
|
|
||||||
stdenvNoCC.mkDerivation rec {
|
stdenvNoCC.mkDerivation rec {
|
||||||
name = "twbt-${version}";
|
name = "twbt-${version}";
|
||||||
version = "6.46";
|
version = "6.49";
|
||||||
dfVersion = "0.44.10";
|
dfVersion = "0.44.11";
|
||||||
|
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
url = "https://github.com/mifki/df-twbt/releases/download/v${version}/twbt-${version}-linux.zip";
|
url = "https://github.com/mifki/df-twbt/releases/download/v${version}/twbt-${version}-linux.zip";
|
||||||
sha256 = "1a4k26z5n547k5j3ij2kx834963rc8vwgwcmbmzmhi893bryb1k6";
|
sha256 = "1qjkc7k33qhxj2g18njzasccjqsis5y8zrw5vl90h4rs3i8ld9xz";
|
||||||
};
|
};
|
||||||
|
|
||||||
sourceRoot = ".";
|
sourceRoot = ".";
|
||||||
|
|
|
@ -5,6 +5,10 @@
|
||||||
, enableTWBT ? false, twbt
|
, enableTWBT ? false, twbt
|
||||||
, themes ? {}
|
, themes ? {}
|
||||||
, theme ? null
|
, theme ? null
|
||||||
|
# General config options:
|
||||||
|
, enableIntro ? true
|
||||||
|
, enableTruetype ? true
|
||||||
|
, enableFPS ? false
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
|
@ -36,11 +40,24 @@ let
|
||||||
pathsToLink = [ "/" "/hack" "/hack/scripts" ];
|
pathsToLink = [ "/" "/hack" "/hack/scripts" ];
|
||||||
ignoreCollisions = true;
|
ignoreCollisions = true;
|
||||||
|
|
||||||
postBuild = lib.optionalString enableDFHack ''
|
postBuild = ''
|
||||||
|
# De-symlink init.txt
|
||||||
|
cp $out/data/init/init.txt init.txt
|
||||||
|
rm $out/data/init/init.txt
|
||||||
|
mv init.txt $out/data/init/init.txt
|
||||||
|
'' + lib.optionalString enableDFHack ''
|
||||||
rm $out/hack/symbols.xml
|
rm $out/hack/symbols.xml
|
||||||
substitute ${dfhack_}/hack/symbols.xml $out/hack/symbols.xml \
|
substitute ${dfhack_}/hack/symbols.xml $out/hack/symbols.xml \
|
||||||
--replace $(cat ${dwarf-fortress-original}/hash.md5.orig) \
|
--replace $(cat ${dwarf-fortress-original}/hash.md5.orig) \
|
||||||
$(cat ${dwarf-fortress-original}/hash.md5)
|
$(cat ${dwarf-fortress-original}/hash.md5)
|
||||||
|
'' + lib.optionalString enableTWBT ''
|
||||||
|
substituteInPlace $out/data/init/init.txt \
|
||||||
|
--replace '[PRINT_MODE:2D]' '[PRINT_MODE:TWBT]'
|
||||||
|
'' + ''
|
||||||
|
substituteInPlace $out/data/init/init.txt \
|
||||||
|
--replace '[INTRO:YES]' '[INTRO:${unBool enableIntro}]' \
|
||||||
|
--replace '[TRUETYPE:YES]' '[TRUETYPE:${unBool enableTruetype}]' \
|
||||||
|
--replace '[FPS:NO]' '[FPS:${unBool enableFPS}]'
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
|
|
Loading…
Reference in New Issue