@@ -1,5 +1,6 @@
11{ stdenv, lib, buildEnv, dwarf-fortress-original, substituteAll
22, enableDFHack ? false, dfhack
3+, enableSoundSense ? false, soundSense, jdk
34, themes ? {}
45, theme ? null
56}:
@@ -13,13 +14,14 @@ let
1314 # These are in inverse order for first packages to override the next ones.
1415 pkgs = lib.optional (theme != null) ptheme
1516 ++ lib.optional enableDFHack dfhack
17+ ++ lib.optional enableSoundSense soundSense
1618 ++ [ dwarf-fortress-original ];
1719
1820 env = buildEnv {
1921 name = "dwarf-fortress-env-${dwarf-fortress-original.dfVersion}";
2022
2123 paths = pkgs;
22− pathsToLink = [ "/" "/hack" ];
24+ pathsToLink = [ "/" "/hack" "/hack/scripts" ];
2325 ignoreCollisions = true;
2426
2527 postBuild = lib.optionalString enableDFHack ''
@@ -44,6 +46,7 @@ stdenv.mkDerivation rec {
4446
4547 runDF = ./dwarf-fortress.in;
4648 runDFHack = ./dfhack.in;
49+ runSoundSense = ./soundSense.in;
4750
4851 buildCommand = ''
4952 mkdir -p $out/bin
@@ -57,6 +60,12 @@ stdenv.mkDerivation rec {
5760 --subst-var-by stdenv_shell ${stdenv.shell} \
5861 --subst-var dfInit
5962 chmod 755 $out/bin/dfhack
63+ '' + lib.optionalString enableSoundSense ''
64+ substitute $runSoundSense $out/bin/soundsense \
65+ --subst-var-by stdenv_shell ${stdenv.shell} \
66+ --subst-var-by jre ${jdk.jre} \
67+ --subst-var dfInit
68+ chmod 755 $out/bin/soundsense
6069 '';
6170
6271 preferLocalBuild = true;