8 cfg = config.services.commafeed;
11 options.services.commafeed = {
12 enable = lib.mkEnableOption "CommaFeed";
14 package = lib.mkPackageOption pkgs "commafeed" { };
18 description = "User under which CommaFeed runs.";
19 default = "commafeed";
22 group = lib.mkOption {
24 description = "Group under which CommaFeed runs.";
25 default = "commafeed";
28 stateDir = lib.mkOption {
29 type = lib.types.path;
30 description = "Directory holding all state for CommaFeed to run.";
31 default = "/var/lib/commafeed";
34 environment = lib.mkOption {
35 type = lib.types.attrsOf (
43 Extra environment variables passed to CommaFeed, refer to
44 <https://github.com/Athou/commafeed/blob/master/commafeed-server/config.yml.example>
45 for supported values. The default user is `admin` and the default password is `admin`.
46 Correct configuration for H2 database is already provided.
50 CF_SERVER_APPLICATIONCONNECTORS_0_TYPE = "http";
51 CF_SERVER_APPLICATIONCONNECTORS_0_PORT = 9090;
55 environmentFile = lib.mkOption {
56 type = lib.types.nullOr lib.types.path;
58 Environment file as defined in {manpage}`systemd.exec(5)`.
61 example = "/var/lib/commafeed/commafeed.env";
65 config = lib.mkIf cfg.enable {
66 systemd.services.commafeed = {
67 after = [ "network.target" ];
68 wantedBy = [ "multi-user.target" ];
69 environment = lib.mapAttrs (
70 _: v: if lib.isBool v then lib.boolToString v else toString v
73 ExecStart = "${lib.getExe cfg.package} server ${cfg.package}/share/config.yml";
76 StateDirectory = baseNameOf cfg.stateDir;
77 WorkingDirectory = cfg.stateDir;
79 CapabilityBoundingSet = [ "" ];
80 DevicePolicy = "closed";
82 LockPersonality = true;
83 NoNewPrivileges = true;
84 PrivateDevices = true;
88 ProtectControlGroups = true;
90 ProtectHostname = true;
91 ProtectKernelLogs = true;
92 ProtectKernelModules = true;
93 ProtectKernelTunables = true;
94 ProtectProc = "invisible";
96 RestrictAddressFamilies = [
100 RestrictNamespaces = true;
101 RestrictRealtime = true;
102 RestrictSUIDSGID = true;
103 SystemCallArchitectures = "native";
109 } // lib.optionalAttrs (cfg.environmentFile != null) { EnvironmentFile = cfg.environmentFile; };
113 meta.maintainers = [ lib.maintainers.raroh73 ];