This article is spot on. Fantastic operating system with a clear concept of how it should be done. And great for people that want to fight for it. But everything you want to do that’s slightly off the path is a 3 hour research project in documentation that’s pretty damn poor. It eventually wears you out.
I gave nixos a shot and pretty immediately noped out. All I wanted as a starting point was nvim with lazyvim. And as you said, it was a huge research project and after an hour with no luck, I nuked it.
I feel like it’s actually not that hard… if you can tell what advice is bad and shouldn’t be followed. Which I realize is a major catch-22 for new users.
My honest advice on Neovim (for everyone) is to do this:
environment.systemPackages = [ pkgs.neovim ];
Configure Neovim as you usually would (hand-written init.lua, Lazyvim installer, whatever)
Ignore/Disable Meson and use shell.nix to get language servers and formatters instead (alternatively: enable nix-ld for Meson or Mise)
Completely ignore all the wrapper garbage like programs.neovim, nixvim, nvf, nixCats, and all the others
The last one is important. You can try all you want to make the garbage work and it eventually will, at least kinda, but IMHO the very idea of what they’re trying to do is bad, ultimately making them a colossal waste of time.
I have less strong but overall similar feelings regarding Home Manager, those newly hyped wrapper managers and libraries, the “Dendritic Pattern”, etc. The NixOS community loves coming up with novel ways to shoot themselves in the foot.
But yeah, if you tried to use it when Sway wasn’t yet well-supported, or just want to use some obscure software in general, then yeah, things can get more complicated…
Oof, I was just talking about making things declarative there. If you want to configure it the old-fashioned way, like you would on other distros, then those difficulties don’t apply.
In more general terms, though, it’s a bit of a double-edged sword. The Nix package repository has more packages than other package managers: https://repology.org/repositories/graphs
So, the chance of finding an obscure software, that’s already packaged, is rather high.
Here’s the online package search, if you want to check the availability of some of the obscure software you use: https://search.nixos.org/packages
But then, yeah, the flipside is that, from what I understand, you can’t just download a random executable off of the internet and run it, because of the Filesystem Hierarchy Standard not being adhered to, as the post also mentions.
You can set up Flatpaks, and I believe AppImages would work, because those also live in their own FUSE filesystem. Well, and there is ways to emulate the FHS layout to get normal applications to run, too.
But yeah, way out of my field of expertise there. I have only one software installed which isn’t packaged for Nix, which is a program I wrote myself.
And to get sufficient FHS emulation for that, I just needed this line in my config:
(I could also add a flake.nix file into my software’s repository, though, which would make it so it could be installed straight from my repo, as if it was packaged.)
This module is actually a bit of a pet peeve of mine and a big reason I soured on Home Manager in general…
You inevitably end up writing chimera configurations like this:
# home.nix
programs.sway = {
enable = true;
# not supported by module - need to use escape hatch
# good luck getting your editor to syntax highlight this snippet btw
extraConfig = /* swayconfig */ ''
bindgesture swipe:right workspace prev
bindgesture swipe:left workspace next
'';
};
programs.waybar = {
enable = true:
# can't do that in Nix
style = /* css */ ''
window#waybar {
background: #16191C;
color: #AAB2BF;
}
'';
};
# configuration.nix
# need to enable Sway a second time so the display manager can see it
# this may also install a second Sway if you fuck up your HM setup
programs.sway.enable = true;
and in exchange for this you get:
30s+ iteration times for basic changes like keybinds
No ability to copy paste config snippets from READMEs/Wikis (unless you use home.file/extraConfig escape hatches)
No ability to edit configuration in scripts (breaks a lot of theming functionality in “shells” like DMS, Noctalia, etc.)
More ways to write configs that look right but don’t quite work or just do dumb things (extra Nixpkgs imports, duplicated packages, WMs that aren’t visible to the DM, etc.)
Alternatively you could just use a dotfile manager like rcm or stow or chezmoi like everyone not on NixOS+HM and not have to deal with any of this.
Yeah, I can understand the frustration. IMHO the Home-Manager way of doing things has some merits:
You can (generally) manage the installation of packages together with their configuration.
You can override individual configuration values for different machines (which I guess, you can also do via templating in chezmoi).
Some programs don’t have a particularly readable configuration file or spread this configuration out over multiple files, or save all kinds of additional garbage into their configuration file which you don’t want to persist. Home-Manager can work around all these issues, and in such a case is likely also better documented than the original configuration file.
That last point is one that’s particularly relevant for me, because KDE Plasma’s configuration files are largely terrible. Home-Manager, together with Plasma-Manager, is the only sane way I know of, to automate the panel configuration in KDE.
But yeah, if you don’t use software with terrible configuration files, then I can certainly understand preferring dumb templating. I have also decided against using the Home-Manager-specific modules in places, or might only translate into the Home-Manager-specific module when I actually want to vary configuration values between two machines.
Just to give a quick impression of how terrible the KDE panel configuration is, this is a snippet out of the fittingly-called plasma-org.kde.plasma.desktop-appletsrc file:
Ah sorry, that doesn’t actually show any of the panel configuration, because KDE mixes configuration for the panel and desktop widgets and the Activities feature (like workspaces, but with separate wallpapers and widgets for each Activity) all into the same file.
So, here’s a snippet that actually shows the panel configuration, from just a few lines below the first snippet:
What those numbers in e.g. [Containments][1807][Applets][1812] are? Ah, they just count those from 0 to infinity, whenever you add a widget through the UI.
And in case you were wondering since when INI allows for nesting section keys via [multiple][brackets]: It doesn’t. That’s a custom extension of the INI format, specifically in use by KDE.
Like, man, I love KDE for its features, but this is the stuff of nightmares.
I remember home-manager integrated with flakes being a nightmare for my potato laptop because I defined even the bash alias and such stuffs in it and even if I had to change/add a simple alias I had to rebuild the whole system lol, I could have just used home-manager standalone to be honest(I forgot to do this) but I just switched to using the old way of managing dotfiles with stow.
So right now I have it defined in the .config/sway/config file like this:
Does Home Manager not just have a dot file manager built in? On Guix, I just have my Waybar config. get moved to the appropriate location that Waybar will expect it.
Some services will even allow you to specify files to get injected into the config.; like the Bash service so I can write some definitions out in a .sh file and the service inserts that contents after the boilerplate it provides into my .bashrc.
I love NixOS but it really does make the hard things easy and the easy things hard. I even take “vacations” from it. Like right now for example. I switched back to Arch for a bit as I found myself spending too much time playing around with my various nix configurations/modules and also getting frustrated in trying to get some random application to work. So went back to Arch so I don’t have to think about stuff.
the beauty of NixOS is I can go back to it and be exactly where I left off in like 15minutes. I just need a break from it.
Sure it is now, but it was not always. Gentoo didnt just spring forth from the aether full-grown.
pre-alpha
The period of pre-0.1 that I reference above, ended in 2002 with the release of 0.1 Alpha. This is back when the idea of adding a binary installer was controversial in the gentoo community.
That was 24 years ago, in case you are following along. So going on about the current state of Gentoo is not super relevant. I am glad it is better, but I am old enough to remember when it was a pretty gnarly ball of yarn and that is what I mentioned.
There’s a forum, which is fine, but the people on there are very insistent that you should do things “the nix way” and if you don’t go all in on that then you get chastised.
There’s a manual, a discourse (forum) and a Matrix. And an unofficial subreddit and a Lemmy community. As well as two wikis and a large number of random people writing blog posts and tutorials.
This might be a hot take but honestly I think the documentation quality isn’t the problem. You can point to specific topics that aren’t well documented but that isn’t unusual. What’s unusual is how NixOS is designed and how working around its quirks requires close to distro maintainer levels of knowledge.
Most distros don’t require several pages of documentation on how to install a Python application. NixOS on the other hand…
This article is spot on. Fantastic operating system with a clear concept of how it should be done. And great for people that want to fight for it. But everything you want to do that’s slightly off the path is a 3 hour research project in documentation that’s pretty damn poor. It eventually wears you out.
I gave nixos a shot and pretty immediately noped out. All I wanted as a starting point was nvim with lazyvim. And as you said, it was a huge research project and after an hour with no luck, I nuked it.
I feel like it’s actually not that hard… if you can tell what advice is bad and shouldn’t be followed. Which I realize is a major catch-22 for new users.
My honest advice on Neovim (for everyone) is to do this:
environment.systemPackages = [ pkgs.neovim ];init.lua, Lazyvim installer, whatever)programs.neovim, nixvim, nvf, nixCats, and all the othersThe last one is important. You can try all you want to make the garbage work and it eventually will, at least kinda, but IMHO the very idea of what they’re trying to do is bad, ultimately making them a colossal waste of time.
I have less strong but overall similar feelings regarding Home Manager, those newly hyped wrapper managers and libraries, the “Dendritic Pattern”, etc. The NixOS community loves coming up with novel ways to shoot themselves in the foot.
Nixos user here for 4 years.
Yep
Its legit you want to try sway window manager?!?
Sway = true;
You want to change the keybinds and make it declarative.
MAY GOD HELP YOU.
Files.home
Is what u want and it took me 3 hours to find that
Seems like there’s now an option for that in Home-Manager: https://nix-community.github.io/home-manager/options.xhtml#opt-wayland.windowManager.sway.config.keybindings
But yeah, if you tried to use it when Sway wasn’t yet well-supported, or just want to use some obscure software in general, then yeah, things can get more complicated…
Well thanks, so NixOS is not for me then.
Oof, I was just talking about making things declarative there. If you want to configure it the old-fashioned way, like you would on other distros, then those difficulties don’t apply.
In more general terms, though, it’s a bit of a double-edged sword. The Nix package repository has more packages than other package managers: https://repology.org/repositories/graphs
So, the chance of finding an obscure software, that’s already packaged, is rather high.
Here’s the online package search, if you want to check the availability of some of the obscure software you use: https://search.nixos.org/packages
But then, yeah, the flipside is that, from what I understand, you can’t just download a random executable off of the internet and run it, because of the Filesystem Hierarchy Standard not being adhered to, as the post also mentions.
You can set up Flatpaks, and I believe AppImages would work, because those also live in their own FUSE filesystem. Well, and there is ways to emulate the FHS layout to get normal applications to run, too.
But yeah, way out of my field of expertise there. I have only one software installed which isn’t packaged for Nix, which is a program I wrote myself.
And to get sufficient FHS emulation for that, I just needed this line in my config:
More complex programs will need a bit of extra configuration: https://wiki.nixos.org/wiki/Nix-ld
(I could also add a
flake.nixfile into my software’s repository, though, which would make it so it could be installed straight from my repo, as if it was packaged.)This module is actually a bit of a pet peeve of mine and a big reason I soured on Home Manager in general…
You inevitably end up writing chimera configurations like this:
and in exchange for this you get:
home.file/extraConfigescape hatches)Alternatively you could just use a dotfile manager like rcm or stow or chezmoi like everyone not on NixOS+HM and not have to deal with any of this.
Yeah, I can understand the frustration. IMHO the Home-Manager way of doing things has some merits:
That last point is one that’s particularly relevant for me, because KDE Plasma’s configuration files are largely terrible. Home-Manager, together with Plasma-Manager, is the only sane way I know of, to automate the panel configuration in KDE.
But yeah, if you don’t use software with terrible configuration files, then I can certainly understand preferring dumb templating. I have also decided against using the Home-Manager-specific modules in places, or might only translate into the Home-Manager-specific module when I actually want to vary configuration values between two machines.
Just to give a quick impression of how terrible the KDE panel configuration is, this is a snippet out of the fittingly-called
plasma-org.kde.plasma.desktop-appletsrcfile:[ActionPlugins][0] MiddleButton;NoModifier=org.kde.paste RightButton;NoModifier=org.kde.contextmenu [ActionPlugins][1] RightButton;NoModifier=org.kde.contextmenu [Containments][1122] activityId=f588743a-9bab-4f56-8f90-3616085ab6e0 formfactor=0 immutability=1 lastScreen=1 location=0 plugin=org.kde.plasma.folder wallpaperplugin=org.kde.color [Containments][1122][Wallpaper][org.kde.color][General] Color=#79740eAh sorry, that doesn’t actually show any of the panel configuration, because KDE mixes configuration for the panel and desktop widgets and the Activities feature (like workspaces, but with separate wallpapers and widgets for each Activity) all into the same file.
So, here’s a snippet that actually shows the panel configuration, from just a few lines below the first snippet:
[Containments][1807] activityId= formfactor=3 immutability=1 lastScreen[$i]=0 location=5 plugin=org.kde.panel wallpaperplugin=org.kde.image [Containments][1807][Applets][1808] immutability=1 plugin=org.kde.plasma.showActivityManager [Containments][1807][Applets][1810] immutability=1 plugin=org.kde.plasma.pager [Containments][1807][Applets][1810][Configuration][General] showOnlyCurrentScreen=true showWindowIcons=true wrapPage=true [Containments][1807][Applets][1811] immutability=1 plugin=org.kde.plasma.panelspacer [Containments][1807][Applets][1812] activityId= formfactor=0 immutability=1 lastScreen=-1 location=0 plugin=org.kde.plasma.systemtray popupHeight=432 popupWidth=432 wallpaperplugin=org.kde.imageWhat those numbers in e.g.
[Containments][1807][Applets][1812]are? Ah, they just count those from 0 to infinity, whenever you add a widget through the UI.And in case you were wondering since when INI allows for nesting section keys via
[multiple][brackets]: It doesn’t. That’s a custom extension of the INI format, specifically in use by KDE.Like, man, I love KDE for its features, but this is the stuff of nightmares.
Well, is it like that using home manager?
I remember home-manager integrated with flakes being a nightmare for my potato laptop because I defined even the bash alias and such stuffs in it and even if I had to change/add a simple alias I had to rebuild the whole system lol, I could have just used home-manager standalone to be honest(I forgot to do this) but I just switched to using the old way of managing dotfiles with
stow.So right now I have it defined in the
.config/sway/configfile like this:input * { xkb_layout "us" xkb_options "caps:ctrl_shifted_capslock" }Maybe I will come back to using standalone home-manager one day.
Does Home Manager not just have a dot file manager built in? On Guix, I just have my Waybar config. get moved to the appropriate location that Waybar will expect it.
Some services will even allow you to specify files to get injected into the config.; like the Bash service so I can write some definitions out in a .sh file and the service inserts that contents after the boilerplate it provides into my
.bashrc.It does, that’s the
home.fileescape hatch I mentioned. But then you end up paying 10-30 seconds eval for a “config” that looks like this:I suppose there are fringe use cases where Nix attrset merging behaviour is useful, but in the average case I just don’t see much value here.
I love NixOS but it really does make the hard things easy and the easy things hard. I even take “vacations” from it. Like right now for example. I switched back to Arch for a bit as I found myself spending too much time playing around with my various nix configurations/modules and also getting frustrated in trying to get some random application to work. So went back to Arch so I don’t have to think about stuff.
the beauty of NixOS is I can go back to it and be exactly where I left off in like 15minutes. I just need a break from it.
This reminds me of something I might have said of pre-alpha Gentoo days.
Gentoo is well documented and works almost out of the box.
Sure it is now, but it was not always. Gentoo didnt just spring forth from the aether full-grown.
The period of pre-0.1 that I reference above, ended in 2002 with the release of 0.1 Alpha. This is back when the idea of adding a binary installer was controversial in the gentoo community. That was 24 years ago, in case you are following along. So going on about the current state of Gentoo is not super relevant. I am glad it is better, but I am old enough to remember when it was a pretty gnarly ball of yarn and that is what I mentioned.
Is there no forum or discord for the distro? Or a self help book. Way back in the day that’s how i did shit on slackware. Irc and books.
Pretty sure there’s an unofficial discord server with around 16k members.
There’s a forum, which is fine, but the people on there are very insistent that you should do things “the nix way” and if you don’t go all in on that then you get chastised.
A bit of friction when going off the beaten path is generally a good thing. Some people always take this too far though
As is tradition.
There’s a manual, a discourse (forum) and a Matrix. And an unofficial subreddit and a Lemmy community. As well as two wikis and a large number of random people writing blog posts and tutorials.
This might be a hot take but honestly I think the documentation quality isn’t the problem. You can point to specific topics that aren’t well documented but that isn’t unusual. What’s unusual is how NixOS is designed and how working around its quirks requires close to distro maintainer levels of knowledge.
Most distros don’t require several pages of documentation on how to install a Python application. NixOS on the other hand…
Ooof. Ok now I understand a bit. Thanks.