tvl-depot/users/grfn/system/home/modules/games.nix
Vincent Ambo aa122cbae7 style: format entire depot with nixpkgs-fmt
This CL can be used to compare the style of nixpkgs-fmt against other
formatters (nixpkgs, alejandra).

Change-Id: I87c6abff6bcb546b02ead15ad0405f81e01b6d9e
Reviewed-on: https://cl.tvl.fyi/c/depot/+/4397
Tested-by: BuildkiteCI
Reviewed-by: sterni <sternenseemann@systemli.org>
Reviewed-by: lukegb <lukegb@tvl.fyi>
Reviewed-by: wpcarro <wpcarro@gmail.com>
Reviewed-by: Profpatsch <mail@profpatsch.de>
Reviewed-by: kanepyork <rikingcoding@gmail.com>
Reviewed-by: tazjin <tazjin@tvl.su>
Reviewed-by: cynthia <cynthia@tvl.fyi>
Reviewed-by: edef <edef@edef.eu>
Reviewed-by: eta <tvl@eta.st>
Reviewed-by: grfn <grfn@gws.fyi>
2022-01-31 16:11:53 +00:00

60 lines
1.5 KiB
Nix

{ config, lib, pkgs, ... }:
with pkgs;
with lib;
let
df-orig = dwarf-fortress-packages.dwarf-fortress-original;
df-full = (dwarf-fortress-packages.dwarf-fortress-full.override {
theme = null;
enableIntro = false;
enableFPS = true;
});
init = runCommand "init.txt" { } ''
substitute "${df-orig}/data/init/init.txt" $out \
--replace "[INTRO:YES]" "[INTRO:NO]" \
--replace "[VOLUME:255]" "[VOLUME:0]" \
--replace "[FPS:NO]" "[FPS:YES]"
'';
d_init = runCommand "d_init.txt" { } ''
substitute "${df-orig}/data/init/d_init.txt" $out \
--replace "[AUTOSAVE:NONE]" "[AUTOSAVE:SEASONAL]" \
--replace "[AUTOSAVE_PAUSE:NO]" "[AUTOSAVE_PAUSE:YES]" \
--replace "[INITIAL_SAVE:NO]" "[INITIAL_SAVE:YES]" \
--replace "[EMBARK_WARNING_ALWAYS:NO]" "[EMBARK_WARNING_ALWAYS:YES]" \
--replace "[VARIED_GROUND_TILES:YES]" "[VARIED_GROUND_TILES:NO]" \
--replace "[SHOW_FLOW_AMOUNTS:NO]" "[SHOW_FLOW_AMOUNTS:YES]"
'';
df = runCommand "dwarf-fortress" { } ''
mkdir -p $out/bin
sed \
-e '4icp -f ${init} "$DF_DIR/data/init/init.txt"' \
-e '4icp -f ${d_init} "$DF_DIR/data/init/d_init.txt"' \
< "${df-full}/bin/dwarf-fortress" >"$out/bin/dwarf-fortress"
shopt -s extglob
ln -s ${df-full}/bin/!(dwarf-fortress) $out/bin
chmod +x $out/bin/dwarf-fortress
'';
in
mkMerge [
{
home.packages = [
crawl
xonotic
];
}
(mkIf stdenv.isLinux {
home.packages = [
df
polymc
];
})
]