2018-07-20 22:56:59 +02:00
|
|
|
{ config, lib, ...}:
|
2018-01-24 17:28:31 +01:00
|
|
|
|
|
|
|
let
|
2018-07-20 21:36:12 +02:00
|
|
|
inherit (lib) concatStringsSep mkOption types;
|
2018-01-24 17:28:31 +01:00
|
|
|
|
|
|
|
in rec {
|
|
|
|
|
|
|
|
mkCellServDB = cellName: db: ''
|
|
|
|
>${cellName}
|
|
|
|
'' + (concatStringsSep "\n" (map (dbm: if (dbm.ip != "" && dbm.dnsname != "") then dbm.ip + " #" + dbm.dnsname else "")
|
2018-06-30 00:34:35 +02:00
|
|
|
db))
|
|
|
|
+ "\n";
|
2018-01-24 17:28:31 +01: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-30 00:34:35 +02:00
|
|
|
|
|
|
|
openafsMod = config.services.openafsClient.packages.module;
|
|
|
|
openafsBin = config.services.openafsClient.packages.programs;
|
|
|
|
openafsSrv = config.services.openafsServer.package;
|
2018-01-24 17:28:31 +01:00
|
|
|
}
|