about summary refs log tree commit diff
path: root/users/edef/depot-scan.nix
diff options
context:
space:
mode:
Diffstat (limited to 'users/edef/depot-scan.nix')
-rw-r--r--users/edef/depot-scan.nix12
1 files changed, 12 insertions, 0 deletions
diff --git a/users/edef/depot-scan.nix b/users/edef/depot-scan.nix
new file mode 100644
index 000000000000..faa91855e8f9
--- /dev/null
+++ b/users/edef/depot-scan.nix
@@ -0,0 +1,12 @@
+{ pkgs, ... }:
+
+pkgs.writeShellScriptBin "depot-scan" ''
+  set -euo pipefail
+
+  path=$(git rev-parse --show-prefix)
+  path="''${path%%/}"
+  attr="''${path//\//.}"
+  root="$(git rev-parse --show-toplevel)"
+  echo "scanning //$path" >&2
+  nix-instantiate "$root" -A "$attr" -vv 2> >(${pkgs.perl}/bin/perl sources.pl) >&2
+''