[Feature Req?] Asking before reboot in system.autoUpgrade

I’ve been wanting to ask this since a while now so I’m gonna put it on here, ps: let me know if I wasn’t supposed to use the “Development Nix” tag

Though the like the idea of the system.autoUpgrade.allowReboot I wish if there was at least a prompt before the system reboots so whatever we were working on doesn’t get lost and we can at least save our work.

Maybe we can have like an option like system.autoUpgrade.promptReboot or something like that?

I would be willing to help with this feature if needed though I’m not so much used to nix yet but I’ll try my best to help

Sounds like having some units (like a display manager) block reboot and launch some notification if there is a reboot request. That wouldn’t really concern system.autoUpgrade.allowReboot but all units that might be harmed by a sudden shutdown, which should only be desktop related units. I am not sure how that would be implemented though.

Hello zim, well,

  • We don’t need to have nixos-upgrade.serviceblock” a reboot
  • We can keep the current state of the nixos-upgrade.service except before actually performing reboot we notify the user
  • We can implement polkit-like (pkexec or alternatives) authentication service - User gets two choices “Reboot now” or “Reboot later”
  • For the notify prompt we might as well create and implement our own minimal notify prompt thingy which works regardless of what display server or applications are running that way we can ensure that the prompt will be shown and not get blocked by any application or another service unit

That would indeed be a way to solve this, but i feel that the scope is very narrow (and the user base of that even more) as i assume very few people let nixos-upgrade restart their “work/desktop” machines. I only use it on my servers, as i usually shutdown my pc when i am not going to use it for a longer period of time (like going to sleep), which is why i think having a way to block any potential reboot may be more beneficial (e.g. from accidentally pressing the power button thats mapped to poweroff), but that’s just my take on it.

Isn’t there a d-bus protocol to send such notifications that get displayed by a notification daemon that the user can choose?

Different Feature i had in mind recently if this becomes a discussion about nixos-upgrade

Having an option to choose the reboot method (reboot or kexec) would be good to reduce downtime on servers by skipping the bios hw-reinit. Shaving a minute from reboot is a good win IMHO.

Edit: fix typo dmesgd-bus

1 Like

Well if we go by the Server-side implementation then yes people wouldn’t prefer this option (unless we implement alternative of it like a notifyViaMail kinda thingy or similar)

However, people who use their laptops/computers on a daily wouldn’t like the system rebooting without their permission especially when the user is working on some sort of filesystem operation or something alike.

dmesg can do that? :hushed:

Yes. +1 for this

That’s why you wouldn’t enable system.autoUpgrade.allowReboot IMHO, one could maybe have a notification that signals a kernel change to get users to reboot along the lines of “A System Update requires a reboot. Please do at your earliest convenience.”, which would be pretty similar to what you have been thinking about. Maybe this could be included in my Idea of having reboot methods to choose from, one of which could be notifyUser, but i would like other opinions on that.

No it’s a muscle memory typo, but d-bus can do so: Desktop Notifications Specification

yes me too

ah indeed this would be convenient