Merge pull request #178293 from lopsided98/pkgs-lib-cross
pkgs-lib: fix JSON, YAML and TOML cross-compilation
This commit is contained in:
commit
5b07a633aa
1 changed files with 13 additions and 13 deletions
|
@ -50,25 +50,25 @@ rec {
|
|||
};
|
||||
in valueType;
|
||||
|
||||
generate = name: value: pkgs.runCommand name {
|
||||
nativeBuildInputs = [ pkgs.jq ];
|
||||
generate = name: value: pkgs.callPackage ({ runCommand, jq }: runCommand name {
|
||||
nativeBuildInputs = [ jq ];
|
||||
value = builtins.toJSON value;
|
||||
passAsFile = [ "value" ];
|
||||
} ''
|
||||
jq . "$valuePath"> $out
|
||||
'';
|
||||
'') {};
|
||||
|
||||
};
|
||||
|
||||
yaml = {}: {
|
||||
|
||||
generate = name: value: pkgs.runCommand name {
|
||||
nativeBuildInputs = [ pkgs.remarshal ];
|
||||
value = builtins.toJSON value;
|
||||
passAsFile = [ "value" ];
|
||||
} ''
|
||||
json2yaml "$valuePath" "$out"
|
||||
'';
|
||||
generate = name: value: pkgs.callPackage ({ runCommand, remarshal }: runCommand name {
|
||||
nativeBuildInputs = [ remarshal ];
|
||||
value = builtins.toJSON value;
|
||||
passAsFile = [ "value" ];
|
||||
} ''
|
||||
json2yaml "$valuePath" "$out"
|
||||
'') {};
|
||||
|
||||
type = with lib.types; let
|
||||
valueType = nullOr (oneOf [
|
||||
|
@ -161,13 +161,13 @@ rec {
|
|||
};
|
||||
in valueType;
|
||||
|
||||
generate = name: value: pkgs.runCommand name {
|
||||
nativeBuildInputs = [ pkgs.remarshal ];
|
||||
generate = name: value: pkgs.callPackage ({ runCommand, remarshal }: runCommand name {
|
||||
nativeBuildInputs = [ remarshal ];
|
||||
value = builtins.toJSON value;
|
||||
passAsFile = [ "value" ];
|
||||
} ''
|
||||
json2toml "$valuePath" "$out"
|
||||
'';
|
||||
'') {};
|
||||
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue