mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-12 20:55:31 +03:00
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.
This commit is contained in:
parent
8bc5104a6e
commit
c8f5c30c37
4 changed files with 16 additions and 26 deletions
|
@ -3,7 +3,7 @@ import json
|
|||
import os
|
||||
import subprocess
|
||||
|
||||
with open(".attrs.json", "r") as f:
|
||||
with open(os.environ["NIX_ATTRS_JSON_FILE"], "r") as f:
|
||||
closures = json.load(f)["closure"]
|
||||
|
||||
os.chdir(os.environ["out"])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue