about summary refs log tree commit diff
path: root/tools/depot-build.nix
diff options
context:
space:
mode:
Diffstat (limited to 'tools/depot-build.nix')
-rw-r--r--tools/depot-build.nix8
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/depot-build.nix b/tools/depot-build.nix
new file mode 100644
index 000000000000..5661d58760b5
--- /dev/null
+++ b/tools/depot-build.nix
@@ -0,0 +1,8 @@
+# Utility script for building any arbitrary depot path in its folder.
+{ pkgs, ... }:
+
+pkgs.writeShellScriptBin "depot-build" ''
+  TARGET=$(git rev-parse --show-prefix | sed 's|/$||')
+  echo "Building //$TARGET"
+  nix-build -A $(echo $TARGET | sed 's|/|.|') $(${pkgs.git}/bin/git rev-parse --show-toplevel)
+''