2020-05-08 05:48:21 +02:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with pkgs;
|
2020-05-26 16:43:19 +02:00
|
|
|
with lib;
|
2020-05-08 05:48:21 +02:00
|
|
|
|
|
|
|
let
|
|
|
|
|
|
|
|
df-orig = dwarf-fortress-packages.dwarf-fortress-original;
|
|
|
|
|
|
|
|
df-full = (dwarf-fortress-packages.dwarf-fortress-full.override {
|
|
|
|
theme = null;
|
|
|
|
enableIntro = false;
|
|
|
|
enableFPS = true;
|
2022-04-26 15:32:10 +02:00
|
|
|
enableDFHack = false; # Fails to build currently
|
2020-05-08 05:48:21 +02:00
|
|
|
});
|
|
|
|
|
2022-01-30 17:06:58 +01:00
|
|
|
init = runCommand "init.txt" { } ''
|
2020-05-08 05:48:21 +02:00
|
|
|
substitute "${df-orig}/data/init/init.txt" $out \
|
|
|
|
--replace "[INTRO:YES]" "[INTRO:NO]" \
|
|
|
|
--replace "[VOLUME:255]" "[VOLUME:0]" \
|
|
|
|
--replace "[FPS:NO]" "[FPS:YES]"
|
|
|
|
'';
|
|
|
|
|
2022-01-30 17:06:58 +01:00
|
|
|
d_init = runCommand "d_init.txt" { } ''
|
2020-05-08 05:48:21 +02:00
|
|
|
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]"
|
|
|
|
'';
|
|
|
|
|
2022-01-30 17:06:58 +01:00
|
|
|
df = runCommand "dwarf-fortress" { } ''
|
2020-05-11 00:40:14 +02:00
|
|
|
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
|
2020-05-08 05:48:21 +02:00
|
|
|
'';
|
|
|
|
|
2022-01-30 17:06:58 +01:00
|
|
|
in
|
|
|
|
mkMerge [
|
2020-05-26 16:43:19 +02:00
|
|
|
{
|
|
|
|
home.packages = [
|
|
|
|
crawl
|
2021-01-13 16:13:10 +01:00
|
|
|
xonotic
|
2020-05-26 16:43:19 +02:00
|
|
|
];
|
|
|
|
}
|
|
|
|
(mkIf stdenv.isLinux {
|
|
|
|
home.packages = [
|
|
|
|
df
|
2022-01-27 11:33:52 +01:00
|
|
|
polymc
|
2020-05-26 16:43:19 +02:00
|
|
|
];
|
|
|
|
})
|
|
|
|
]
|