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

Can't run nixos-manager when home-manager is used within configuration.nix #9

Open
Melkor333 opened this issue May 18, 2020 · 4 comments

Comments

@Melkor333
Copy link

I want to try out nixos-manager, but I can't get it to work. I am on NixOS and have home-manager configured inside my configuration.nix (my configuration is split in multiple files which are imported, if that matters). From what I understand this shouldn't be a problem at all and nixos-manager should be able to run without using the home-manager. But I always get the following message:

# /home/sam/nixos-manager/result/bin/nixos-manager 
Executing: nix search  --json
nixos-manager: /root/.nix-profile/share/doc/home-manager/options.json: openBinaryFile: does not exist (No such file or directory)

This happens with my personal and the root user.

Since I am using home-manager in the NixOS config, I added manual.json.enable = true; to my user config and now I get the following error when trying to run nixos-manager as user (which probably has to do with home-manager not being in the path):

$ /nix/store/32xycr35ajmhqznj3cnmch6r2kdj0567-nixos-manager-1.0/bin/nixos-manager 
Executing: nix search  --json
Executing: home-manager generations
nixos-manager: home-manager: createProcess: runInteractiveProcess: exec: does not exist (No such file or directory)

I also tried removing home-manager-path from my user env (which probably was a mistake) and since the ~/.nix-profile folder disappeared it went back to the first error.

Does the nixos-manager currently only run with home-manager or is this some kind of bug/current incompatibility with my setup?
I also wonder why it isn't in the nixpkgs yet. Is there some reason for that or have you just not yet gotten to creating a PR?

@Mic92
Copy link
Contributor

Mic92 commented May 22, 2020

Adding the home-manager executable to the PATH is not so trivial since it depends on the home-manager channel. Maybe nixos-manager could bootstrap home-manager itself?

@Melkor333
Copy link
Author

I am a bit confused why nixos-manager needs the home-manager executable in the first place if I have configured everything within /etc/nixos/configuration.nix anyway (or don‘t want to use home-manager at all)?

@Mic92
Copy link
Contributor

Mic92 commented May 22, 2020

Yes. It should be made optional.

@tobkratz
Copy link

tobkratz commented Jun 17, 2020

can approve this Problem. I'm on stable 20.03. and like @Melkor333 my nixos and Home-Manager config is split in multiple files.

Executing: nix search  --json
nixos-manager: /home/tk/.nix-profile/share/doc/home-manager/options.json: openBinaryFile: does not exist (No such file or directory)

when setting manuel.json.enable to true, getting

Executing: nix search  --json
Executing: home-manager generations
nixos-manager: home-manager: createProcess: runInteractiveProcess: exec: does not exist (No such file or directory)

When starting it with nix run nixos.home-manager -c ./nixos-manager, I can get it to work, but I want to configure home-manager only within nixos config, it fails.
Since home-manager is not 100% common used in NixOS it should be optional. Also I guess nixos-manager should be helpful to new users and home-manager was not the first thing I wrote to my NixOS config 😆
(and home-manager is most common configured within config on nixos systems)

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