nix-community / home-manager

Manage a user environment using Nix [maintainer=@rycee]
https://nix-community.github.io/home-manager/
MIT License
6.72k stars 1.76k forks source link

Should services in `nixos-rebuild build-vm` work? #880

Closed MichaelBergquistSuarez closed 4 years ago

MichaelBergquistSuarez commented 4 years ago

I'm using home-manager release-19.03 as a nixos module.

But after nixos-rebuild build-vm --fast && ./result/bin/run-*-vm and logging in to my user, xmonad won't start.

I'm not yet 100% sure how to troubleshoot it, but before I continue my troubleshooting journey I thought I'd ask:

Is the xmonad module this is expected to work with build-vm?


I am uncertain because in news.nix, 2018-02-06, it says:

For example, it is currently not possible to use 'nixos-rebuild build-vm' when using the Home Manager NixOS module

But since then this have been added to the documentation:

Note By default packages will be installed to $HOME/.nix-profile but they can be installed to /etc/profiles if

home-manager.useUserPackages = true;

is added to the system configuration. This is necessary if, for example, you wish to use nixos-rebuild build-vm. This option may become the default value in the future.

Which I interpret as build-vm now is expected to work, but maybe I'm wrong? Or is it likely that there's something wrong with my setup?

Notes

rycee commented 4 years ago

Yeah, it should work. Did you also set xsession.enable = true;? Without this the xsession would not be generated.

MichaelBergquistSuarez commented 4 years ago

Thank you, I did manage to get it up and running!

The suggested option did have an effect (things looked a bit better, a background image showed up) but still no xmonad

Since it should have worked I continued with my throubleshooting

It was not a home-manager problem, so this issue can be closed, sorry for taking up time. I'll pay it back by explaining how I did if somebody from the future has similar problems:)

This was my first Nixos VM build so I didn't know what the defaults were or how to change them. I then found options not very well documented in a chat: virtualisation.virtualisation and virtualisation.memorySize.

So I gave them a higher value, and then it simply worked, hooray