hosts/plover: add pre-service script for atuin service

This commit is contained in:
Gabriel Arazas 2023-01-05 19:48:41 +08:00
parent affd08e3c1
commit a046192bca

View File

@ -467,6 +467,14 @@ in
port = 8965; port = 8965;
}; };
systemd.services.atuin = {
path = [ config.services.postgresql.package ];
preStart = ''
psql -tAc "SELECT 1 FROM information_schema.schemata WHERE schema_name='atuin';" \
grep -q 1 || psql -tAc "CREATE SCHEMA IF NOT EXISTS atuin;"
'';
};
# Of course, what is a server without a backup? A professionally-handled # Of course, what is a server without a backup? A professionally-handled
# production system. However, we're not professionals so we do have backups. # production system. However, we're not professionals so we do have backups.
services.borgbackup.jobs = services.borgbackup.jobs =