[Unit] Description=diigo-cache and webapp (workerd) Requires=diigo-cache.socket [Service] # the profile path survives upgrades; see doc/install.md ExecStart=/nix/var/nix/profiles/diigo-cache/bin/diigo-cache-serve -S http=3 -d cache-state=/var/lib/diigo-cache/cache -d webapp-state=/var/lib/diigo-cache/webapp DynamicUser=yes StateDirectory=diigo-cache diigo-cache/cache diigo-cache/webapp StateDirectoryMode=0700 # webapp fetches diigo.com; nothing else needs the network RestrictAddressFamilies=AF_INET AF_INET6 AF_UNIX ProtectSystem=strict ProtectHome=yes PrivateTmp=yes PrivateDevices=yes ProtectKernelTunables=yes ProtectKernelModules=yes ProtectControlGroups=yes RestrictNamespaces=yes LockPersonality=yes CapabilityBoundingSet= SystemCallFilter=@system-service # V8 uses memory protection keys; without these, SIGSYS at startup SystemCallFilter=pkey_alloc pkey_mprotect pkey_free # not MemoryDenyWriteExecute: V8's JIT needs W+X