mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-27 16:16:16 +02:00
c34e96f7e0
This allows querying the location of function arguments. E.g. builtins.unsafeGetAttrPos "x" (builtins.functionArgs ({ x }: null)) => { column = 57; file = "/home/infinisil/src/nix/inst/test.nix"; line = 1; }
4 lines
156 B
Nix
4 lines
156 B
Nix
let
|
|
fun = { foo }: {};
|
|
pos = builtins.unsafeGetAttrPos "foo" (builtins.functionArgs fun);
|
|
in { inherit (pos) column line; file = baseNameOf pos.file; }
|