Files
server/nixosModules/auto-updade.nix
2025-07-01 18:38:27 +03:00

24 lines
639 B
Nix

{ lib, config, ... }: {
options = {
autoUpdate.enable = lib.mkEnableOption "enables autoUpdate";
};
config = lib.mkIf config.autoUpdate.enable {
# PAT to be able to access the repo
sops.secrets.github-access-token = { };
nix.extraOptions = "!include ${config.sops.secrets.github-access-token.path}";
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
];
};
};
}