Merge pull request 'Migrate auto-upgrade from clanModule to clanService' (#3827) from migrate-auto-upgrade into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/3827
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
---
|
||||
description = "Set up automatic upgrades"
|
||||
categories = ["System"]
|
||||
features = [ "inventory" ]
|
||||
features = [ "inventory", "deprecated" ]
|
||||
---
|
||||
|
||||
Whether to periodically upgrade NixOS to the latest version. If enabled, a
|
||||
|
||||
33
clanServices/auto-upgrade/default.nix
Normal file
33
clanServices/auto-upgrade/default.nix
Normal 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";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
6
clanServices/auto-upgrade/flake-module.nix
Normal file
6
clanServices/auto-upgrade/flake-module.nix
Normal file
@@ -0,0 +1,6 @@
|
||||
{ lib, ... }:
|
||||
{
|
||||
clan.modules = {
|
||||
auto-upgrade = lib.modules.importApply ./default.nix { };
|
||||
};
|
||||
}
|
||||
@@ -3,6 +3,7 @@
|
||||
imports = [
|
||||
./admin/flake-module.nix
|
||||
./deltachat/flake-module.nix
|
||||
./auto-upgrade/flake-module.nix
|
||||
./hello-world/flake-module.nix
|
||||
./wifi/flake-module.nix
|
||||
./borgbackup/flake-module.nix
|
||||
|
||||
@@ -83,6 +83,7 @@ nav:
|
||||
- Clan Services:
|
||||
- Overview: reference/clanServices/index.md
|
||||
- reference/clanServices/admin.md
|
||||
- reference/clanServices/auto-upgrade.md
|
||||
- reference/clanServices/borgbackup.md
|
||||
- reference/clanServices/deltachat.md
|
||||
- reference/clanServices/hello-world.md
|
||||
|
||||
Reference in New Issue
Block a user