autoupdate flake

This commit is contained in:
Christoph Hollizeck 2024-04-07 10:34:12 +02:00
parent dd6f2807ff
commit 4cd7fe6cfd
Signed by: Daholli
GPG key ID: 249300664F2AF2C7
2 changed files with 40 additions and 1 deletions

View file

@ -0,0 +1,33 @@
{
options,
config,
pkgs,
lib,
inputs,
...
}:
with lib;
with lib.wyrdgard;
let
cfg = config.wyrdgard.system.autoUpgrade;
in
{
options.wyrdgard.system.autoUpgrade = with types; {
enable = mkEnableOption "Enable auto-upgrade";
time = mkOpt str "02:00" "Time to run auto-upgrade";
};
config = mkIf cfg.enable {
system.autoUpgrade = {
enable = true;
flake = inputs.self.outPath;
flags = [
"--update-input"
"nixpkgs"
"--print-build-logs"
];
dates = cfg.time;
randomizedDelaySec = "45min";
};
};
}

View file

@ -24,11 +24,17 @@ with lib.wyrdgard;
_1password = enabled;
};
system.hardware = {
system = {
autoUpgrade = {
enable = true;
time = "10:00";
};
hardware = {
bluetooth = enabled;
gpu.nvidia = enabled;
};
};
};
system.stateVersion = "23.11";
}