Gave auto update it's own module

This commit is contained in:
2024-12-29 11:38:35 +02:00
parent a979542cf7
commit 87e48ad76a
2 changed files with 22 additions and 9 deletions

View File

@@ -5,6 +5,7 @@
./disk-config.nix
./../nixosModules/secrets.nix
./../nixosModules/website.nix
./../nixosModules/auto-updade.nix
];
boot.loader.grub = {
@@ -12,6 +13,7 @@
efiInstallAsRemovable = true;
};
# Admin utilities
environment.systemPackages = with pkgs; map lib.lowPrio [
curl
gitMinimal
@@ -30,15 +32,8 @@
secrets.enable = true;
website.enable = true;
system.autoUpgrade = {
enable = true;
flake = "github:kyren223/server#default";
dates = "minutely"; # Poll interval
flags = [
"--no-write-lock-file" # Prevent flake.lock from upgrading
"--option" "tarball-ttl" "0" # Required for polling below 1h
];
};
# Automatically pull this config from git
autoUpdate.enable = true;
nix.settings.extra-experimental-features = [ "nix-command" "flakes" ];

View File

@@ -0,0 +1,18 @@
{ pkgs, lib, config, ... }: {
options = {
autoUpdate.enable = lib.mkEnableOption "enables autoUpdate";
};
config = lib.mkIf config.autoUpdate.enable {
system.autoUpgrade = {
enable = true;
flake = "github:kyren223/server#default";
dates = "minutely"; # Poll interval
flags = [
"--no-write-lock-file" # Prevent flake.lock from upgrading
"--option" "tarball-ttl" "0" # Required for polling below 1h
];
};
};
}