I installed NixOS in qemu today as i was intrigued by the declarative approach to package management and configuration.
Now that I’m inside the machine I uncommented
environment.system.Packages = with pkgs; [
wget vim screen git tmux
];
As a test to see how it works. But rebuilding nix does nothing other than “building Nix, building the system configuration” and then nothing.
I have 2 configuration enties in grub. My understanding is that nix should rework the entirety of my OS from this configuration, but nothing at all happens.
nixos-rebuild switch should not only build but also switch to the new generation, nixos-rebuild boot will create a boot entry for it and make it the default for the next boot, but not actually activate it, nixos-rebuild build will build it and create a symlint result at your current working dir, but not activatae it or create a boot entry.
The picture below should show the issues I’m seeing, I might just reinstall as this is is just a QEMU VM. But it would be interesting to know why the system doesn’t do as predicted.
And I remember that some other user had some similar problems in VirtualBox. They kept rebuilding but the system didn’t change, though it only happened after beeing able to rebuild a couple of times… I can’t find the thread though now…
Can you please tell us what your NIX_PATH looks like? printenv NIX_PATH
/run/current-system/sw/bin/ does not contain chromium, which is a package i didn’t install with the nix-env command.
If it would be of use i could isolate this VM in it’s own VRF and NAT ssh to it (in case this is to be considered a bug and someone wants to check out root cause) (or i could upload the QEMU image somewhere too).
I know this is rather late but I found this thread when experiencing similar issues with nixos-rebuild not doing anything.
I ended up running strace on nixos-rebuild and realized that it was exiting with a 137 (out of memory error) during evaluation. So it would error out early while evaluating your files if it saw an issue (messing with the semicolons as mentioned here).
If it doesn’t error out early on your own configuration it seems like it ends up running out of memory while evaluating nixpkgs. I solved this by upgrading the RAM on my server, but since this sent my head spinning for a while I just wanted to log down the solution I found somewhere.
how much ram did you have?
how much free ram did you have?
In this case I have a small vps server with 2GB of ram. Usually it uses only 400M , but as it turns out the remaining space may not be enough to update the system. I suspect that most ram is used for doc generation (needs to be more carefully profiled).
it’s quite possible there should add warnings if you less than X GB’s in your system
I would say it should clearly report the reason of failure and thats it. Right now it just exists silently and it is not right, of cause.