summaryrefslogtreecommitdiffstats
path: root/pkgs/games
diff options
context:
space:
mode:
authorPhilip Taron <philip.taron@gmail.com>2024-03-14 11:32:35 -0700
committerValentin Gagarin <valentin.gagarin@tweag.io>2024-03-31 00:42:56 +0100
commit8f49dedbcb7e91154c5ff134288859ecbd9e1fb4 (patch)
treea1855298ddb2386e81c2c8c1e93462e860bf9004 /pkgs/games
parent81d3babe25249ee63d8061bd04b76647c543c06c (diff)
Avoid top-level `with ...;` in pkgs/games/dwarf-fortress/default.nix
Diffstat (limited to 'pkgs/games')
-rw-r--r--pkgs/games/dwarf-fortress/default.nix19
1 files changed, 13 insertions, 6 deletions
diff --git a/pkgs/games/dwarf-fortress/default.nix b/pkgs/games/dwarf-fortress/default.nix
index 55157950c4f2..777866d8fb0e 100644
--- a/pkgs/games/dwarf-fortress/default.nix
+++ b/pkgs/games/dwarf-fortress/default.nix
@@ -32,9 +32,16 @@
# changes on later launches, but consider extending the wrapper with your
# desired options instead.
-with lib;
-
let
+ inherit (lib)
+ attrNames
+ getAttr
+ importJSON
+ listToAttrs
+ recurseIntoAttrs
+ replaceStrings
+ ;
+
callPackage = newScope self;
# The latest Dwarf Fortress version. Maintainers: when a new version comes
@@ -43,14 +50,14 @@ let
latestVersion = "0.47.05";
# Converts a version to a package name.
- versionToName = version: "dwarf-fortress_${lib.replaceStrings ["."] ["_"] version}";
+ versionToName = version: "dwarf-fortress_${replaceStrings ["."] ["_"] version}";
dwarf-therapist-original = libsForQt5.callPackage ./dwarf-therapist {
texlive = texliveBasic.withPackages (ps: with ps; [ float caption wrapfig adjmulticol sidecap preprint enumitem ]);
};
# A map of names to each Dwarf Fortress package we know about.
- df-games = lib.listToAttrs (map
+ df-games = listToAttrs (map
(dfVersion: {
name = versionToName dfVersion;
value =
@@ -83,10 +90,10 @@ let
jdk = jdk8; # TODO: remove override https://github.com/NixOS/nixpkgs/pull/89731
};
})
- (lib.attrNames self.df-hashes));
+ (attrNames self.df-hashes));
self = rec {
- df-hashes = lib.importJSON ./game.json;
+ df-hashes = importJSON ./game.json;
# Aliases for the latest Dwarf Fortress and the selected Therapist install
dwarf-fortress = getAttr (versionToName latestVersion) df-games;