(I do not have permissions to post in Announcements, so I am sharing this here. Moderators are welcome to move it.) nix-manipulator is a Python library and CLI for parsing, transforming, and reconstructing Nix while preserving comments and layout, in line with RFC 166. It is built on Tree-sitter using the nix-community grammar. Motivations Nix is often described as “JSON on steroids”. I like this definition but did not find an easy way to update the values in a Nix file without doing string re...
@[email protected] , this could be really useful for advancing programmatic mutation of pre-existing nix config files using graphical installers and user administ ration tools, like with SnowflakeOS:
Wow, that’s awesome. Hopefully that can breathe some new life into SnowflakeOS! My attempts at manipulating nix code went through a nix parser that I can’t remember the name of. That’s when I found (or came up with? dunno) the importJson function. But this could be cleaner and more reviewable + definitely allows for things like function calls to take advantage of the “JSON on steroids” aspect the author mentioned.
@[email protected] , this could be really useful for advancing programmatic mutation of pre-existing nix config files using graphical installers and user administ ration tools, like with SnowflakeOS:
Wow, that’s awesome. Hopefully that can breathe some new life into SnowflakeOS! My attempts at manipulating nix code went through a nix parser that I can’t remember the name of. That’s when I found (or came up with? dunno) the
importJson
function. But this could be cleaner and more reviewable + definitely allows for things like function calls to take advantage of the “JSON on steroids” aspect the author mentioned.Thanks for sharing 🙏
Anti Commercial-AI license
What I’m really excited about is automatically editing Nixpkgs
meta
attrs, e.g. to implement https://github.com/NixOS/rfcs/blob/master/rfcs/0180-broken-package-removal.md