mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 06:53:01 +00:00
e0464e4788
In preparation for the deprecation of `stdenv.isX`. These shorthands are not conducive to cross-compilation because they hide the platforms. Darwin might get cross-compilation for which the continued usage of `stdenv.isDarwin` will get in the way One example of why this is bad and especially affects compiler packages https://www.github.com/NixOS/nixpkgs/pull/343059 There are too many files to go through manually but a treewide should get users thinking when they see a `hostPlatform.isX` in a place where it doesn't make sense. ``` fd --type f "\.nix" | xargs sd --fixed-strings "stdenv.is" "stdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "stdenv'.is" "stdenv'.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "clangStdenv.is" "clangStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "gccStdenv.is" "gccStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "stdenvNoCC.is" "stdenvNoCC.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "inherit (stdenv) is" "inherit (stdenv.hostPlatform) is" fd --type f "\.nix" | xargs sd --fixed-strings "buildStdenv.is" "buildStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "effectiveStdenv.is" "effectiveStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "originalStdenv.is" "originalStdenv.hostPlatform.is" ```
67 lines
1.7 KiB
Nix
67 lines
1.7 KiB
Nix
{ stdenvNoCC
|
|
, lib
|
|
, buildEnv
|
|
, df-games
|
|
, themes
|
|
, latestVersion
|
|
, versionToName
|
|
, dfVersion ? latestVersion
|
|
# 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 unless you disable them.
|
|
, enableDFHack ? stdenvNoCC.hostPlatform.isLinux
|
|
, enableTWBT ? enableDFHack
|
|
, enableSoundSense ? true
|
|
, enableStoneSense ? true
|
|
, enableDwarfTherapist ? true
|
|
, enableLegendsBrowser ? true
|
|
, legends-browser
|
|
, theme ? themes.phoebus
|
|
# General config options:
|
|
, enableIntro ? true
|
|
, enableTruetype ? null # defaults to 24, see init.txt
|
|
, enableFPS ? false
|
|
, enableTextMode ? false
|
|
, enableSound ? true
|
|
}:
|
|
|
|
let
|
|
inherit (lib)
|
|
getAttr
|
|
hasAttr
|
|
licenses
|
|
maintainers
|
|
optional
|
|
platforms
|
|
;
|
|
|
|
dfGame = versionToName dfVersion;
|
|
dwarf-fortress =
|
|
if hasAttr dfGame df-games
|
|
then getAttr dfGame df-games
|
|
else throw "Unknown Dwarf Fortress version: ${dfVersion}";
|
|
dwarf-therapist = dwarf-fortress.dwarf-therapist;
|
|
|
|
mainProgram = if enableDFHack then "dfhack" else "dwarf-fortress";
|
|
in
|
|
buildEnv {
|
|
name = "dwarf-fortress-full";
|
|
paths = [
|
|
(dwarf-fortress.override {
|
|
inherit enableDFHack enableTWBT enableSoundSense enableStoneSense theme
|
|
enableIntro enableTruetype enableFPS enableTextMode enableSound;
|
|
})
|
|
]
|
|
++ optional enableDwarfTherapist dwarf-therapist
|
|
++ optional enableLegendsBrowser legends-browser;
|
|
|
|
meta = {
|
|
inherit mainProgram;
|
|
description = "Opinionated wrapper for Dwarf Fortress";
|
|
maintainers = with maintainers; [ Baughn numinit ];
|
|
license = licenses.mit;
|
|
platforms = platforms.all;
|
|
homepage = "https://github.com/NixOS/nixpkgs/";
|
|
};
|
|
}
|