Ancestors

Written by famfo on 2025-01-18 at 03:20

Wheee, #nix pkgs.formats.yaml produces invalid yaml

=> View attached media

=> More informations about this toot | More toots from famfo@chaos.social

Toot

Written by famfo on 2025-01-18 at 03:36

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

Descendants

Written by famfo on 2025-01-18 at 03:36

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

Written by famfo on 2025-01-18 at 03:37

this cost me a solid hour of sleep :(

=> More informations about this toot | More toots from famfo@chaos.social

Written by famfo on 2025-01-18 at 03:41

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

Written by Janik on 2025-01-18 at 04:21

@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

Written by famfo on 2025-01-18 at 12:04

@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

Proxy Information
Original URL
gemini://mastogem.picasoft.net/thread/113847263400840235
Status Code
Success (20)
Meta
text/gemini
Capsule Response Time
293.671617 milliseconds
Gemini-to-HTML Time
1.414191 milliseconds

This content has been proxied by September (ba2dc).