rippled module: optionSet -> submodule

+38 -40
+38 -40
nixos/modules/services/misc/rippled.nix
··· 154 }; 155 156 dbOptions = { 157 - type = mkOption { 158 - description = "Rippled database type."; 159 - type = types.enum ["rocksdb" "nudb"]; 160 - default = "rocksdb"; 161 - }; 162 163 - path = mkOption { 164 - description = "Location to store the database."; 165 - type = types.path; 166 - default = cfg.databasePath; 167 - }; 168 169 - compression = mkOption { 170 - description = "Whether to enable snappy compression."; 171 - type = types.nullOr types.bool; 172 - default = null; 173 - }; 174 175 - onlineDelete = mkOption { 176 - description = "Enable automatic purging of older ledger information."; 177 - type = types.addCheck (types.nullOr types.int) (v: v > 256); 178 - default = cfg.ledgerHistory; 179 - }; 180 181 - advisoryDelete = mkOption { 182 - description = '' 183 - If set, then require administrative RPC call "can_delete" 184 - to enable online deletion of ledger records. 185 - ''; 186 - type = types.nullOr types.bool; 187 - default = null; 188 - }; 189 190 - extraOpts = mkOption { 191 - description = "Extra database options."; 192 - type = types.lines; 193 - default = ""; 194 }; 195 }; 196 ··· 213 214 ports = mkOption { 215 description = "Ports exposed by rippled"; 216 - type = types.attrsOf types.optionSet; 217 - options = [portOptions]; 218 default = { 219 rpc = { 220 port = 5005; ··· 238 239 nodeDb = mkOption { 240 description = "Rippled main database options."; 241 - type = types.nullOr types.optionSet; 242 - options = dbOptions; 243 default = { 244 type = "rocksdb"; 245 extraOpts = '' ··· 254 255 tempDb = mkOption { 256 description = "Rippled temporary database options."; 257 - type = types.nullOr types.optionSet; 258 - options = dbOptions; 259 default = null; 260 }; 261 262 importDb = mkOption { 263 description = "Settings for performing a one-time import."; 264 - type = types.nullOr types.optionSet; 265 - options = dbOptions; 266 default = null; 267 }; 268
··· 154 }; 155 156 dbOptions = { 157 + options = { 158 + type = mkOption { 159 + description = "Rippled database type."; 160 + type = types.enum ["rocksdb" "nudb"]; 161 + default = "rocksdb"; 162 + }; 163 164 + path = mkOption { 165 + description = "Location to store the database."; 166 + type = types.path; 167 + default = cfg.databasePath; 168 + }; 169 170 + compression = mkOption { 171 + description = "Whether to enable snappy compression."; 172 + type = types.nullOr types.bool; 173 + default = null; 174 + }; 175 176 + onlineDelete = mkOption { 177 + description = "Enable automatic purging of older ledger information."; 178 + type = types.addCheck (types.nullOr types.int) (v: v > 256); 179 + default = cfg.ledgerHistory; 180 + }; 181 182 + advisoryDelete = mkOption { 183 + description = '' 184 + If set, then require administrative RPC call "can_delete" 185 + to enable online deletion of ledger records. 186 + ''; 187 + type = types.nullOr types.bool; 188 + default = null; 189 + }; 190 191 + extraOpts = mkOption { 192 + description = "Extra database options."; 193 + type = types.lines; 194 + default = ""; 195 + }; 196 }; 197 }; 198 ··· 215 216 ports = mkOption { 217 description = "Ports exposed by rippled"; 218 + type = with types; attrsOf (submodule portOptions); 219 default = { 220 rpc = { 221 port = 5005; ··· 239 240 nodeDb = mkOption { 241 description = "Rippled main database options."; 242 + type = with types; nullOr (submodule dbOptions); 243 default = { 244 type = "rocksdb"; 245 extraOpts = '' ··· 254 255 tempDb = mkOption { 256 description = "Rippled temporary database options."; 257 + type = with types; nullOr (submodule dbOptions); 258 default = null; 259 }; 260 261 importDb = mkOption { 262 description = "Settings for performing a one-time import."; 263 + type = with types; nullOr (submodule dbOptions); 264 default = null; 265 }; 266