about summary refs log tree commit diff
path: root/pkgs/games/build-support
diff options
context:
space:
mode:
authoraszlig <aszlig@nix.build>2017-11-21 07:17:37 +0100
committeraszlig <aszlig@nix.build>2017-11-21 07:44:55 +0100
commit57df162fb098f0362a9b3f9e8cf497a5217cfab3 (patch)
treec471844ecd0d5e3e8776a776561c547251448ba6 /pkgs/games/build-support
parentc474d05d7384a4c6f83e53de25fa5fe61f4497e4 (diff)
pkgs/build-unity: Make saveDir optional
If the saveDir isn't set the game only gets access to all the saveDirs
from other Unity games, so missing that attribute shouldn't be a deal
breaker.

Signed-off-by: aszlig <aszlig@nix.build>
Diffstat (limited to 'pkgs/games/build-support')
-rw-r--r--pkgs/games/build-support/build-unity.nix8
1 files changed, 5 insertions, 3 deletions
diff --git a/pkgs/games/build-support/build-unity.nix b/pkgs/games/build-support/build-unity.nix
index a38e8e76..74610e6c 100644
--- a/pkgs/games/build-support/build-unity.nix
+++ b/pkgs/games/build-support/build-unity.nix
@@ -1,8 +1,9 @@
-{ stdenv, buildGame, makeWrapper, gtk2-x11, gdk_pixbuf, glib
+{ stdenv, lib, buildGame, makeWrapper, gtk2-x11, gdk_pixbuf, glib
 , mesa, xorg, libpulseaudio, libudev, zlib
 }:
 
-{ name, version, fullName, saveDir
+{ name, version, fullName
+, saveDir ? null
 , nativeBuildInputs ? []
 , buildInputs ? []
 , runtimeDependencies ? []
@@ -14,6 +15,7 @@ let
   arch = if stdenv.system == "x86_64-linux" then "x86_64" else "x86";
   executable = "${fullName}.${arch}";
   dataDir = "${fullName}_Data";
+  maybeSavedir = lib.optionalString (saveDir != null) "/${saveDir}";
 
 in buildGame ({
   name = "${name}-${version}";
@@ -31,7 +33,7 @@ in buildGame ({
   sandbox = sandbox // {
     paths = (sandbox.paths or {}) // {
       required = (sandbox.paths.required or []) ++ [
-        "$XDG_CONFIG_HOME/unity3d/${saveDir}"
+        "$XDG_CONFIG_HOME/unity3d${maybeSavedir}"
       ];
     };
   };