fix(mx): fix check_root email subject and consolidate systemd attrsets

The check_root service incorrectly used '/boot Disk Space Alert' as
the email subject instead of '/ Disk Space Alert'. Also merged the
duplicate systemd.services and systemd.timers attribute sets.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Harald Hoyer 2026-03-24 15:09:32 +01:00
parent d11199da10
commit dc4594333f

View file

@ -118,18 +118,6 @@
};
wantedBy = [ "default.target" ];
};
};
systemd.timers = {
check_boot = {
timerConfig = {
OnCalendar = "daily";
};
wantedBy = [ "timers.target" ];
};
};
systemd.services = {
check_root = {
serviceConfig = {
Type = "oneshot";
@ -140,7 +128,7 @@
THRESHOLD=85
if [ "$CURRENT" -gt "$THRESHOLD" ] ; then
${pkgs.mailutils}/bin/mail -s '/boot Disk Space Alert' harald << EOF
${pkgs.mailutils}/bin/mail -s '/ Disk Space Alert' harald << EOF
Your root partition remaining free space is critically low. Used: $CURRENT%
EOF
fi
@ -152,6 +140,12 @@
};
systemd.timers = {
check_boot = {
timerConfig = {
OnCalendar = "daily";
};
wantedBy = [ "timers.target" ];
};
check_root = {
timerConfig = {
OnCalendar = "daily";