Indent generated G-expression scripts
Published by Arun Isaac on
In other languages: தமிழ்
Tags: guix, software, scheme, lisp
Indent generated G-expression scripts with this trick to aid in debugging!
Quick tip!
Scripts generated from G-expressions (such as using program-file
or gexp->script
) often need to be inspected and debugged. But, they are written to the store as a gibberish tangled ball of parentheses. Indent them using guix-scheme-mode
in Emacs. guix-scheme-mode
is part of Emacs-Guix.
If you're not an Emacs user, you're not entirely out of luck. You can use this guile one-liner:
cat /gnu/store/…-foo | guile -c '((@ (ice-9 pretty-print) pretty-print) (read))'