helm/hosts/server.nix

32 lines
730 B
Nix
Raw Normal View History

2021-02-21 06:34:52 -08:00
# hosts/server.nix
#
# Only to be used for headless servers, at home or abroad, with more
# security/automation-minded configuration.
2021-02-20 19:50:43 -08:00
{ config, lib, pkgs, ... }:
{
boot.kernelPackages = pkgs.linuxPackages_latest_hardened;
2021-02-21 06:34:52 -08:00
nix.gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 30d";
};
2021-02-20 19:50:43 -08:00
systemd = {
services.clear-log = {
description = "Clear >1 month-old logs every week";
serviceConfig = {
Type = "oneshot";
ExecStart = "${pkgs.systemd}/bin/journalctl --vacuum-time=30d";
};
};
timers.clear-log = {
wantedBy = [ "timers.target" ];
partOf = [ "clear-log.service" ];
timerConfig.OnCalendar = "weekly UTC";
};
};
}