Created
February 14, 2026 07:51
-
-
Save vsuharnikov/44fb153bacd67f2c43a56eb351ff9171 to your computer and use it in GitHub Desktop.
JSON5 to nix
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| # Usage: json52nix.sh <config.json5 | |
| set -euo pipefail | |
| nix run github:IvanIsCoding/celq -- --from-json5 'this' \ | |
| | nix eval --impure --raw --arg-from-stdin jsonText \ | |
| --expr ' | |
| { jsonText }: | |
| let | |
| lib = import <nixpkgs/lib>; | |
| value = builtins.fromJSON jsonText; | |
| in | |
| { out = lib.generators.toPretty {} value; } | |
| ' out |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment