···
cfg = config.services.redis;
8
+
ulimitNofile = cfg.maxclients + 32;
if value == true then "yes"
else if value == false then "no"
···
listsAsDuplicateKeys = true;
mkKeyValue = generators.mkKeyValueDefault { inherit mkValueString; } " ";
(mkRemovedOptionModule [ "services" "redis" "user" ] "The redis module now is hardcoded to the redis user.")
(mkRemovedOptionModule [ "services" "redis" "dbpath" ] "The redis module now uses /var/lib/redis as data directory.")
···
description = "Set the number of databases.";
126
+
maxclients = mkOption {
129
+
description = "Set the max number of connected clients at the same time.";
type = with types; listOf (listOf int);
default = [ [900 1] [300 10] [60 10000] ];
···
syslog-enabled = cfg.syslog;
databases = cfg.databases;
264
+
maxclients = cfg.maxclients;
save = map (d: "${toString (builtins.elemAt d 0)} ${toString (builtins.elemAt d 1)}") cfg.save;
···
StateDirectoryMode = "0700";
# Access write directories
308
+
CapabilityBoundingSet = "";
310
+
NoNewPrivileges = true;
311
+
# Process Properties
312
+
LimitNOFILE = "${toString ulimitNofile}";
314
+
ProtectSystem = "strict";
315
+
ProtectHome = true;
317
+
PrivateDevices = true;
318
+
PrivateUsers = true;
319
+
ProtectClock = true;
320
+
ProtectHostname = true;
321
+
ProtectKernelLogs = true;
322
+
ProtectKernelModules = true;
323
+
ProtectKernelTunables = true;
324
+
ProtectControlGroups = true;
325
+
RestrictAddressFamilies = [ "AF_UNIX" "AF_INET" "AF_INET6" ];
326
+
RestrictNamespaces = true;
327
+
LockPersonality = true;
328
+
MemoryDenyWriteExecute = true;
329
+
RestrictRealtime = true;
330
+
RestrictSUIDSGID = true;
331
+
PrivateMounts = true;
332
+
# System Call Filtering
333
+
SystemCallArchitectures = "native";
334
+
SystemCallFilter = "~@clock @cpu-emulation @debug @keyring @memlock @module @mount @obsolete @privileged @raw-io @reboot @resources @setuid @swap";