···
6
-
cfg = config.services.ceph;
6
+
cfg = config.services.ceph;
# function that translates "camelCaseOptions" to "camel case options", credits to tilpner in #nixos@freenode
expandCamelCase = replaceStrings upperChars (map (s: " ${s}") lowerChars);
expandCamelCaseAttrs = mapAttrs' (name: value: nameValuePair (expandCamelCase name) value);
12
-
makeServices = (daemonType: daemonIds:
12
+
makeServices = daemonType: daemonIds:
14
-
{ "ceph-${daemonType}-${daemonId}" = makeService daemonType daemonId cfg.global.clusterName pkgs.ceph; })
14
+
{ "ceph-${daemonType}-${daemonId}" = makeService daemonType daemonId cfg.global.clusterName cfg.${daemonType}.package; })
17
-
makeService = (daemonType: daemonId: clusterName: ceph:
17
+
makeService = daemonType: daemonId: clusterName: ceph:
stateDirectory = "ceph/${if daemonType == "rgw" then "radosgw" else daemonType}/${clusterName}-${daemonId}"; in {
···
} // optionalAttrs ( daemonType == "mon") {
59
-
makeTarget = (daemonType:
59
+
makeTarget = daemonType:
description = "Ceph target allowing to start/stop all ceph-${daemonType} services at once";
···
before = [ "ceph.target" ];
unitConfig.StopWhenUnneeded = true;
options.services.ceph = {
···
to the id part in ceph i.e. [ "name1" ] would result in mgr.name1
213
+
package = mkPackageOptionMD pkgs "ceph" { };
type = with types; attrsOf str;
···
to the id part in ceph i.e. [ "name1" ] would result in mon.name1
234
+
package = mkPackageOptionMD pkgs "ceph" { };
type = with types; attrsOf str;
···
to the id part in ceph i.e. [ "name1" ] would result in osd.name1
255
+
package = mkPackageOptionMD pkgs "ceph" { };
type = with types; attrsOf str;
···
to the id part in ceph i.e. [ "name1" ] would result in mds.name1
283
+
package = mkPackageOptionMD pkgs "ceph" { };
type = with types; attrsOf str;
···
enable = mkEnableOption (lib.mdDoc "Ceph RadosGW daemon");
295
+
package = mkPackageOptionMD pkgs "ceph" { };
type = with types; listOf str;
···
{ assertion = cfg.global.fsid != "";
message = "fsid has to be set to a valid uuid for the cluster to function";
331
-
{ assertion = cfg.mon.enable == true -> cfg.mon.daemons != [];
334
+
{ assertion = cfg.mon.enable -> cfg.mon.daemons != [];
message = "have to set id of atleast one MON if you're going to enable Monitor";
334
-
{ assertion = cfg.mds.enable == true -> cfg.mds.daemons != [];
337
+
{ assertion = cfg.mds.enable -> cfg.mds.daemons != [];
message = "have to set id of atleast one MDS if you're going to enable Metadata Service";
337
-
{ assertion = cfg.osd.enable == true -> cfg.osd.daemons != [];
340
+
{ assertion = cfg.osd.enable -> cfg.osd.daemons != [];
message = "have to set id of atleast one OSD if you're going to enable OSD";
340
-
{ assertion = cfg.mgr.enable == true -> cfg.mgr.daemons != [];
343
+
{ assertion = cfg.mgr.enable -> cfg.mgr.daemons != [];
message = "have to set id of atleast one MGR if you're going to enable MGR";