Compare commits
3 commits
f6a76ad5e5
...
a854caaf19
| Author | SHA1 | Date | |
|---|---|---|---|
| a854caaf19 | |||
| dc4594333f | |||
| d11199da10 |
3 changed files with 37 additions and 15 deletions
|
|
@ -118,18 +118,6 @@
|
||||||
};
|
};
|
||||||
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";
|
||||||
|
|
@ -140,7 +128,7 @@
|
||||||
THRESHOLD=85
|
THRESHOLD=85
|
||||||
|
|
||||||
if [ "$CURRENT" -gt "$THRESHOLD" ] ; then
|
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%
|
Your root partition remaining free space is critically low. Used: $CURRENT%
|
||||||
EOF
|
EOF
|
||||||
fi
|
fi
|
||||||
|
|
@ -152,6 +140,12 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
systemd.timers = {
|
systemd.timers = {
|
||||||
|
check_boot = {
|
||||||
|
timerConfig = {
|
||||||
|
OnCalendar = "daily";
|
||||||
|
};
|
||||||
|
wantedBy = [ "timers.target" ];
|
||||||
|
};
|
||||||
check_root = {
|
check_root = {
|
||||||
timerConfig = {
|
timerConfig = {
|
||||||
OnCalendar = "daily";
|
OnCalendar = "daily";
|
||||||
|
|
|
||||||
|
|
@ -242,8 +242,7 @@
|
||||||
hostName = "webmail.hoyer.xyz";
|
hostName = "webmail.hoyer.xyz";
|
||||||
plugins = [ "managesieve" ];
|
plugins = [ "managesieve" ];
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
# starttls needed for authentication, so the fqdn required to match
|
# SSL/TLS needed for authentication, so the fqdn must match the certificate
|
||||||
# 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";
|
||||||
|
|
|
||||||
|
|
@ -8,4 +8,33 @@
|
||||||
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" \
|
||||||
|
"$@"
|
||||||
|
''
|
||||||
|
)
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue