diff --git a/system/default.nix b/system/default.nix index debf8f0..e25f748 100644 --- a/system/default.nix +++ b/system/default.nix @@ -1,8 +1,10 @@ -{ ... }: { +{ ... }: +{ imports = [ ./sops.nix ./root-user.nix ./sshd.nix ./monitoring.nix + ./weekly-rebuild.nix ]; } diff --git a/system/weekly-rebuild.nix b/system/weekly-rebuild.nix new file mode 100644 index 0000000..2c387b7 --- /dev/null +++ b/system/weekly-rebuild.nix @@ -0,0 +1,16 @@ +{ pkgs, ... }: +{ + systemd.services."weekly-rebuild" = { + serviceConfig = { + Type = "oneshot"; + ExecStart = "${pkgs.nixos-rebuild}/bin/nixos-rebuild boot --flake git+https://git.t-juice.club/torjus/nixos-servers"; + }; + }; + systemd.timers."weekly-rebuild" = { + enable = true; + wantedBy = [ "timers.target" ]; + timerConfig = { + OnCalendar = "Sun 06:00:00"; + }; + }; +}