Making NixOS more user-friendly: what's needed

Having worked on Nix-related documentation for almost a year as my day job all I can add to the discussion is this:

  1. all documentation can be made easy to understand if you make knowledge dependencies explicit and only use those you declare
  2. doing that takes a lot of time and effort, and it already begins with finding the leaf items (core concepts) to explain
  3. we desperately need a maintainer (i.e. lead editor) for NixOS documentation

Please feel free to step up and join the documentation team. I’ll do everything in my capacity to support you.

Personal opinion from first-hand experience: Ideally bring funding to work on the subject at least part-time for at least half a year. Anything else is probably going to stall or evaporate.

8 Likes

The great vantage is that, in a certain sense, Nix allows to configure the whole system using an uniform language. This is way better than to learn a hundred different configuration styles for a thousand different packages with intricate interactions.

Just do an internet search for LAMP or LTSP.

In this sense, NixOS is a perfect backend for a SnowflakeOS.

The only problem is that someone needs to write the plumbing - and it resumes to more NixOS modules!

1 Like

Some ramblings tonight while trying to work out a number of issues that remind me of “user friendly”. They might sound a rant - but I am positive we can fix it, and keep promoting Nixos.

Summary - I think we need to be more cautious about the benefits, but reinforce the path is worth it! :slight_smile:

  1. Better delineation of nix and nixos - it is far too easy to find a “help” that refers to the other side and doesn’t work for you :frowning:

  2. Up to date documentation - the number of times I have found something that should work (and did just 6 months ago) but doesn’t anymore…at least we need a mapping to “if you found x, try y”

  3. Flakes and home manager. It took me literally weeks to get a flake working that allows HM. And I still can’t find how to install “non-free” correctly! At least a guide that would steer those like me who will “get serious” to avoid the initial approach and jump straight to flakes would save angst trying to convert!

  4. “Passing the buck”. There is a lot of “it is really hard” stuff out there - my example is home-assistant where the wiki gives me an error and the only suggestion is to “ask the matrix group” (I have yet to find out how to do that in Nixos!). This approach makes Nixos appear unfriendly (and I am not blaming any users on the forum at all - just highlighting external perception).

  5. Reproducible. A lot is made of consistency and rollback. However, boot configs can easily break a system (I have done it several times), and nix is not a total panacea - I use folding at home and for my first 90 or so iterations of my system it wouldn’t work. Then it did for about 30-40 iterations. Now it doesn’t again. I documented my “fix” in the forum, and I haven’t deviated from that, but something has happened. I have the same app on 4 architectures - 3 don’t work with the GPU, and 1 does (in theory the hardest?!). Debug is really hard! I think that dragon warnings are required.

  6. The nix language seems very complicated to me at times. I often can’t look at two options and see how they differ, and hence why I should choose one or the other. As a result, the error are often impenetrable.

Finally - happy to try and help…so if anyone has suggestions where I can contribute let me know!

4 Likes

Boot is precisely one of these hard-to-catch things, and there are specific instructions about it. Basically the boot is hard to be made reproducible.

1 Like

Hello! Creator of SnowflakeOS here. From experience, I’ve found that the main difficulty in making a user-friendly interface for NixOS is many different ways someone can structure their configuration. This is part of the reason I decided to make SnowflakeOS instead of just a series of add-ons to NixOS, it allows me to make opinionated and predictable choices in how everything is configured.

I feel like this is even more relevant to NixOS than any other distro given how many different ways you can manage and configure it.

I think it can be in time, at least out of the box, but given what I mentioned above about endless ways to configure everything, I feel like it’d be pretty hard to support all possible configuration formats, and would add additional burden to the NixOS team. However I do plan on making Nix Software Center and NixOS Configuration Editor available in nixpkgs once stabilized. So theoretically once that happens a new used could just add nix-software-center to their environment.systemPackages and be able to use it pretty easily.

But overall the goals I have for SnowflakeOS are to:

  1. Show that a user-friendly NixOS based distro is not only possible, but also works well
  2. Create tooling for creating other NixOS based distros
  3. Create user friendly tools for all NixOS users (Like the software center and configuration editor)
8 Likes

The Calamares Installer feels, to me, like a shuttle service to a space lab where a bunch of scientists have been floating around in suspended animation conducting esoteric experiments for a long time.

The only way Nixos might work for me is if every 6 months HQ provided a few templates for action and I go on a Linode and go though them, monkey see monkey do. By following one at a time one of the multiple Byzantine options for configuration I could at least see at least a plumbing in action, which would expand my mind, for sure.

