Skip to content

feat: implement system.autoUpgrade module for periodic upgrades#436

Merged
jfroche merged 3 commits into
mainfrom
autoupgrade
Apr 14, 2026
Merged

feat: implement system.autoUpgrade module for periodic upgrades#436
jfroche merged 3 commits into
mainfrom
autoupgrade

Conversation

@jfroche
Copy link
Copy Markdown
Member

@jfroche jfroche commented Mar 25, 2026

Depends on #450
Fixes #253

@jfroche jfroche linked an issue Mar 25, 2026 that may be closed by this pull request
Comment thread nix/modules/auto-upgrade.nix
@jfroche jfroche marked this pull request as draft March 26, 2026 08:29
jfroche added a commit that referenced this pull request Mar 27, 2026
We parse the directive from the unit file text and skip restarting the service if X-RestartIfChanged=false is set

required for #436
jfroche added a commit that referenced this pull request Mar 27, 2026
We parse the directive from the unit file text and skip restarting the service if X-RestartIfChanged=false is set

required for #436
@jfroche jfroche force-pushed the build-with-refresh branch 3 times, most recently from 181a420 to bb04f57 Compare April 7, 2026 11:46
Base automatically changed from build-with-refresh to main April 7, 2026 14:23
jfroche added a commit that referenced this pull request Apr 8, 2026
We parse the directive from the unit file text and skip restarting the service if X-RestartIfChanged=false is set

required for #436
jfroche added a commit that referenced this pull request Apr 10, 2026
We parse the directive from the unit file text and skip restarting the service if X-RestartIfChanged=false is set

required for #436
picnoir pushed a commit that referenced this pull request Apr 10, 2026
We parse the directive from the unit file text and skip restarting the service if X-RestartIfChanged=false is set

required for #436
@jfroche jfroche changed the base branch from main to feat-stop-on-removal April 10, 2026 18:54
@jfroche jfroche marked this pull request as ready for review April 10, 2026 18:54
@picnoir picnoir force-pushed the feat-stop-on-removal branch from 3644af3 to 208990f Compare April 13, 2026 13:26
Base automatically changed from feat-stop-on-removal to main April 13, 2026 13:37
systemd.services.system-manager-upgrade = {
description = "System Manager Upgrade";

restartIfChanged = false;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this property a typo? Seems like it should be serviceConfig.X-RestartIfChanged.

Copy link
Copy Markdown
Contributor

@commiterate commiterate Apr 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, that's a Nixpkgs helper we currently do not have ported to system-manager: https://github.com/NixOS/nixpkgs/blob/2353f2a8a524d93eb4746d817382e50521018a09/nixos/lib/systemd-lib.nix#L795

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

X-RestartIfChanged should be correctly managed by #438
We call systemd-lib.serviceToUnit in

// lib.mapAttrs' (n: v: lib.nameValuePair "${n}.service" (systemd-lib.serviceToUnit v)) cfg.services

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah! Right! I forgot we're passing the services through the upstream lib!

@jfroche jfroche merged commit 26b9017 into main Apr 14, 2026
6 checks passed
@jfroche jfroche deleted the autoupgrade branch April 14, 2026 08:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

system.autoUpgrade.* Functionality

3 participants