about summary refs log tree commit diff
path: root/pkgs/games/dwarf-fortress/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/games/dwarf-fortress/default.nix')
-rw-r--r--pkgs/games/dwarf-fortress/default.nix67
1 files changed, 48 insertions, 19 deletions
diff --git a/pkgs/games/dwarf-fortress/default.nix b/pkgs/games/dwarf-fortress/default.nix
index ee2e442daa28..d9a5df73f17c 100644
--- a/pkgs/games/dwarf-fortress/default.nix
+++ b/pkgs/games/dwarf-fortress/default.nix
@@ -1,10 +1,41 @@
-{ pkgs, stdenv, stdenvNoCC, gccStdenv }:
+{ pkgs, stdenv, stdenvNoCC, buildEnv, gccStdenv, lib, recurseIntoAttrs }:
+
+# 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
   callPackage = pkgs.newScope self;
 
+  df-games = lib.listToAttrs (map (dfVersion: {
+    name = "dwarf-fortress_${lib.replaceStrings ["."] ["_"] dfVersion}";
+    value = callPackage ./wrapper {
+      inherit (self) themes;
+      dwarf-fortress = callPackage ./game.nix { inherit dfVersion; };
+    };
+  }) (lib.attrNames self.df-hashes));
+
   self = rec {
-    dwarf-fortress-original = callPackage ./game.nix { };
+    df-hashes = builtins.fromJSON (builtins.readFile ./game.json);
+    dwarf-fortress = df-games.dwarf-fortress_0_44_11;
+
+    dwarf-fortress-full = callPackage ./lazy-pack.nix { };
 
     dfhack = callPackage ./dfhack {
       inherit (pkgs.perlPackages) XMLLibXML XMLLibXSLT;
@@ -13,32 +44,30 @@ let
 
     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 { }
-                                              else null;
+                            else null;
 
-    dwarf-fortress = callPackage ./wrapper {
-      themes = {
-        "phoebus" = phoebus-theme;
-        "cla" = cla-theme;
+    dwarf-therapist = callPackage ./dwarf-therapist/wrapper.nix {
+      inherit (dwarf-fortress) dwarf-fortress;
+      dwarf-therapist = pkgs.qt5.callPackage ./dwarf-therapist {
+        texlive = pkgs.texlive.combine {
+          inherit (pkgs.texlive) scheme-basic float caption wrapfig adjmulticol sidecap preprint enumitem;
+        };
       };
     };
 
-    dwarf-therapist-original = pkgs.qt5.callPackage ./dwarf-therapist {
-      texlive = pkgs.texlive.combine {
-        inherit (pkgs.texlive) scheme-basic float caption wrapfig adjmulticol sidecap preprint enumitem;
-      };
-    };
-
-    dwarf-therapist = callPackage ./dwarf-therapist/wrapper.nix { };
+    legends-browser = callPackage ./legends-browser {};
 
-    themes = callPackage ./themes {
+    twbt = callPackage ./twbt {};
+    themes = recurseIntoAttrs (callPackage ./themes {
       stdenv = stdenvNoCC;
-    };
+    });
 
+    # aliases
     phoebus-theme = themes.phoebus;
-
     cla-theme = themes.cla;
+    dwarf-fortress-original = dwarf-fortress.dwarf-fortress;
   };
 
-in self
+in self // df-games