about summary refs log blame commit diff
path: root/users/edef/depot-scan.nix
blob: ce0f8d97990bd88e3feff2e2669f1f2ca14b6870 (plain) (tree)
1
2
3
4
5
6
7
8
9
10




                                        
                                               



                                         
                                                                                           
  
{ pkgs, ... }:

pkgs.writeShellScriptBin "depot-scan" ''
  set -euo pipefail

  path="''${1:-$(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 ${./depot-scan.pl}) >&2
''