Wheee, #nix pkgs.formats.yaml produces invalid yaml
=> More informations about this toot | More toots from famfo@chaos.social
Is pkgs.formats.yaml a module or package? I'm going to bikeshed this tomorrow. Here's a repro if anyone is interested though:
nix-repl> yaml = pkgs.formats.yaml {}
nix-repl> drv = yaml.generate "meow.yaml" { test = "fd00::1"; }
nix-repl> builtins.readFile drv
"test: fd00::1\n"
Edit: a module doesn't make sense
=> More informations about this toot | More toots from famfo@chaos.social
The IPv6 address needs to be quoted, the safe option here is just to quote everything
=> More informations about this toot | More toots from famfo@chaos.social
this cost me a solid hour of sleep :(
=> More informations about this toot | More toots from famfo@chaos.social
Frustratingly, if I quote the string myself, this happens:
nix-repl> drv = yaml.generate "meow.yml" { test = ""fd00::1""; }
nix-repl> builtins.readFile drv
"test: '"fd00::1"'\n"
nix-repl> drv = yaml.generate "meow.yml" { test = "'fd00::1'"; }
nix-repl> builtins.readFile drv
"test: '''fd00::1'''\n"
=> More informations about this toot | More toots from famfo@chaos.social
@famfo why don't you use builtins.toJSON? json is a 100% valid subset of yaml.
=> More informations about this toot | More toots from Janik@chaos.social
@Janik a module I'm using uses yaml as it's config format and I don't feel like running around with a bunch of patches locally
=> More informations about this toot | More toots from famfo@chaos.social This content has been proxied by September (ba2dc).Proxy Information
text/gemini