nixos-rebuild inside systemd service after 23.11 upgrade #53

Open
opened 2023-12-06 11:44:44 +02:00 by alexoundos · 0 comments
Collaborator

Beware nixos-rebuild changes in NixOS 23.11 release (https://github.com/NixOS/nixpkgs/pull/258571). Namely:

nixos-rebuild {switch,boot,test,dry-activate} runs the system activation inside systemd-run now, creating an ephemeral systemd service and protecting the system switch against issues like network disconnections during remote (e.g. SSH) sessions. This has the side effect of running the switch in an isolated environment, that could possible break post-switch scripts that depends on things like environment variables being set. If you want to opt-out from this behavior for now, you may set the NIXOS_SWITCH_USE_DIRTY_ENV environment variable before running nixos-rebuild. However, keep in mind that this option will be removed in the future.

Beware [`nixos-rebuild` changes in NixOS 23.11 release](https://nixos.org/manual/nixos/stable/release-notes#sec-release-23.11-nixos-notable-changes) (https://github.com/NixOS/nixpkgs/pull/258571). Namely: > nixos-rebuild {switch,boot,test,dry-activate} runs the system activation inside systemd-run now, creating an ephemeral systemd service and protecting the system switch against issues like network disconnections during remote (e.g. SSH) sessions. This has the side effect of running the switch in an isolated environment, that could possible break post-switch scripts that depends on things like environment variables being set. If you want to opt-out from this behavior for now, you may set the NIXOS_SWITCH_USE_DIRTY_ENV environment variable before running nixos-rebuild. However, keep in mind that this option will be removed in the future.
alexoundos changed title from NixOS 23.11 upgrade to nixos-rebuild inside systemd service after 23.11 upgrade 2024-04-03 15:36:59 +03:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: SelfPrivacy/selfprivacy-nixos-config#53
There is no content yet.