by nextos · 2y ago · 0 comments
There are GUIs getting developed for e.g. NixOS that lower the barrier to use the OS pretty dramatically.
I agree things need to be simpler, but it would be nice to keep the capability to generate a bill of materials for each package.
IMHO, Flatpak is a regression in some of these aspects.
What you're describing is the use of bash builders in Nixpkgs. This is conventional because lots of build systems expect bash anyway, and because it lets you easily incorporate the whole Nix build environment for a given package into a conventional interactive shell for debugging, where you can invoke functions that are available in the build environment and even copy/paste snippets from the build to inspect their behavior. I like it; I think it's a good approach!
It's worth noting though that Nix supports using builders in arbitrary languages, and there are some rare uses of non-bash builders throughout Nixpkgs as well.
Some other points:
- if you prefer a using the same language for your package recipes as the builders themselves, Guix has you covered.
- Nix has built-in support for reading and writing to many some of the formats you mention, like TOML and JSON. Some tools use those languages to provide an external configuration language for Nix, for the simple stuff, e.g., devenv, devbox, Flox, etc. One could certainly attempt this with NixOS as well.
That’s not a breakout, nix just provides the glue around shell commands, because that’s the most readable/accepted way to specify process invocations. Nix should be thought of as a data store, it’s just a huge object with keys and values.