Add auto-upgrade module
This commit is contained in:
8
clanModules/auto-upgrade/README.md
Normal file
8
clanModules/auto-upgrade/README.md
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
---
|
||||||
|
description = "Set up automatic upgrades"
|
||||||
|
categories = ["System"]
|
||||||
|
features = [ "inventory" ]
|
||||||
|
---
|
||||||
|
|
||||||
|
Whether to periodically upgrade NixOS to the latest version. If enabled, a
|
||||||
|
systemd timer will run `nixos-rebuild switch --upgrade` once a day.
|
||||||
24
clanModules/auto-upgrade/roles/default.nix
Normal file
24
clanModules/auto-upgrade/roles/default.nix
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
cfg = config.clan.autoUpgrade;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.clan.autoUpgrade = {
|
||||||
|
flake = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
description = "Flake reference";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
config = {
|
||||||
|
system.autoUpgrade = {
|
||||||
|
inherit (cfg.clan.autoUpgrade) flake;
|
||||||
|
enable = true;
|
||||||
|
dates = "02:00";
|
||||||
|
randomizedDelaySec = "45min";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -9,6 +9,7 @@ in
|
|||||||
# only import available files, as this allows to filter the files for tests.
|
# only import available files, as this allows to filter the files for tests.
|
||||||
flake.clanModules = filterAttrs (_name: pathExists) {
|
flake.clanModules = filterAttrs (_name: pathExists) {
|
||||||
admin = ./admin;
|
admin = ./admin;
|
||||||
|
auto-upgrade = ./auto-upgrade;
|
||||||
borgbackup = ./borgbackup;
|
borgbackup = ./borgbackup;
|
||||||
borgbackup-static = ./borgbackup-static;
|
borgbackup-static = ./borgbackup-static;
|
||||||
deltachat = ./deltachat;
|
deltachat = ./deltachat;
|
||||||
|
|||||||
@@ -108,6 +108,7 @@ nav:
|
|||||||
- reference/clanModules/thelounge.md
|
- reference/clanModules/thelounge.md
|
||||||
- reference/clanModules/trusted-nix-caches.md
|
- reference/clanModules/trusted-nix-caches.md
|
||||||
- reference/clanModules/user-password.md
|
- reference/clanModules/user-password.md
|
||||||
|
- reference/clanModules/auto-upgrade.md
|
||||||
- reference/clanModules/vaultwarden.md
|
- reference/clanModules/vaultwarden.md
|
||||||
- reference/clanModules/xfce.md
|
- reference/clanModules/xfce.md
|
||||||
- reference/clanModules/zerotier-static-peers.md
|
- reference/clanModules/zerotier-static-peers.md
|
||||||
|
|||||||
Reference in New Issue
Block a user