Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

home manager not following user channel #376

Closed
shreyanshk opened this issue Sep 8, 2018 · 7 comments
Closed

home manager not following user channel #376

shreyanshk opened this issue Sep 8, 2018 · 7 comments

Comments

@shreyanshk
Copy link

shreyanshk commented Sep 8, 2018

Hi,
I'm new to home-manager and to NixOS in general. Please pardon me if I am missing anything.
I'm following the unstable channel for my user profile.

$ nix-channel --list
nixuns https://nixos.org/channels/nixos-unstable

BUT stable channel for the root/system profile

# nix-channel --list
nixos https://nixos.org/channels/nixos-18.03

I've installed homemanager with nix-env

# nix-env -iA nixuns.home-manager

My ~/.config/nixpkgs/home.nix file is as follows:

{pkgs, ... }: {
        home.packages = with pkgs; [
                aria2
                beets
                firefox
                go
                hexchat
                htop
                libreoffice
                neovim-qt
                qsyncthingtray
                tldr
                vlc
                youtube-dl
        ];

        programs.git = {
                enable = true;
                userName = "<Username>";
                userEmail = "<email>";
        };

        programs.home-manager.enable = true;
}

However, when I generate my profile with home-manage, the packages are installed from the stable branch.
I think home-manager should use the same branch used by nix-env for building user profile packages.
I know this because home-manager, for example, installs libreoffice-fresh version 6.0.2.1 (which is from stable branch) and not 6.1.0.3 (which is available in unstable branch).
Another example is Go compiler. Version 1.10.1 is installed from stable but not 1.11 which is available in unstable which I'm following.

@rycee
Copy link
Member

rycee commented Sep 8, 2018

Home Manager always uses <nixpkgs> for the package set. If you want to override this you can use the -I option along the lines of

$ home-manager -I nixpkgs=/nix/var/nix/profiles/per-user/$USER/channels/nixuns switch

I'm not completely certain this will be the precise path to the channel directory but it should be something like it. You can probably also find it under ~/.nix-defexpr/channels/.

@shreyanshk
Copy link
Author

Would it be possible to accommodate for this in the home.nix file?

@rycee
Copy link
Member

rycee commented Sep 9, 2018 via email

@rycee
Copy link
Member

rycee commented Sep 9, 2018

Did this solution work for you?

Typically in such situations I would create a shell alias along the lines of

alias hm='home-manager -I nixpkgs=/nix/var/nix/profiles/per-user/$USER/channels/nixuns'

And use the command hm switch instead (which also is faster to type 😉).

@shreyanshk
Copy link
Author

Yes!
That should be good enough.

Thank you.

@nixos-discourse
Copy link

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/selective-upgrading-of-packages-in-home-manager/9436/2

@nixos-discourse
Copy link

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/nixos-and-home-manager-where-is-my-profile/23260/2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants