NixOs and Home Manager: where is my profile?

Hi,

I’ve a configuration.nix that look like this (with the help of FAQ - NixOS Wiki ):

{ config, pkgs, ... }:

with pkgs;
let
  unstablePkgs = import <nixos-unstable> { config = { allowUnfree = true; }; };
in

{
  environment.systemPackages = with unstablePkgs; [
    k9s

    ## ide stay stable
    pkgs.vscode
    pkgs.home-manager
  ];
}

On my user profile I use home-manager to manager my configuration files (fish/git/tmux etc.) that I use like that:

{ pkgs, ... }:

with import <nixpkgs> { };

{
  nixpkgs.config.allowUnfree = true;

  home.sessionVariables = {
    EDITOR = "vim";
    GS_OPTIONS = "-sPAPERSIZE=a4";
    PAGER = "less";
    VISUAL = "code";
  };

  programs.home-manager.enable = true;

  programs.autojump = {
    enable = true;
    enableBashIntegration = true;
  };

  programs.command-not-found.enable = true;

  programs.bash = {
    enable = true;
  };
  programs.git = {
    enable = true;
    userName = "Toto";
    userEmail = "toto@toto.eu";
  };
}

My problem look like this this:

$ sudo su - -c "k9s version"
Version:    0.26.7
$ k9s version
Version:    0.25.18
$

My main user does not have “unstable” version of software, but only stable.
But my user root is ok.

So I think I have a mess between nixos and home-manager; how is build my profile ?

Ok I think I’ve my “solution”: home manager not following user channel · Issue #376 · nix-community/home-manager · GitHub

Not exactly what I expected… but anyway.

Fyi, if you want your system and user channels to match, the most reliable way of doing that is to use https://nix-community.github.io/home-manager/index.html#sec-install-nixos-module

There are lots of benefits to making them match, too, the most obvious of which is that you won’t be installing multiple copies of literally everything.

And if you find channels as awful to work with as I do, consider looking into flakes.

1 Like