Hacker News new | ask | show | jobs
Nix Home Manager Option Search (mipmip.github.io)
35 points by mipselaer 883 days ago
7 comments

This is a good example of how nix is both a) far to complicated a tool chain and b) completely underdocumented for how complicated it is.

I swear until I ripped nix off my systems, every time I had to do anything, even a simple home manager update, something would break in an unexplainable way and id have to dig for hours to figure it out, sometimes to no avail like with their libc libraries that end up breaking system compatability with no workaround.

Given that, this could be good for Home manager because the more they can improve documentation and disassociate their good product with the rats mess of an ecosystem it lives on, the better.

That's.... so strangely diametrically opposite to my experience with Nix. The language itself leaves some things to be desired, and of course no argument on the documentation, but as a build and packaging system I have never in my life experienced fewer headaches. Everything Just Works, every time. Granted, this is on a NixOS system -- I imagine trying to jam a standalone Home Manager install on top of a non-Nixos system is a rather different situation.
I think that's part of the problem. It seems like the only way to have a good nix experience is to go all in with NixOS. The problem is that is a huge sell for someone who already has an OS they like and the fact that testing out nix standalone is such a pain means you end up with very little confidence in the prospect of migrating everything over. Plus, at least when I considered NixOS a few years ago, the setup instructions seemed not well ironed out and made me really hesitant that it wouldn't brick my system.

All in all I think nix falls into the category of great idea in theory, but the implementation is so lacking in ergonomics and ease of use that I don't see how it could be anything other than a niche build system without major UX updates.

In my experience this isn't true. I use NixOS because it is my preferred OS due to ease of setup and ergonomics. When I have no choice but to use a different OS the tooling is still there for me to use and it works fine. It's the other package managers that I worry about.
A good example of what exactly? Because regarding (a), this is just a quick reference for options. Nothing more, nothing less. As for (b), you're literally looking at detailed documentation. It's almost as if you made up your mind before opening the link.
If nix/home-manager documentation wasnt awful this site wouldn't be needed. And the level of detail should be way better than a one line sentence with no examples.
There's nothing in this site that's not in the official Home Manager documentation. See here:

https://nix-community.github.io/home-manager/options.xhtml

Or alternatively:

    man home-configuration.nix
The official documentation does have examples.
Home Manager is not Nix.
On a related note, if anybody would like to get started with home-manager, we have a flake template for it:

https://github.com/juspay/nix-dev-home

I "love" these projects that won't even describe what they do on their front page or even in their manual.

Of course everybody has 30 minutes to spare to try to understand what it is.

Home-Manager is a project that brings declarative user home directory management to Nix. You can have it set up dotfiles, user systemd services, etc. All the things to do with stuff in your home directory.

The documentation for Home-Manager that is generated is an extremely large html file with every option listed. It is not easy to read or discover options in. The linked tool provides a search field to query the available options for Home-Manager, making it much easier to digest. This is similar to the NixOS Options search tool which does the same job of providing search for NixOS options.

Thanks, I thought it was some kind of home (house) automation. Do you have an example of what it's useful for? Why would I "manage" my home directory?
Declarative home environments are pretty great. Being able to reproduce your entire user setup is fantastic when you manage multiple machines or want to make future migrations.

I run NixOS and use Home-Manager as well. This lets me define my entire system in addition to my user home contents declaratively. So with this configuration I can apply NixOS & Home-Manager to get the same results anywhere.

Here is an example of my Home-Manager configuration: https://github.com/jakehamilton/config/blob/a3da20eeab74a50a...

In this example I configure Git. This gets written to my user home's config directory.

Where the "home config" in this case can be much more than just text files and, for example, can include the actual apps installed locally. So when you define your `.git/config` file, you can include `diff.external = ${pkgs.difft}` to refer to a locally installed version of app `difft` and home-manager does the right thing. You can also manage your user services through systemd or launchd.
The stuff Nix lets you declare really are very arbitrary. I even specify my Firefox extensions in my home-manager config.
Many command line programs keep their configurations somewhere under $HOME. These are often called "dotfiles".

If you ever use more than one machine, likely you'll want the same configuration available on all those machines.. so you'll want some way to copy them to a new machine.

Some dotfile managers are quite simple, like dotbot. https://github.com/anishathalye/dotbot

Home Manager from the Nix community is a bit more sophisticated. It allows for writing configurations in the Nix language, which is nice if you know/like Nix. (Nix is a powerful/expressive package manager. Nix is to apt-get what vim is to notepad).

Can this be used without using Nix at system level?
It can be used on non-NixOS Linux distributions and Mac OS.

https://nix-community.github.io/home-manager/index.xhtml#sec...

I agree that that would be good, however I do think this is the kind of thing where if you have use for it then you'll probably recognize it on sight.
Fear not, these are configuration options for a project called Home Manager, which manages your user configuration and dotfiles with the help of Nix the package manager:

https://drakerossman.com/blog/how-to-add-home-manager-to-nix...

This site is an unofficial quick reference, not a beginner's guide. It's good for its purpose.
it's a way to configure and generate your apps dotfiles declaratively using nix (expression) language
I love nix and use it for my configs and builds at work, but it is definitely hard to get going compared to other tools. I appreciate what you did going through and making some good docs, bookmarked!
Is there a good way of getting this sort of thing for nix projects in general? I often find myself cloning the repo for it just so I can grep for `mkOption` and I often wonder if there's a smarter way.
I only got it to the proof of concept stage, but I was hacking on something that would generate docs for everything found on a Nix Flake (including modules): https://github.com/snowfallorg/frost

Here's an example output that I generated for my config repo: https://jakehamilton.github.io/config/

Don't projects using Nix modules typically list all the available options in their documentation? For example,

https://nix-community.github.io/home-manager/options.xhtml

I find it good practice to actually read the modules though. So personally, I think grepping is fine.

Some services have a very heavy meta description. I can't think of one for home-manager right now, but in nixos caddy config is not easy to read from source.
man configuration.nix

Then use the search function of the pager.

man home-configuration.nix

works for home-manager

When you like Home Manager but don't like reading long manuals.
Hi
sup?