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
|
|
|
|
|
|
|
in rec {
|
|
|
|
|
|
|
|
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
|
|
|
}
|