Until then I know my limits…

2 Likes

You can not define it any better anymore… There is a clear boundary.

nix is the tool and language.

“nixOS” is the linux distribution that uses the nix expression language and the nix build tool to manage itself.

There are even 3 seperate manuals for Nix, nixpkgs, and NixOS.

I have to agree though that some inofficial ressources are mixing Nix, NixOS, and Nixpkgs’ responsibilities and are very sloppy with the naming.

I have never had that problem in the official documentation. If this happened to you with the official documentation please point out the location, that is something the doc-team needs to be aware of!

Then please open a thread here. Though, HM is not NixOS, nor is it an official extension. It is a community project.

5 Likes

Thanks @AndersonTorres and @NobbZ for positive replies to my grumpy post (wasn’t meant to be but I seem to be collecting issues faster than I can whack down!).
I’ve probably been to quick to find the answer rather than re-read the official docs, so I will try better…and I’m not really a programmer and find nix hard which doesn’t help.
I’ll create a thread regarding HM - I’ve only very recently got flakes working, and I want to document what I have tried with HM. I prefer to create a post that helps document better what I have tried rather than just “this is the magic line to put in configuration.nix”.

1 Like

Hello! I’m glad you paid attention to this post.

Yes, it really is.

However, have you considered making these utilities so that they follow the “standard” configuration.nix hierarchy and if something unusual is detected (e.g. files are connected differently somehow or a parameter has completely different values) give warnings that the utility may/will not work correctly?

I mean, newbies are unlikely to do anything unusual at first.

And if, after a while, they want to complicate their configuration, they will have already mastered the terminal and they are unlikely to need graphical configurators.

@milachew I wondered what the “standard” configuration.nix hierarchy was (and where it is documented)…I have done a search and can’t find it.

I’ve made enough progress to want to create a flake for several machines and it would be great to follow the best practice :slight_smile:

Cool thing is, they already do! I try to support as many configurations as possible, so there are options to define your config locations, with the default checking /etc/nixos/configuration.nix.

I think by “standard” he means the default configuration structure set up when you first install NixOS. So no flakes, two nix files /etc/nixos/configuration.nix and /etc/nixos/hardware-configuration.nix. But even though this is the default, I wouldn’t say it’s necessarily best practice, just a good starting point.

1 Like

Understood! So I am already beyond that using flakes…
Thx
In terms of best practice, some guidelines would be useful for those getting deeper into configuration.

My OCD makes me ponder if all my desktop config elements such be in “desktop.nix”, but I also want all services in “services.nix” (I know - my choice).

I would have appreciated some guide rails or a discussion of some of the implication of those choices.

1 Like

Yes, that is something of an issue. Discourse is much more discoverable, so we should prefer to point learners with specific issues here, rather than the matrix. In the end, it saves a lot of time when you can find a prior instance of your exact issue and an accompanying solution quickly and easily.

4 Likes

These pages offer some examples and even some frameworks you can work with. Digga even has some specific opinions on this very question.

https://nixos.wiki/wiki/Comparison_of_NixOS_setups
https://nixos.wiki/wiki/Configuration_Collection

1 Like

I think one of the major strengths of nixos/home-manager is the freedom to organize your config in the most intelligible way, rather than in a way dictated by the underlying structure of the programs you use.

To use that to the fullest, I recommend splitting your config into files not by what’s being configured, but why it’s being configured. Think of your config in terms of (fairly) modular pieces of functionality, or goals you want to achieve, then set whatever settings you need to for that functionality in one file. It’s fine if a single program has its settings spread all over the place, so long as things that are related, from your perspective as the user, go together.

This has the advantage that your code is a lot more readable in a year or two, when you’ve forgotten how it all fits together, and that it’s more readable for others when they look at only a part of it. But most of all, it’s editable without accumulating settings that you no longer know why they’re there or if it’s safe to remove them.

Sometimes that guideline will lead you to dedicate one file largely to a particular program, if the program fulfills the goal wholesale. Other times, it will lead you to combine a bunch of settings configuring different interacting parts of your system, to make a functioning workflow.

7 Likes

Recently I am using a monolithic configuration file. It is easier to find my configurations without the need of opening multiple files.

I believe that it would be interesting to do the same when using a graphical configurator: something like /etc/nixos/config-save.nix and the config tool would work on that.

Also it would allow to add arbitrary code, by always loading a /etc/nixos/config-custom.nix file when present.

1 Like