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

bug: Unable to install home-manager (NixOS, standalone) (not found in $NIX_PATH) #3091

Open
1 task done
NielsGx opened this issue Jul 14, 2022 · 5 comments
Open
1 task done
Assignees
Labels
bug triage Issues or feature request that have not been triaged yet

Comments

@NielsGx
Copy link

NielsGx commented Jul 14, 2022

Is there an existing issue for this?

  • I have searched the existing issues

Issue description

Hello,

on a VPS, fresh install built with NixOS 21.11, I updated the channel to 22.05, rebuilt, then changed my configuration.nix to have a user
then on this user, I add the channel for home-manager 22.05 and update it.

but when I do "nix-shell '' -A install" I get :
error: file 'home-manager' was not found in the Nix search path (add it using $NIX_PATH or -I)

I tried to reboot the vps, nothing. Also I ssh into root and then do su myuser, instead of directly connecting to myuser@ip, but this shouldn't cause issue.

I tried to mess around with $NIX_PATH but then it would return a permission error :

mktemp: failed to create directory via template ‘/run/user/0/home-manager-build.XXXXXXXXXX’: Permission denied
Uh oh, the installation failed! Please create an issue at

    https://github.com/nix-community/home-manager/issues

if the error seems to be the fault of Home Manager.

It does work if I add the channel to the root and install with it, but afaik the manual says to use a standard user, at least for the standalone install

(no, I don't want to update home-manager through nixos-rebuild)

thanks a lot for this awesome tool

Maintainer CC

No response

System information

- system: `"x86_64-linux"`
- host os: `Linux 5.15.53, NixOS, 22.05 (Quokka), 22.05.1627.4aceab3cadf`
-  multi-user?: `no`                            
- sandbox: `yes`
- version: `nix-env (Nix) 2.8.1`
- channels(niels): `"home-manager-22.05.tar.gz"`
- channels(root): `"nixos-22.05"`
- nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`

(idk why it says no to multi-user, bc I have root and a user "niels")
@NielsGx NielsGx added bug triage Issues or feature request that have not been triaged yet labels Jul 14, 2022
@NielsGx NielsGx changed the title bug: Unable to install home-manager (NixOS, standalone) bug: Unable to install home-manager (NixOS, standalone) (not found in $NIX_PATH) Jul 14, 2022
@stale
Copy link

stale bot commented Oct 16, 2022

Thank you for your contribution! I marked this issue as stale due to inactivity. Please be considerate of people watching this issue and receiving notifications before commenting 'I have this issue too'. We welcome additional information that will help resolve this issue. Please read the relevant sections below before commenting.

If you are the original author of the issue

  • If this is resolved, please consider closing it so that the maintainers know not to focus on this.
  • If this might still be an issue, but you are not interested in promoting its resolution, please consider closing it while encouraging others to take over and reopen an issue if they care enough.
  • If you know how to solve the issue, please consider submitting a Pull Request that addresses this issue.

If you are not the original author of the issue

  • If you are also experiencing this issue, please add details of your situation to help with the debugging process.
  • If you know how to solve the issue, please consider submitting a Pull Request that addresses this issue.

Memorandum on closing issues

Don't be afraid to manually close an issue, even if it holds valuable information. Closed issues stay in the system for people to search, read, cross-reference, or even reopen – nothing is lost! Closing obsolete issues is an important way to help maintainers focus their time and effort.

@zeratax
Copy link
Contributor

zeratax commented Mar 22, 2023

i have the same issue on a brand new install of 22.11

Seems this happens due to: NixOS/nix#2033 (comment)

@stale stale bot removed the status: stale label Mar 22, 2023
@stale
Copy link

stale bot commented Jun 21, 2023

Thank you for your contribution! I marked this issue as stale due to inactivity. Please be considerate of people watching this issue and receiving notifications before commenting 'I have this issue too'. We welcome additional information that will help resolve this issue. Please read the relevant sections below before commenting.

If you are the original author of the issue

  • If this is resolved, please consider closing it so that the maintainers know not to focus on this.
  • If this might still be an issue, but you are not interested in promoting its resolution, please consider closing it while encouraging others to take over and reopen an issue if they care enough.
  • If you know how to solve the issue, please consider submitting a Pull Request that addresses this issue.

If you are not the original author of the issue

  • If you are also experiencing this issue, please add details of your situation to help with the debugging process.
  • If you know how to solve the issue, please consider submitting a Pull Request that addresses this issue.

Memorandum on closing issues

Don't be afraid to manually close an issue, even if it holds valuable information. Closed issues stay in the system for people to search, read, cross-reference, or even reopen – nothing is lost! Closing obsolete issues is an important way to help maintainers focus their time and effort.

@mupinnn
Copy link

mupinnn commented May 11, 2024

Hello, I'm experiencing similar issue but in my case when installing home-manager.

$ nix-shell '<home-manager>' -A install
The file /home/sandbox/.config/home-manager/home.nix already exists, leaving it unchanged...

Creating initial Home Manager generation...

mktemp: failed to create directory via template ‘/run/user/1000/home-manager-build.XXXXXXXXXX’: No such file or directory
error: getting status of '/run/user/1000': No such file or directory
Uh oh, the installation failed! Please create an issue at

    https://github.com/nix-community/home-manager/issues

if the error seems to be the fault of Home Manager.
rm: cannot remove '': No such file or directory

Some information I can provide about my Nix setup:

$ echo $NIX_PATH
/home/sandbox/.nix-defexpr/channels:nixpkgs=/home/sandbox/.nix-defexpr/channels/nixpkgs

$ nix --version
nix (Nix) 2.22.1

$ nix-channel --list
home-manager https://github.com/nix-community/home-manager/archive/master.tar.gz
nixpkgs https://nixos.org/channels/nixpkgs-unstable

System Information

- system: `"x86_64-linux"`
- host os: `Linux 5.15.146.1-microsoft-standard-WSL2, Ubuntu, 22.04.3 LTS (Jammy Jellyfish), nobuild`
- multi-user?: `no`
- sandbox: `yes`
- version: `nix-env (Nix) 2.22.1`
- nixpkgs: `/home/sandbox/.nix-defexpr/channels/nixpkgs`

@stale stale bot removed the status: stale label May 11, 2024
@Zocker1999NET
Copy link

Zocker1999NET commented Jul 3, 2024

(EDIT to avoid doubled notification on rather stale issue)

I further found better solutions to the problem which seem better & more stable to me, see: #5008 (comment)

TL;DR: I now just add the home-manager channel using sudo. Then everything works as expected.


Old Comment

I don’t know why, but the doc change proposed in #4518 worked for me. The suggestion is to replace the nix-shell command from the doc with following:

nix-shell ~/.nix-defexpr/channels/home-manager -A install

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug triage Issues or feature request that have not been triaged yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants