1 { config, lib, pkgs, ... }:
7 cfg = config.services.eintopf;
10 options.services.eintopf = {
12 enable = mkEnableOption "Eintopf community event calendar web app";
15 type = types.attrsOf types.str;
18 Settings to configure web service. See
19 <https://codeberg.org/Klasse-Methode/eintopf/src/branch/main/DEPLOYMENT.md>
20 for available options.
22 example = literalExpression ''
24 EINTOPF_ADDR = ":1234";
25 EINTOPF_ADMIN_EMAIL = "admin@example.org";
26 EINTOPF_TIMEZONE = "Europe/Berlin";
31 secrets = lib.mkOption {
32 type = with types; listOf path;
34 A list of files containing the various secrets. Should be in the
35 format expected by systemd's `EnvironmentFile` directory.
42 config = mkIf cfg.enable {
44 systemd.services.eintopf = {
45 description = "Community event calendar web app";
46 wantedBy = [ "multi-user.target" ];
47 after = [ "network-online.target" ];
48 wants = [ "network-online.target" ];
49 environment = cfg.settings;
51 ExecStart = "${pkgs.eintopf}/bin/eintopf";
52 WorkingDirectory = "/var/lib/eintopf";
53 StateDirectory = "eintopf" ;
54 EnvironmentFile = [ cfg.secrets ];
57 AmbientCapabilities = "";
58 CapabilityBoundingSet = "" ;
59 DevicePolicy = "closed";
61 LockPersonality = true;
62 MemoryDenyWriteExecute = true;
63 NoNewPrivileges = true;
64 PrivateDevices = true;
69 ProtectControlGroups = true;
71 ProtectHostname = true;
72 ProtectKernelLogs = true;
73 ProtectKernelModules = true;
74 ProtectKernelTunables = true;
75 ProtectProc = "invisible";
76 ProtectSystem = "strict";
78 RestrictAddressFamilies = [ "AF_INET" "AF_INET6" ];
79 RestrictNamespaces = true;
80 RestrictRealtime = true;
81 RestrictSUIDSGID = true;
82 SystemCallArchitectures = "native";
83 SystemCallFilter = [ "@system-service" "~@privileged" ];
90 meta.maintainers = with lib.maintainers; [ onny ];