security: add conservative systemd hardening to aquamarine services

This commit is contained in:
Ryan Yin
2026-08-26 18:14:43 +08:00
parent 65ee1a001f
commit f9cf99dadb
3 changed files with 68 additions and 0 deletions
@@ -0,0 +1,12 @@
{
lib,
outputs,
}:
{
caddy = true;
postgresql = true;
gitea = true;
sftpgo = true;
v2ray = true;
transmission = true;
}
@@ -0,0 +1,18 @@
{
lib,
outputs,
}:
let
cfg = outputs.nixosConfigurations.aquamarine.config;
# NoNewPrivileges on a service (all six exist on aquamarine). Note: the
# `? name` exists-check misbehaves on systemd.services here, so access directly.
svc = name: (cfg.systemd.services.${name}.serviceConfig or { }).NoNewPrivileges or false;
in
{
caddy = svc "caddy";
postgresql = svc "postgresql";
gitea = svc "gitea";
sftpgo = svc "sftpgo";
v2ray = svc "v2ray";
transmission = svc "transmission";
}