1{ lib, ...}:
2
3let
4 inherit (lib) concatStringsSep mkOption types;
5
6in rec {
7
8 mkCellServDB = cellName: db: ''
9 >${cellName}
10 '' + (concatStringsSep "\n" (map (dbm: if (dbm.ip != "" && dbm.dnsname != "") then dbm.ip + " #" + dbm.dnsname else "")
11 db));
12
13 # CellServDB configuration type
14 cellServDBConfig = {
15 ip = mkOption {
16 type = types.str;
17 default = "";
18 example = "1.2.3.4";
19 description = "IP Address of a database server";
20 };
21 dnsname = mkOption {
22 type = types.str;
23 default = "";
24 example = "afs.example.org";
25 description = "DNS full-qualified domain name of a database server";
26 };
27 };
28}