mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-24 14:43:37 +00:00
c8f5c30c37
Derivations affected by this patch set `__structuredAttrs = true;` and provide their own `builder`, i.e. it's necessary to `source .attrs.sh`. Rather than adding even more `if`-`source` monstrums, I decided to modify all of those derivations to use `buildCommand` or `runCommand`, without `builder` being set. Then, `$stdenv/setup` is sourced already and as a result it's safe to assume that `NIX_ATTRS_JSON_FILE`/`NIX_ATTRS_SH_FILE` point to a usable location both in a build and a shell session.
14 lines
401 B
Nix
14 lines
401 B
Nix
{ runCommand, python3, coreutils }:
|
|
# Write the references of `path' to a file, in order of how "popular" each
|
|
# reference is. Nix 2 only.
|
|
path: runCommand "closure-paths"
|
|
{
|
|
exportReferencesGraph.graph = path;
|
|
__structuredAttrs = true;
|
|
preferLocalBuild = true;
|
|
nativeBuildInputs = [ coreutils python3 ];
|
|
}
|
|
''
|
|
python3 ${./closure-graph.py} "$NIX_ATTRS_JSON_FILE" graph > ''${outputs[out]}
|
|
''
|