Files
nixpkgs/pkgs/pkgs-lib/formats/configobj/generate.py
Yuriy Taraday efdeeebcb9 Reapply "pkgs-lib/formats: Use .attrs.json where possible"
This expands on https://github.com/NixOS/nixpkgs/pull/498928 that
introduced __structuredAttrs here by actually using data in
`.attrs.json` when it makes sense, instead of relying on environment
variables.

This reverts commit bf6ada5d78.
This reapplies commit 691dc02df0.
2026-06-23 22:01:42 +02:00

11 lines
265 B
Python

import json
import os
import sys
from configobj import ConfigObj
config = ConfigObj(interpolation=False, encoding="UTF8")
with open(os.environ["NIX_ATTRS_JSON_FILE"]) as f:
value = json.load(f).get("value")
config.update(value)
config.write(sys.stdout.buffer)