Migrate auto-upgrade from clanModule to clanService

This commit is contained in:
pinpox
2025-06-03 14:32:39 +02:00
parent 5196755626
commit 692b2ae738
4 changed files with 41 additions and 1 deletions

View File

@@ -1,7 +1,7 @@
--- ---
description = "Set up automatic upgrades" description = "Set up automatic upgrades"
categories = ["System"] categories = ["System"]
features = [ "inventory" ] features = [ "inventory", "deprecated" ]
--- ---
Whether to periodically upgrade NixOS to the latest version. If enabled, a Whether to periodically upgrade NixOS to the latest version. If enabled, a

View File

@@ -0,0 +1,33 @@
{ ... }:
{
_class = "clan.service";
manifest.name = "clan-core/auto-upgrade";
manifest.description = "Automatic system upgrade for the Clan App";
manifest.categories = [ "System" ];
roles.default = {
interface =
{ lib, ... }:
{
options.flake = lib.mkOption {
type = lib.types.str;
description = "Flake reference";
};
};
perInstance =
{ settings, ... }:
{
nixosModule =
{ ... }:
{
system.autoUpgrade = {
inherit (settings) flake;
enable = true;
dates = "02:00";
randomizedDelaySec = "45min";
};
};
};
};
}

View File

@@ -0,0 +1,6 @@
{ lib, ... }:
{
clan.modules = {
auto-upgrade = lib.modules.importApply ./default.nix { };
};
}

View File

@@ -3,6 +3,7 @@
imports = [ imports = [
./admin/flake-module.nix ./admin/flake-module.nix
./deltachat/flake-module.nix ./deltachat/flake-module.nix
./auto-upgrade/flake-module.nix
./hello-world/flake-module.nix ./hello-world/flake-module.nix
./wifi/flake-module.nix ./wifi/flake-module.nix
./borgbackup/flake-module.nix ./borgbackup/flake-module.nix