2018-07-20 21:56:59 +01:00
|
|
|
{ config, lib, ...}:
|
2018-01-24 16:28:31 +00:00
|
|
|
|
|
|
|
let
|
2018-07-20 20:36:12 +01:00
|
|
|
inherit (lib) concatStringsSep mkOption types;
|
2018-01-24 16:28:31 +00:00
|
|
|
|
2019-08-13 22:52:01 +01:00
|
|
|
in {
|
2018-01-24 16:28:31 +00:00
|
|
|
|
|
|
|
mkCellServDB = cellName: db: ''
|
|
|
|
>${cellName}
|
|
|
|
'' + (concatStringsSep "\n" (map (dbm: if (dbm.ip != "" && dbm.dnsname != "") then dbm.ip + " #" + dbm.dnsname else "")
|
2018-06-29 23:34:35 +01:00
|
|
|
db))
|
|
|
|
+ "\n";
|
2018-01-24 16:28:31 +00:00
|
|
|
|
|
|
|
# CellServDB configuration type
|
|
|
|
cellServDBConfig = {
|
|
|
|
ip = mkOption {
|
|
|
|
type = types.str;
|
|
|
|
default = "";
|
|
|
|
example = "1.2.3.4";
|
|
|
|
description = "IP Address of a database server";
|
|
|
|
};
|
|
|
|
dnsname = mkOption {
|
|
|
|
type = types.str;
|
|
|
|
default = "";
|
|
|
|
example = "afs.example.org";
|
|
|
|
description = "DNS full-qualified domain name of a database server";
|
|
|
|
};
|
|
|
|
};
|
2018-06-29 23:34:35 +01:00
|
|
|
|
|
|
|
openafsMod = config.services.openafsClient.packages.module;
|
|
|
|
openafsBin = config.services.openafsClient.packages.programs;
|
|
|
|
openafsSrv = config.services.openafsServer.package;
|
2018-01-24 16:28:31 +00:00
|
|
|
}
|