about summary refs log tree commit diff
path: root/pkgs/games/build-support/build-unity.nix
diff options
context:
space:
mode:
authoraszlig <aszlig@nix.build>2017-11-21 07:06:08 +0100
committeraszlig <aszlig@nix.build>2017-11-21 07:44:50 +0100
commitaf83c63ef1926a7571943926fbbd08c6c129d737 (patch)
treedd3a8158009a0fafe933531e6ce04bb940ad8a84 /pkgs/games/build-support/build-unity.nix
parentd7fe5d2fa0909f8cf59fc7cc54dda00fe38a28a6 (diff)
pkgs/sandbox: Handle non-existing paths
We now distinguish between paths that have to exist and paths that are
fine to skip during bind mounting.

So far we had hard failures whenever a path that needed to be mounted
didn't exist, for example something like $XDG_CONFIG_HOME/unity3d failed
whenever the directory didn't exist.

Apart from that we now have a more clean attribute structure for sandbox
parameters, which are now:

  * paths.required: Created prior to bind-mounting
  * paths.wanted: Skipped if it doesn't exist
  * paths.runtimeVars: Extracted from PATH-like environment variables

Signed-off-by: aszlig <aszlig@nix.build>
Diffstat (limited to 'pkgs/games/build-support/build-unity.nix')
-rw-r--r--pkgs/games/build-support/build-unity.nix11
1 files changed, 9 insertions, 2 deletions
diff --git a/pkgs/games/build-support/build-unity.nix b/pkgs/games/build-support/build-unity.nix
index 596c65be..6d7a6cb1 100644
--- a/pkgs/games/build-support/build-unity.nix
+++ b/pkgs/games/build-support/build-unity.nix
@@ -6,6 +6,7 @@
 , nativeBuildInputs ? []
 , buildInputs ? []
 , runtimeDependencies ? []
+, sandbox ? {}
 , ...
 }@attrs:
 
@@ -27,7 +28,13 @@ in buildGame ({
     mesa xorg.libX11 xorg.libXcursor xorg.libXrandr libudev zlib
   ];
 
-  extraSandboxPaths = [ "$XDG_CONFIG_HOME/unity3d" ];
+  sandbox = sandbox // {
+    paths = (sandbox.paths or {}) // {
+      required = (sandbox.paths.required or []) ++ [
+        "$XDG_CONFIG_HOME/unity3d"
+      ];
+    };
+  };
 
   installPhase = ''
     runHook preInstall
@@ -62,5 +69,5 @@ in buildGame ({
   '';
 } // removeAttrs attrs [
   "name" "version" "fullName" "nativeBuildInputs" "buildInputs"
-  "runtimeDependencies"
+  "runtimeDependencies" "sandbox"
 ])