8 cfg = config.services.rimgo;
23 options.services.rimgo = {
24 enable = mkEnableOption "rimgo";
25 package = mkPackageOption pkgs "rimgo" { };
27 type = types.submodule {
28 freeformType = with types; attrsOf str;
34 description = "The port to use.";
38 default = "127.0.0.1";
40 description = "The address to listen on.";
44 example = literalExpression ''
51 Settings for rimgo, see [the official documentation](https://rimgo.codeberg.page/docs/usage/configuration/) for supported options.
56 config = mkIf cfg.enable {
57 systemd.services.rimgo = {
58 description = "Rimgo";
59 wantedBy = [ "multi-user.target" ];
60 after = [ "network.target" ];
61 environment = mapAttrs (_: toString) cfg.settings;
63 ExecStart = getExe cfg.package;
64 AmbientCapabilities = mkIf (cfg.settings.PORT < 1024) [
65 "CAP_NET_BIND_SERVICE"
68 Restart = "on-failure";
70 CapabilityBoundingSet = [
71 (optionalString (cfg.settings.PORT < 1024) "CAP_NET_BIND_SERVICE")
74 LockPersonality = true;
75 MemoryDenyWriteExecute = true;
76 PrivateDevices = true;
77 PrivateUsers = cfg.settings.PORT >= 1024;
80 ProtectControlGroups = true;
82 ProtectHostname = true;
83 ProtectKernelLogs = true;
84 ProtectKernelModules = true;
85 ProtectKernelTunables = true;
86 ProtectProc = "invisible";
87 RestrictAddressFamilies = [
91 RestrictNamespaces = true;
92 RestrictRealtime = true;
93 RestrictSUIDSGID = true;
94 SystemCallArchitectures = "native";
105 maintainers = with lib.maintainers; [ quantenzitrone ];