diff options
author | Matthew Bauer <mjbauer95@gmail.com> | 2018-07-08 15:44:29 -0400 |
---|---|---|
committer | Matthew Bauer <mjbauer95@gmail.com> | 2018-07-09 16:13:52 -0400 |
commit | 530427c7abc7ccff6d1310496c8e6a0362e331ab (patch) | |
tree | f8e6d993c6bdcdb124f3cd4c46c885113d3df6a9 /pkgs/games/dwarf-fortress/default.nix | |
parent | cdd0ac7e5477602289ff8cee94930065e7bc570d (diff) |
dwarf-fortress: refactors
This will make it easier for people to access old versions. You can now access attributes like: - dwarf-fortress_0_44_11 - dwarf-fortress_0_43_05 - etc.
Diffstat (limited to 'pkgs/games/dwarf-fortress/default.nix')
-rw-r--r-- | pkgs/games/dwarf-fortress/default.nix | 39 |
1 files changed, 22 insertions, 17 deletions
diff --git a/pkgs/games/dwarf-fortress/default.nix b/pkgs/games/dwarf-fortress/default.nix index 480b36f345981..1924e0ac846fa 100644 --- a/pkgs/games/dwarf-fortress/default.nix +++ b/pkgs/games/dwarf-fortress/default.nix @@ -1,12 +1,19 @@ -{ pkgs, stdenv, stdenvNoCC, gccStdenv }: +{ pkgs, stdenv, stdenvNoCC, gccStdenv, lib }: let callPackage = pkgs.newScope self; - self = rec { - dwarf-fortress-original = callPackage ./game.nix { - dfVersion = "0.44.11"; + 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 { + df-hashes = builtins.fromJSON (builtins.readFile ./game.json); + dwarf-fortress = df-games.dwarf-fortress_0_44_11; dfhack = callPackage ./dfhack { inherit (pkgs.perlPackages) XMLLibXML XMLLibXSLT; @@ -17,29 +24,27 @@ let # unfuck is linux-only right now, we will just use it there dwarf-fortress-unfuck = if stdenv.isLinux then callPackage ./unfuck.nix { } - else null; - - dwarf-fortress = callPackage ./wrapper { - inherit themes; - }; - - dwarf-therapist-original = pkgs.qt5.callPackage ./dwarf-therapist { - texlive = pkgs.texlive.combine { - inherit (pkgs.texlive) scheme-basic float caption wrapfig adjmulticol sidecap preprint enumitem; + else null; + + 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 = callPackage ./dwarf-therapist/wrapper.nix { }; - legends-browser = callPackage ./legends-browser {}; themes = 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 |