From 57df162fb098f0362a9b3f9e8cf497a5217cfab3 Mon Sep 17 00:00:00 2001 From: aszlig Date: Tue, 21 Nov 2017 07:17:37 +0100 Subject: 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 --- pkgs/games/build-support/build-unity.nix | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'pkgs/games') 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}" ]; }; }; -- cgit 1.4.1