Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I really love the theory of NixOS... an entire OS that is declaritively (or dynamically) defined. But the nix language itself does not seem like the right approach. A lot of packages just break out into command line scripting because of its limitations. As much as I've despised the JavaScript ecosystem in the past, it seems like TypeScript with Deno which has built-in JSON/TOML/INI/YAML and sandboxing would be a better language to handle automatic system configuration overall... plus, you'd have the advantage of a web app to manage your system config(s), sort of like what fish does.


> I really love the theory of NixOS... an entire OS that is declaritively (or dynamically) defined. But the nix language itself does not seem like the right approach. A lot of packages just break out into command line scripting because of its limitations.

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.


> lot of packages just break out into command line scripting because of its limitations

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.


Why not guile with guix?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: