Hi all,
Apologies in advance if this is not the right category for this post. Feel free to move it.
Also please excuse any mistakes caused by my lack of knowledge.
I’m a first time NixOS user (just a week in) and I love it so far. I like tinkering with slightly experimental features (my previous OS was ArchLinux) so I’m currently using ‘unstable’ (nixpkgs-channels
master
branch).
I thought you may want to hear which parts of NixOS and it’s ecosystem work really well and what caused me a bit of trouble along the way (from a newcomer’s perspective).
So here it goes, a list of things that I really like about Nix:
- The manuals.
I can’t stress this enough but the manuals (Nix, NixOS, Nixpkgs, all three of them) are really comprehensive. I thought that ArchLinux install guide was in-depth but this is really on the next level. The availability of the manual offline on install USB system is a big plus. - Reproducible system set-up that can be (in principle) configured entirely in a single file.
I guess I’m just re-stating one of the main points of NixOS but here’s why it’s important to me:
My biggest pain point when managing my ArchLinux installation was the need to reconfigure everything whenever changing machines. Rarely it would be enough to just install the base system, reinstall the packages, copy over/etc
and/home
and call it done. Besides that I really hated the fact that 99% of that/etc
I had no idea what it does. Maybe I’m a purist but what really annoys me is when a program installs a config file with some defaults that you can then modify, but you get stuck with old defaults if they change because your config file never gets overwritten. Nix doesn’t do that (at least for system configuration, I’ll get to user config later) which I really like because each deviation from default config line is explicitly stated by myself in/etc/nixos/configuration.nix
(or included files). - Atomic system upgrades and easy rollbacks (no need for huge backups of the whole system).
This is another big issue I had (especially with my tendency to live on the edge). Many times I had to rescue my system from ArchLinux live USB stick after a system upgrade (I’ll keep that USB stick anyway since it is a good Linux rescue image overall). I even went to the point of having btrfs subvolumes regularly snapshotted and sent incrementally (usingbtrfs send
) to a backup drive from which I could simply restore every subvolume. I had separate ones for/usr
,/opt
,/home/
, and/
(it was quite small as it mostly included/var
(excluding/var/cache
),/etc
, and/root
). I guess I’ll keep backing up/home/
,/etc/nixos
, and perhaps/var
but now I can stop worrying about/usr
which saves a good few hundreds of GBs of backup space. Haven’t gotten to setting it up yet though . - Per user profiles; being able to install any program as non-root without awkwardly forcing it to use
~/bin
etc. and also being able to use different version of a program per-user and even separate environments (virtualenv
anyone?). - The
nix
package manager.
I really like how the directory structure in/nix/
is really simple and understandable. No magic databases (sqlite is no magic), caches, multi-level hash directory structures (de/adbeef
), etc. except for/nix/var/log/
. -
Nix pills.
I don’t like using software that I don’t understand how it works (at least at a high level) and without these it would be much harder to understand how exactlynix-env
andnixos-rebuild
work.
And here are a few things that I didn’t like:
- There’s still no official way to declaratively manage user packages and config.
Go team! I really hope we can come up with something amazing in this space. For now I’m rolling something of my own to manage my user profile. Just to get more fluent in Nix. - Umm, how big is the Nix community?
It seems like the community is quite split:- Repology lists 991 maintainers, my guess is this covers the discussions that happen on GitHub pull requests.
- Discourse seems to be the preferred(?) communication medium outside of pull requests, or at least it’s listed the highest on the community page. It has 765 total users, less than the number of maintainers (!).
- There’s the IRC channel. To be honest I have never heard that name (“IRC”) ever in my life, only read about it and used it once. That doesn’t say anything about other users though.
- Buried deep in the community page there’s a link to /r/NixOS with 3k subscribers. I don’t understand how is it more popular if it’s lower than discourse?
- The NixOS manual section 11.6. Wireless Networks would have been useful somewhere around chapter 2. Installing NixOS. Also manual could mention that it’s possible to store hashed psk in
/etc/nixos/configuration.nix
by usingwpa-passphrase
andpskRaw
config field. I’ll update that and make a pull request when I have the time. - The
systemd/logind
module has config forHandleLidSwitch
andHandleLidSwitchDocked
but notHandleLidSwitchExternalPower
. Yeah. I know this is a minor thing but I had to useextraConfig
. I’ll add support for this and make a pull request when I have the time. - I really wanted to have global
/bin/bash
available (sorry… ) and there was no option to do that. In fact/bin/sh
and/usr/bin/env
(which are the only globally installed binaries) share no common implementation of that installation process (even though it’s almost identical: /bin/sh, /usr/bin/env). There was nosystem.extraGlobalBinaries
to help, I had to copy-paste the install script. Let me know if it would be useful for someone else, then we can discuss if it’s worth having such a config available.
Nitpicks
Finally a bunch of nitpicks:
- The links in the Table Of Contents of NixOS manual all point to
https://nixos.org/nixos/manual/index.html#<section_name>
even if you loadedhttps://nixos.org/nixos/manual/
, this causes a reload of a page when navigating to such link. Other manuals don’t have that problem. - The
nix-*
andnixos-*
commands should really be merged into single commands (nix
andnixos
) or exploded into separate commands for each subcommand. For consistency. I totally understand that they are this way due to history but it is possible to deprecate the old way and remove it when most users have upgraded. - The above applies to builtins in nix language too. Most of them are
builtins.*
but there’s a bunch of names that are in the global namespace. Some of them make sense to be global (likeabort
) but some of them really stick out like a sore thumb (baseNameOf
,dirOf
,fetchTarball
).
Don’t worry about these though, they are nitpicks after all…