pkgs-lib/formats: revert to remarshal for toml

This commit is contained in:
figsoda
2026-05-04 12:13:42 -04:00
parent c75e79956c
commit 331c7d8e30
3 changed files with 9 additions and 13 deletions
+1 -1
View File
@@ -471,7 +471,7 @@ recurseIntoAttrs {
toml = expectDataEqual {
file = writeTOML "data.toml" { hello = "world"; };
expected = ''
hello = 'world'
hello = "world"
'';
};
+3 -5
View File
@@ -461,18 +461,16 @@ optionalAttrs allowAliases aliases
generate =
name: value:
pkgs.callPackage (
{ runCommand, go-toml }:
{ runCommand, remarshal }:
runCommand name
{
nativeBuildInputs = [ go-toml ];
nativeBuildInputs = [ remarshal ];
value = builtins.toJSON value;
passAsFile = [ "value" ];
preferLocalBuild = true;
}
# -use-json-number: preserve JSON ints as TOML ints
# (Go's json.Decoder defaults to float64 for all numbers)
''
jsontoml -use-json-number < "$valuePath" > "$out"
json2toml "$valuePath" "$out"
''
) { };
+5 -7
View File
@@ -695,16 +695,14 @@ runBuildTests {
float = 3.141
int = 10
list = [1, 2]
str = 'foo'
str = "foo"
true = true
[attrs]
foo = 'foo'
foo = "foo"
[level1]
[level1.level2]
[level1.level2.level3]
level4 = 'deep'
level4 = "deep"
'';
};
@@ -725,7 +723,7 @@ runBuildTests {
];
};
expected = ''
language-server = ['bash-language-server', {except-features = ['diagnostics'], name = 'typescript-language-server'}]
language-server = ["bash-language-server", {except-features = ["diagnostics"], name = "typescript-language-server"}]
'';
};
@@ -739,7 +737,7 @@ runBuildTests {
"stack(x,n)" = "foobar";
};
expected = ''
'stack(x,n)' = 'foobar'
"stack(x,n)" = "foobar"
'';
};