Using established System tools

Is it correct, that system modifying tools, one is used to from other Linux operating systems won’t just work on NixOS?

For example, GRUB Customizer.

1 Like

If they modify config files which nixos expects to control, they won’t work. I’m not familiar with GRUB customizer, but just by the name, I’d bet it won’t work, since nixos expects full control of grub.

So, how can one adjust GRUB configuration as easily and thoroughly as with GRUB Customizer in NixOS?

NixOS documentation is extremely scarce.

Try a nixos option search or use man configuration.nix. There are many options to control grub, including options to add arbitrary text to the grub config.

1 Like

yes, most of them won’t just work. In addition to that most files are read only, the directory structure of NixOS is wastly different.

Isn’t that pretty much what is contained in the online documentation?

https://nixos.org/learn.html

I’ve read major parts of the manuals several times over the years and it all seems thorough, until I boot up NixOS and notice how nothing is really explained, at all. Things are just mentioned, but not explained for people who try to get into NixOS. (Trying to get into it since 3+ years, but it does not work.)

Not bad, though I would wish for complete examples, instead of just reference like minimal “examples”.

I assumed so, though I was never sure about it. Thanks for the confirmation.

I mean, yes, if you want to configure GRUB manually, you can do it this way anywhere, that’s a given. But there is apparently no way of letting it be handled, through GRUB Customizer, for example. You have to do everything manually.
So, this isn’t a real “solution” for someone who uses GRUB Customizer, for example.


All that said, I am not trying to use GRUB Customizer, I just used it as an exemplary system modifying tool, which is very popular, to get the point of my question across.

So, the conclusion is, if something system modifying wants to work on NixOS, it must include specific NixOS support, which requires extra effort by the maintainer of that system modifying tool, correct?

This is man page style. If you are searching for a more complete manual take a look at NixOS - NixOS 22.11 manual

not really “support”. You most likely want to change the settings via nixos settings and the tool could just dump the file.

Yes, I mean I read the online documentation. For example, the one you linked (unstable), but also previous versions.

Doesn’t that necessarily require extra user interaction? Like, implementing the dumped configuration file into a configuration.nix, by hand.

To expand on that, if you, for example, don’t take grub customizer, which probably writes to some hairy paths and is therefore a bad example for this kind of thing, but e.g. emacs’ theme creation, it will produce some theme.el file.

Instead of letting emacs just write this to your ~/.emacs and keep it there, you can run the config generator once, and then take the produced file and feed it to NixOS to install instead (note you can use builtins.readFile to read files, so you don’t need to manually turn them into a string or anything, or you can just get nix to symlink paths directly).

The “support” required is just that the configuration generator must create some kind of file for this configuration. Which given we’re in unix land is pretty much a given. Everything else is just the user understanding the tools they use well enough to know where the configuration ended up, and how to copy it around - something that configuration generators can try to support more (by adding a note in the UI of where the configuration ended up, for example).

This is the best that can be done, though; Configuration generators are inherently impure, and cannot be captured by any declarative model of your system configuration. They need to produce some output that can be taken into the model. If you’d rather have random paths lying around and generate them every time you set up a system, NixOS is probably not the right choice.

2 Likes

Instead of focusing on the perceived solution to a given problem, why don’t you tell us exactly what it is you are trying to achieve and we can see how we can then best help you?

Hosted by Flying Circus.