Duplication home-manager and nixos modules

Do you have examples? Even if the options overlap, user-specific and system-wide can by design almost not be represented in NixOS and home-manager respectively.

2 Likes

@TLATER

but how do i know if I chould choose system or home-manager module if I need the same options from either and I have only one user? Kind of confusing

1 Like

That’s for you to choose, and still pretty hard to assert anything about without an example.

Anyway, as a rule of thumb, does the program feel more tightly coupled to the user, and may travel between multiple systems along with your home-manager config - possibly even to non-NixOS systems - or is it tied to the specific device with its hardware? That’s how I tend to choose, since it makes it easier to maintain multiple systems.

And if you really don’t know, is it really so bad to just pick one at random?

Personally I’m more concerned with code duplication and the resulting maintenance overhead, feature drift, and actual problems caused by mismatching NixOS and home-manager versions. But none of those things will be solved by just blanket removing useful features, only a merge into nixpkgs would solve that.

7 Likes

@TLATER why did the merge not happen yet? I think the only problem with it are the evaluation times because nixpkgs gets so many more options. But besides that I see a ton of advantages

I don’t personally know. It’d be a fair bit of work, at the very least - it can’t be just a simple merge, since the options and how they work are quite different. Nonetheless, I think a fair few community members would love to see that, for the reasons I outlined as well as it becoming more “official”.

I am 100% for home-manager phagocytosis. After all, NixOS itself was phagocyted and the arguments for its flakification never convinced.
The same applies to HM, imho.

4 Likes

@TLATER @AndersonTorres should an rfc be opened for this? I think it would be a major step forwards.

I will certainly write one next week.
But, who wanna shepherd?

1 Like

I’d give it a try, but have never taken part in an RFC before, so may not be a good candidate for what is undoubtedly going to be a contentious RFC :wink:

Would probably be a good idea to involve @rycee in any discussion on this, too.

Looking forward to seeing where this will go, either way.

Thank you very much @AndersonTorres and @TLATER, I hope that we can eventually get somewhere with it. This has been bothering me for quite some time. I also know someone else who can shepherd, so I will tell him

I would say that the vast majority of “NixOS on desktop” users use a single user setup, and for these users there are no consequential differences at all between system and user packages.

Like, yes, there are differences in how this things are implemented, but if we look just at the behavior observable by the user in front of the screen, they are duplicates.

Which is one of my two main gripes with home manager — I run a single user system, and I only want to install system packages. I’d maybe love to take advantage of home-manager’s ability to generate some dotfiles, but not at the cost of adding a second way to install software.

The beauty of nix is that it’s still the same method of installing software when used on NixOS. All of it is in the nix store, installed by nix, coming from the exact same packages.

home-manager is just a different expression of their presence that makes them only visible in your user’s environment (and not for example root, or the other hundred miscellaneous system users your system has, even when it is “single user”).

I used to think similarly, I wanted my dotfiles to be decoupled from the packages. Over time I’ve accepted that you just can’t have functioning dotfiles when your systems use widely diverging software versions, things just always become incompatible.

You can also use home-manager’s dotfile management and add all the packages manually to environment.systemPackages if you really want all your packages to be in the same list, just force home.packages to be empty.

2 Likes

To clarify, I do want dotfiles in ~ to be synced with system package versions. The way I do this today is by storing my dotfiles and my flake.nix (which defines several hosts) in the same git repo.

1 Like

@AndersonTorres when you create that PR (rfc) for merging home-manager into nixpkgs, I guess it would also make sense to propose merging nixos-hardware directly into nixpkgs?

AFAICR nixos-hardware is a place for hackish things from buggy hardware quirks. Its purpose is similar to collect hardware oddities on a same place, like a knowledge database.

It also can become deprecated too fast - new hardware comes and old hardware goes.

It is more akin to NUR. I see no reason to include it under monorepo.

4 Likes

Brainstorming a bit:

  • As far as I remember, HM created some data structures. Maybe they can be factored and included into lib;
  • Duplication of code suggests factoring - a super structure from which nixos and hm can inherit
  • Merge the maintainers of both trees
  • New rules for ofborg and CIs in general

And a name: “All Your Home-Manager Are Belong To Us”. (No, the Borg was already taken.)

3 Likes

Not really — it started as a single (Subversion) repository, and the split was a mistake when moving to GitHub, and e.g. the committer lists were always shared. I think HM at some point refused the merge. Maybe the situation is different now.

So, a replacement for RFC78 from someone who doesn’t hate the module system? That could be useful.

1 Like

@shaniag

but how do i know if I chould choose system or home-manager module if I need the same options from either and I have only one user? Kind of confusing

To cite another example, OpenIndiana splits the system into user and admin, in such a way users can run bleeding edge softwares while the admin sets a bare, stable base system.

You can think on NixOS and Home Manager as these two faces: one for the root, other for the user.

Also remember that in Nix regular users can install softwares without asking for a sysadmin.

1 Like

Can anyone tell me how many people are involved in home-manager?
How many end users and how many developers, to be precise.
This will be a useful info for my arguments on the assimilation.

1 Like

Not an answer to what you asked but … I’m not a home manager user, but I probably would be if it were integrated into NixOS, even if just because it was available.