Retiring the Home Manager 18.09 branch

I will stop “officially supporting” the release-18.09 branch of Home Manager starting May 1, 2019. The reason being that I want to finally switch my laptop over to NixOS 19.03 :slightly_smiling_face:

If you currently use the 18.09 branch then you are encouraged to switch to the release-19.03 branch as soon as possible. For the most part it should not be necessary to change your configuration but there are a few exceptions as described in the release notes.

7 Likes

I wasn’t aware there are different channels for home-manager. Is there anything to be done if I just install home-manager through nixpkgs?

In particular I bootstrap with nix run nixpkgs.home-manager -c home-manager switch and then let home-manager manage itself.

Yeah, Home Manager has two maintained branches at a time. These match the Nixpkgs master and current release branches. So if you are using Nixpkgs/NixOS unstable then you should use the Home Manager master branch and if you use a Nixpkgs/NixOS release then you should use the corresponding Home Manager release branch.

The home-manager package in Nixpkgs isn’t really maintained as far as I know. Seems it installs a HM version from 2018-11-04…

I’ve been meaning to set up my NUR so that it contains a HM package that’s generated daily. Then I could also build and push the documentation to my cachix binary cache for those who don’t want to rebuild the manual locally :slightly_smiling_face:

I run Nixos 19.03 and HM master; the idea is to get stable system services and bleeding edge user ones.

Does this make sense?

It depends. HM master does not automatically use Nixpkgs master, it uses whatever is in <nixpkgs>.

So if <nixpkgs> points to, for example, the nixos-19.03 channel by default then you should make sure to override it when running the home-manager tool. The easiest way to do this is to make a shell alias that adds the -I option. For example,

alias hm="home-manager -I nixpkgs=/path/to/nixpkgs-unstable"

or

program.bash.shellAliases.hm = "home-manager -I nixpkgs=/path/to/nixpkgs-unstable";

if you configure Bash through HM (similar for zsh and fish).

2 Likes

Why not? Installing home-manager from nixpkgs seems the most obvious solution to me. Keeps it in sync with the nixpkgs channel automatically. Has been working fine for me, even though its apparently outdated. Why use separate channels or the NUR?

1 Like

I’m reluctant to have it in Nixpkgs because Home Manager does not really have releases but rather a continuous stream of commits. So the package would need to be updated quite frequently, ideally daily, to keep up. If somebody wants to perform such regular updates then I wouldn’t mind at all :slightly_smiling_face:

The easiest way for me to solve this is to simply expand the CI setup I already have in my NUR for automatically updating the Firefox add-on package set.

Given that I’ve apparently used a version from half a year ago for a while now without noticing, we could probably get away with less frequent updates for most users :smiley:

As long as compatibility isn’t broken, semi-regular updates plus “whenever someone really can’t wait for a new feature” would probably cover it, at least for me. Definitely hard to beat the convenience of having it in nixpkgs. Maybe I’ll look into updating it some time.

2 Likes

I’m currently moving my dotfiles and packages installed with:

  users.users.my-user.packages = [...];

to home-manager (installed the same way just to give it a try), I’ve only realized it was an outdated version (2018-11-04) when program.tmux.enable didn’t seem to work in home.nix, that’s how great home-manager works outta the box.

Another way of using home-manager via nixpkgs and keeping updated is making an overlay:

self: super:

{
  home-manager = super.home-manager.overrideAttrs ( old: rec {
    name = "home-manager-${version}";
    version = "2019-04-23";
    src = super.fetchFromGitHub {
      owner = "rycee";
      repo = "home-manager";
      rev = "ba0375bf06e0e0c3b2377edf913b7fddfd5a0b40";
      sha256 = "1ksr8fw5p5ai2a02whppc0kz9b3m5363hvfjghkzkd623kfh9073";
    };
    installPhase = with super; ''
      install -v -D -m755 ${src}/home-manager/home-manager $out/bin/home-manager

      substituteInPlace $out/bin/home-manager \
        --subst-var-by bash "${bash}" \
        --subst-var-by coreutils "${coreutils}" \
        --subst-var-by findutils "${findutils}" \
        --subst-var-by gnused "${gnused}" \
        --subst-var-by less "${less}" \
        --subst-var-by HOME_MANAGER_PATH '${src}'
    '';
  });
}

Is there a way to have an overlay that would build the latest rev? A bit like a nightly I guess.

Not directly (AFAIK), but you could write a script that grabs the latest HEAD revision, calculates the sha, and updates your overlay accordingly.

3 Likes

I have that exact same alias :joy: