11 cfg = config.services.prosody-filer;
13 settingsFormat = pkgs.formats.toml { };
14 configFile = settingsFormat.generate "prosody-filer.toml" cfg.settings;
19 services.prosody-filer = {
20 enable = mkEnableOption "Prosody Filer XMPP upload file server";
24 Configuration for Prosody Filer.
25 Refer to <https://github.com/ThomasLeister/prosody-filer#configure-prosody-filer> for details on supported values.
28 type = settingsFormat.type;
32 storeDir = "/srv/http/nginx/prosody-upload";
35 defaultText = literalExpression ''
37 listenport = mkDefault "127.0.0.1:5050";
38 uploadSubDir = mkDefault "upload/";
45 config = mkIf cfg.enable {
46 services.prosody-filer.settings = {
47 listenport = mkDefault "127.0.0.1:5050";
48 uploadSubDir = mkDefault "upload/";
51 users.users.prosody-filer = {
52 group = "prosody-filer";
56 users.groups.prosody-filer = { };
58 systemd.services.prosody-filer = {
59 description = "Prosody file upload server";
60 wantedBy = [ "multi-user.target" ];
61 after = [ "network.target" ];
64 User = "prosody-filer";
65 Group = "prosody-filer";
66 ExecStart = "${pkgs.prosody-filer}/bin/prosody-filer -config ${configFile}";
67 Restart = "on-failure";
68 CapabilityBoundingSet = "";
69 NoNewPrivileges = true;
70 PrivateDevices = true;
75 ProtectProc = "noaccess";
77 ProtectKernelLogs = true;
78 ProtectKernelModules = true;
79 ProtectKernelTunables = true;
80 ProtectControlGroups = true;
81 ProtectHostname = true;
82 RestrictSUIDSGID = true;
83 RestrictRealtime = true;
84 RestrictNamespaces = true;
85 LockPersonality = true;
87 RestrictAddressFamilies = [