about summary refs log tree commit diff
path: root/pkgs/build-support/references-by-popularity
diff options
context:
space:
mode:
authorMaximilian Bosch <maximilian@mbosch.me>2023-09-28 19:25:28 +0200
committerMaximilian Bosch <maximilian@mbosch.me>2023-10-04 18:37:00 +0200
commitc8f5c30c37e60d2c96c525d9df0917f852e7f5ad (patch)
tree37dba2fb6c94a3298fff43532f48ed7d3b322dec /pkgs/build-support/references-by-popularity
parent8bc5104a6e6a6acf09f9d7ddf1c6a9293efb405a (diff)
pkgs/build-support: refactor drvs using `__structuredAttrs = true`
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.
Diffstat (limited to 'pkgs/build-support/references-by-popularity')
-rw-r--r--pkgs/build-support/references-by-popularity/default.nix13
1 files changed, 5 insertions, 8 deletions
diff --git a/pkgs/build-support/references-by-popularity/default.nix b/pkgs/build-support/references-by-popularity/default.nix
index dfc25275f34c5..2171c622f000a 100644
--- a/pkgs/build-support/references-by-popularity/default.nix
+++ b/pkgs/build-support/references-by-popularity/default.nix
@@ -6,11 +6,8 @@ path: runCommand "closure-paths"
   exportReferencesGraph.graph = path;
   __structuredAttrs = true;
   preferLocalBuild = true;
-  PATH = "${coreutils}/bin:${python3}/bin";
-  builder = builtins.toFile "builder"
-    ''
-      . .attrs.sh
-      python3 ${./closure-graph.py} .attrs.json graph > ''${outputs[out]}
-    '';
-  }
-  ""
+  nativeBuildInputs = [ coreutils python3 ];
+}
+''
+  python3 ${./closure-graph.py} "$NIX_ATTRS_JSON_FILE" graph > ''${outputs[out]}
+''