r/GUIX • • 7d ago

Does Guix not have an equivalent to NixOS' rebuild boot?

I've been using Guix for like 6 months now but i haven't found anything similar in the documentation, so i figured i'd ask to make sure i haven't overlooked it. For those who haven't used NixOS before, running `nixos rebuild boot` builds the system configuration and adds a boot entry to grub, but it doesn't switch over to the new generation. I've always found it convenient when i'm making bigger changes to my configuration or maybe testing a configuration meant for a different machine. I recently decided to test the config i was working on for my server by just running reconfigure on my desktop, but it ripped me out of my graphical session lol. With something like `nixos rebuild boot`, my current system would stay intact and i could boot into it later when i'm ready.

16 Upvotes

12 comments sorted by

8

u/Hammar_Morty 6d ago

Are you just wanting to see if it builds? guix system build

6

u/juipeltje 6d ago

I'll have to remember that one. Should come in handy when i only want to know if it builds without errors

5

u/Reasonable_Ruin_3502 7d ago

I'm not sure about it, but doesn't running system reconfigure and roll back 1 do the same?

4

u/juipeltje 6d ago

It does, but i don't think it would solve the issue of your graphical session getting killed if you made changes to that, since it would still switch to the new generation before switching back

3

u/thqloz 6d ago

So I donโ€™t want to judge your use case, but if it was about testing a different configuration, what about `guix system vm`?

1

u/nicolasstampf 6d ago

Here's the French documentation page, which says a grub entry is automatically added unless you specify an option: https://guix.gnu.org/manual/1.5.0/fr/html_node/Invoquer-guix-system.html

When you do a guix system reconfigure, grub is updated automatically.

Haven't had the chance to test yet though

2

u/juipeltje 6d ago

Yeah, well the grub entry isn't really the problem, it's that i would like the option of adding the reconfigure as an entry, but not switch the system to that new generation until i reboot into it.

2

u/nicolasstampf 6d ago

Oh I see: you would like to build the new generation of the system, but not switch to it immediately. Only create a grub entry, but wait for the next reboot to possibly select it?

Then a `guix system reconfigure` followed by a `guix system roll-back` ?

I'm sure some scheme code for a new command like `guix system reconfigure-and-wait` might do the trick: do everything, except move into the new generation.

Unfortunately, I don't know how to do that ๐Ÿ˜„

1

u/Aeolem 6d ago

Doesn't standard guix system reconfigure do the same as nixos rebuild boot? At least when the kernel updates it tells me to reboot to "activate" it

1

u/juipeltje 6d ago

It tells you that because you have to reboot to be able to load the new kernel, but everything else is reloaded immediately. Even nixos rebuild switch still requires you to reboot to get the new kernel to load. I think i've heard some people in the past talk about manjaro being able to hot reload the kernel, but i have no clue how they do that.

1

u/Aeolem 6d ago

I've heard hot-reloading is a kernel feature, used in some enterprise servers for more uptime. No clue how it works either tho