I will talk about this project I started the last summer, I had a soul sprint in Germany.
So when I started to learn Nix, I read somewhere like Nix is like G-SIN but on steroids
you have comments, you have variables, you have imports, you have functions, okay, a bit different
but I was like, okay, but it's okay, I like this, I can write my configuration, it's a bit like a better G-SIN works fine for me
but then can I manipulate it like G-SIN then, you know, I'm just making web apps, can I just generate my configuration from my Django app
if I have this configuration, I want to change the time zone, the host name, can I just do like import G-SIN and then, you know, change the time zone, change the host name and then this and, you know, G-SIN
apparently, no, so I was wondering how do people actually do this, look that's, you know, this but that opens all the pull requests to update packages, it does a lot of Nix code editing
so I was like, okay, these people they know how to do this, I'll look at how they do it, so I looked at the search code, so they do line replacements from the old version to the new version
which is not really, it's a bit less far than what I wanted to go, and also I find it quite risky because if you have two strings with the same old version in different parts of the code, it will just replace it naively as long as it's surrounded by quotes
so I decided to tackle this issue a bit deeper, which took quite some time at the end, and I built this project called Nix Manipulator
so imagine you have this configuration on the right, and you want to change, well for example, the time zone, you can import the from Nix Manipulator, import parts files
then I will just parse file of my configuration, it's normally pretty printing, which doesn't work super well in PT Python, but it usually works quite well in other normal standard Python
and then I have, so if I put this in a variable, it's a S, then I can do S dot, it's a function that has a notebook, so we're looking at the output of the function
and then in the output we want to get, for example, the time zone, and we want to get the value behind it
the expression out of it, and we have Europe that brush also, we can extract stuff directly from Nix code
we can also extract, for example, the boot information, so if I put here boot, I can extract the boot just the boot information
I can also nest it into my configuration, but I can also do changes, you know, I want to change the host name of this machine
I added a few shortcuts, so I can do just, I don't have to do the whole dot output and so and I can do just networking
and it will understand this should be in the output and then a host name
so I have this equals a new machine as dot save and then I can just reload and I have new machine there
so, part 5 just updated my Nix code and so we're starting to get somewhere
I also did a few more functionalities, for example, here I have this package that Nix and a package manager
but I want to automate package management and here is, I want to change the version of my package, but the version is defined here, not in here
actually, so I have already, part 5 I can do s-src, dash version, you know, tag, equals 1 to 3
and then s dot save, if I reload here, you will see it will have followed the reference and it goes to change it in this line
because here I'm just using the identifier, so it does follow references
I can also, for example, add things to list and also I did a, I see a line, so you can also access it using a CLI
for example, you can set variables directly from the CLI
as a conclusion, so we do nix to Python to nix, it's formats everything according to the RFC
and part is it's, most of the packages are a few RFC exceptions in the nix packages that go some issues
it's LGPL, so you can use it on all of your projects and the future the goals are easier, manipulation, more powerful
and interface and following import, so you could actually go read stuff that is imported and you also go modify it
and this is where you can find the repository, it's also on GitHub if you prefer this