···
d = self.lib.data.services.planka;
+
commonServiceConfig = {
+
EnvironmentFile = config.age.secrets.planka-env.path;
+
StateDirectory = "planka";
+
WorkingDirectory = "/var/lib/planka";
+
LockPersonality = true;
+
NoNewPrivileges = true;
+
ProtectControlGroups = true;
+
ProtectHostname = true;
+
ProtectKernelLogs = true;
+
ProtectKernelModules = true;
+
ProtectKernelTunables = true;
+
ProtectProc = "invisible";
+
RestrictRealtime = true;
+
RestrictSUIDSGID = true;
+
RestrictAddressFamilies = [
+
"10-planka"."/var/lib/planka".d = {
+
wantedBy = [ "multi-user.target" ];
+
after = [ "postgres.target" ];
+
description = "Planka Kanban Database Init Script";
+
if [ ! -f /var/lib/planka/db-init-ran ]; then
+
node run ${self'.packages.planka}/lib/node_modules/planka/db/init.js && \
+
touch /var/lib/planka/db-init-ran
+
serviceConfig = commonServiceConfig // {
+
SyslogIdentifier = "planka-init-db";
+
after = [ "planka-init-db.service" ];
+
wantedBy = [ "multi-user.target" ];
+
description = "Planka Kanban Server";
+
documentation = [ "https://docs.planka.cloud" ];
+
DATABASE_URL = "postgresql://%2Frun%2Fpostgresql/planka";
+
DEFAULT_ADMIN_EMAIL = "pyrox@pyrox.dev";
+
DEFAULT_ADMIN_USERNAME = "pyrox";
+
DEFAULT_LANGUAGE = "en-US";
+
BASE_URL = "https://${d.extUrl}";
+
NODE_ENV = "production";
+
serviceConfig = commonServiceConfig // {
+
ExecStart = "${lib.getExe self'.packages.planka} --port ${toString d.port}";
+
SyslogIdentifier = "planka";
+
users.groups.planka = { };
+
services.postgresql = {
+
ensureDBOwnership = true;
+
ensureClauses.login = true;
+
ensureDatabases = [ "planka" ];
age.secrets.planka-env = {
file = ./secrets/planka-env.age;
services.anubis.instances.planka = {