Compare commits

..

No commits in common. "a854caaf1907e24cc9bfdc8be151a2f44bb220fa" and "f6a76ad5e57959dd8d751071673d681058ee675e" have entirely different histories.

3 changed files with 15 additions and 37 deletions

View file

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

View file

@ -242,7 +242,8 @@
hostName = "webmail.hoyer.xyz"; hostName = "webmail.hoyer.xyz";
plugins = [ "managesieve" ]; plugins = [ "managesieve" ];
extraConfig = '' extraConfig = ''
# SSL/TLS needed for authentication, so the fqdn must match the certificate # starttls needed for authentication, so the fqdn required to match
# the certificate
$config['smtp_server'] = "ssl://${config.mailserver.fqdn}:465"; $config['smtp_server'] = "ssl://${config.mailserver.fqdn}:465";
$config['smtp_user'] = "%u"; $config['smtp_user'] = "%u";
$config['smtp_pass'] = "%p"; $config['smtp_pass'] = "%p";

View file

@ -8,33 +8,4 @@
services.postgresql = { services.postgresql = {
package = pkgs.postgresql_14; package = pkgs.postgresql_14;
}; };
# Temporary: upgrade script for PostgreSQL 14 → 16 migration.
# After upgrading, change package above to postgresql_16 and remove this block.
environment.systemPackages = [
(
let
newPostgres = pkgs.postgresql_16;
cfg = config.services.postgresql;
in
pkgs.writeScriptBin "upgrade-pg-cluster" ''
set -eux
systemctl stop postgresql
export NEWDATA="/var/lib/postgresql/${newPostgres.psqlSchema}"
export NEWBIN="${newPostgres}/bin"
export OLDDATA="${cfg.dataDir}"
export OLDBIN="${cfg.finalPackage}/bin"
install -d -m 0700 -o postgres -g postgres "$NEWDATA"
cd "$NEWDATA"
sudo -u postgres "$NEWBIN/initdb" -D "$NEWDATA" ${lib.escapeShellArgs cfg.initdbArgs}
sudo -u postgres "$NEWBIN/pg_upgrade" \
--old-datadir "$OLDDATA" --new-datadir "$NEWDATA" \
--old-bindir "$OLDBIN" --new-bindir "$NEWBIN" \
"$@"
''
)
];
} }