mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-08-27 02:34:53 +00:00
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 commitbf6ada5d78. This reapplies commit691dc02df0.
33 lines
571 B
Nix
33 lines
571 B
Nix
{
|
|
lib,
|
|
pkgs,
|
|
}:
|
|
let
|
|
inherit (lib.types)
|
|
serializableValueWith
|
|
;
|
|
in
|
|
{
|
|
format =
|
|
{ }:
|
|
{
|
|
type = serializableValueWith { typeName = "ConfigObj mapping"; };
|
|
|
|
generate =
|
|
name: value:
|
|
pkgs.runCommandLocal name
|
|
{
|
|
nativeBuildInputs = [
|
|
(pkgs.python3.withPackages (ps: [ ps.configobj ]))
|
|
];
|
|
|
|
inherit value;
|
|
__structuredAttrs = true;
|
|
strictDeps = true;
|
|
}
|
|
''
|
|
python3 ${./generate.py} > "$out"
|
|
'';
|
|
};
|
|
}
|