2024-12-10 20:26:33 +01:00
|
|
|
{ config, lib, ... }:
|
2018-01-24 17:28:31 +01:00
|
|
|
|
|
|
|
let
|
2024-12-10 20:26:33 +01:00
|
|
|
inherit (lib)
|
|
|
|
concatStringsSep
|
|
|
|
mkOption
|
|
|
|
types
|
|
|
|
optionalString
|
|
|
|
;
|
2018-01-24 17:28:31 +01:00
|
|
|
|
2024-12-10 20:26:33 +01:00
|
|
|
in
|
|
|
|
{
|
2018-01-24 17:28:31 +01:00
|
|
|
|
2024-12-10 20:26:33 +01:00
|
|
|
mkCellServDB =
|
|
|
|
cellName: db:
|
|
|
|
''
|
|
|
|
>${cellName}
|
|
|
|
''
|
|
|
|
+ (concatStringsSep "\n" (
|
|
|
|
map (dbm: optionalString (dbm.ip != "" && dbm.dnsname != "") "${dbm.ip} #${dbm.dnsname}") 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";
|
2024-04-13 14:54:15 +02:00
|
|
|
description = "IP Address of a database server";
|
2018-01-24 17:28:31 +01:00
|
|
|
};
|
|
|
|
dnsname = mkOption {
|
|
|
|
type = types.str;
|
|
|
|
default = "";
|
|
|
|
example = "afs.example.org";
|
2024-04-13 14:54:15 +02:00
|
|
|
description = "DNS full-qualified domain name of a database server";
|
2018-01-24 17:28:31 +01:00
|
|
|
};
|
|
|
|
};
|
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
|
|
|
}
|