diff --git a/system/default.nix b/system/default.nix index debf8f0..d84bc65 100644 --- a/system/default.nix +++ b/system/default.nix @@ -1,8 +1,11 @@ -{ ... }: { +{ ... }: +{ imports = [ - ./sops.nix - ./root-user.nix - ./sshd.nix ./monitoring.nix + ./packages.nix + ./root-user.nix + ./sops.nix + ./sshd.nix + ./weekly-rebuild.nix ]; } diff --git a/system/packages.nix b/system/packages.nix new file mode 100644 index 0000000..57746ab --- /dev/null +++ b/system/packages.nix @@ -0,0 +1,6 @@ +{ pkgs, ... }: +{ + environment.systemPackages = [ + pkgs.git + ]; +} 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"; + }; + }; +}