Installing home-manager from home-manager channel

#1

I am running nix 2.2.2 in Ubuntu 18.04 and I am trying to get home-manager installed with:

$ nix-channel --add https://github.com/rycee/home-manager/archive/master.tar.gz home-manager
$ nix-channel --update
$ nix-shell '<home-manager>' -A install -I $HOME/.nix-defexpr/channels 

I get the error:

/nix/store/kpa5ygpxfnsclyhs99znwva35f41ahns-home-manager/bin/home-manager: line 86: nix-build: command not found
/nix/store/kpa5ygpxfnsclyhs99znwva35f41ahns-home-manager/bin/home-manager: line 86: nix-build: command not found
/nix/store/kpa5ygpxfnsclyhs99znwva35f41ahns-home-manager/bin/home-manager: line 99: /run/user/1000/home-manager-build.1NJcaaYm7c/news-info.sh: No such file or directory

When I run:
nix run nixpkgs.home-manager -c home-manager switch

Installs it, but I would prefer having it installed as described in the github page (https://github.com/rycee/home-manager).

More context:

  • I am running fishshell and I also tried it in zsh and same error.
  • My nix-channels:
➜ nix-channel --list
home-manager https://github.com/rycee/home-manager/archive/master.tar.gz
nixpkgs https://nixos.org/channels/nixpkgs-unstable

What am I doing wrong? (really hope it’s not fishell)

#2

I don’t have much insight to offer on your errors, but I can confirm that home-manager works totally fine with Fish on OSX and NixOS, so I think/hope that’s not the culprit.

#3

Is nix-build in PATH? For example, can you run nix-build --version?

#4
➜ echo $PATH
/home/mandla/.nix-profile/bin /home/mandla/.fzf/bin /usr/local/sbin /usr/local/bin /usr/sbin /usr/bin /sbin /bin /usr/games /usr/local/games /home/mandla/.bin /home/mandla/.local/bin /home/mandla/.screenlayout /home/mandla/Projects/scripts /home/mandla/.nix-profile/bin

and

➜ nix-build --version
nix-build (Nix) 2.2.2

Running the script directly: /nix/store/kpa5ygpxfnsclyhs99znwva35f41ahns-home-manager/bin/home-manager shows the help text. I am now going through the nix-shell man page to find clues.

#5

I hope so too, I just started using fishshell seriously like Monday and would hate that it is the culprit :slight_smile:

#6

Quite curious. Did you find out what the issue was?

#7

I haven’t had a change to investigate it further. I simply installed it with

nix run nixpkgs.home-manager -c home-manager switch

I’ll probably look into it if/when this breaks.
Thanks.