How to manage user configuration with flakes without home manager on nixos-21.05?

I don’t know much about nixos yet.

I have found this article Switching non-NixOS Home Manager to flakes – dee.underscore.world.

How is it possible?

1 Like

Home-manager really only needs systemd to be available for the user systemd services to work.

Home-manager is essentially a very opinionated way to organize your dot files, there’s no need for the host system to be NixOS.

I still use my home-manager independently of my system. If you would like some “inspiration”, you can take a look: GitHub - jonringer/nixpkgs-config: ~/.config/nixpkgs

You should be able to use this on any linux system. I was even using it on WSL for a while.

2 Likes

The thing is I am quite new to nixos and I want to reduce number of abstraction layers I deal with.

So I thought about just using flakes, especially when I read this:

Unfortunately, it is quite possible to get difficult to understand errors when working with Home Manager, such as infinite loops with no clear source reference. You should therefore be comfortable using the Nix language and the various tools in the Nix ecosystem. Reading through the Nix Pills document is a good way to familiarize yourself with them.

2 Likes

The home-manager readme wording comes up a lot.

Essentially he (@rycee) is making it abundantly clear that usage of home-manager puts the liability of issues on the user. This is technically true of almost all OSS, it’s just very in your face about it.

3 Likes

The article that you linked is: no flakes home-manager → flakes home manager

NixOS doesn’t provide user level services and configuration which is why people also use home-manager.

Flakes is a way of pinning nixpkgs and other inputs (to grossly simplify) and isnt analogous to or a replacement for home-manager

1 Like

It’s also worth noting that trying to do a complex user-focused nixos without home manager essentially ends up being rewriting home manager, because you need to sort the problem of writing files from a nix build into $HOME and handling user services. Neither is trivial, and if you want to do either the best (only?) library available is home manager.

If you insist on reducing layers of abstraction for learning purposes, the best way to achieve that is probably to deep dive into the home manager source, figure out how they do it and then replicate that. I don’t think that would count as simplifying though.

3 Likes

I’ll take this opportunity to point out again that the nixpkgs/NixOS community needs to decide on home-manager and adopt it so we can stop scarring new comers. Poor @rofrol… I understand, though. I’ve been here for years and still don’t use home-manager! It isn’t officially part of the ecosystem and that warning is terrible!

9 Likes

Yeah, I have a rule to start with the smallest set when learning sth new.

2 Likes

Sorry for the necrobump, but is your config online somewhere by any chance?

1 Like

It is not. Is there anything in particular you would like to see?

I host a few websites for various people so I’m not keen on pushing those URLs to a public repo.

1 Like

The short version is, what do you do exactly to manage dotfiles and other config files without home-manager?

The longer version, with some context: basically I still use the same NixOS configuration file that I created 4 years ago after days of frustration going through the manuals and many blog posts. Wanted to understand it all, but in the end I settled with what I could cobble together the fastest. It still works, but want to go back to do it from scratch, and when going down the rabbit hole last night regarding “nixos dotfiles management”, the overwhelming majority of answers were: just use home manager or else you’ll be bound to re-create it. I have nothing against HM, but its documentation is confusing and I want to have a better understanding of NixOS anyway.

edit: Well, I guess I kind of answered my own question of what I should do:

  1. poke around in HM’s source
  2. improve the parts of its and the related Nix* docs that I found confusing with what I found out

: )

Also just documenting the sources I looked at:

2 Likes

I don’t. I could use something like stow or home-manager but personally it wouldn’t benefit me that much.

Generally I don’t care too much what text editor I write nix config in and use anything from vscode to kwrite, or even nano :exploding_head:

I generally don’t modify the default settings in local programs I use too much, and even if I did it isn’t a problem because I don’t get a new computer frequently enough to care.

I spend most of my time working on remote servers so either vscode takes care of keeping my setting consistent, or I just use default configuration. Sometimes I’ll only access a server once so generally I don’t spend any time making myself at home on a server.

I think I use desktop Linux out of familiarity/habit/comfort - it has been my desktop for 20+ years and it’s what I’m used to. I suppose I could use anything that has a half decent terminal, even a Chromebook.

Maybe not the answer you were looking for… but as mentioned the majority of my work is server related so desktop isn’t as important.

:man_shrugging:

1 Like