From 42e14ff69ff52c74f5ccbb37b7954ef4dea7bf5a Mon Sep 17 00:00:00 2001 From: illustris Date: Wed, 3 Nov 2021 19:36:28 +0530 Subject: [PATCH] nixos/hadoop: replace enable = mkoption bools with mkEnableOption --- .../modules/services/cluster/hadoop/hdfs.nix | 40 +++---------------- .../modules/services/cluster/hadoop/yarn.nix | 16 +------- 2 files changed, 7 insertions(+), 49 deletions(-) diff --git a/nixos/modules/services/cluster/hadoop/hdfs.nix b/nixos/modules/services/cluster/hadoop/hdfs.nix index e2cd8bc6fbaa..52f951a6c5f4 100644 --- a/nixos/modules/services/cluster/hadoop/hdfs.nix +++ b/nixos/modules/services/cluster/hadoop/hdfs.nix @@ -17,13 +17,7 @@ in { options.services.hadoop.hdfs = { namenode = { - enable = mkOption { - type = types.bool; - default = false; - description = '' - Whether to run the HDFS NameNode - ''; - }; + enable = mkEnableOption "Whether to run the HDFS NameNode"; formatOnInit = mkOption { type = types.bool; default = false; @@ -43,13 +37,7 @@ in }; }; datanode = { - enable = mkOption { - type = types.bool; - default = false; - description = '' - Whether to run the HDFS DataNode - ''; - }; + enable = mkEnableOption "Whether to run the HDFS DataNode"; inherit restartIfChanged; openFirewall = mkOption { type = types.bool; @@ -60,13 +48,7 @@ in }; }; journalnode = { - enable = mkOption { - type = types.bool; - default = false; - description = '' - Whether to run the HDFS JournalNode - ''; - }; + enable = mkEnableOption "Whether to run the HDFS JournalNode"; inherit restartIfChanged; openFirewall = mkOption { type = types.bool; @@ -77,23 +59,11 @@ in }; }; zkfc = { - enable = mkOption { - type = types.bool; - default = false; - description = '' - Whether to run the HDFS ZooKeeper failover controller - ''; - }; + enable = mkEnableOption "Whether to run the HDFS ZooKeeper failover controller"; inherit restartIfChanged; }; httpfs = { - enable = mkOption { - type = types.bool; - default = false; - description = '' - Whether to run the HDFS httpfs failover controller - ''; - }; + enable = mkEnableOption "Whether to run the HDFS HTTPfs server"; tempPath = mkOption { type = types.path; default = "/tmp/hadoop/httpfs"; diff --git a/nixos/modules/services/cluster/hadoop/yarn.nix b/nixos/modules/services/cluster/hadoop/yarn.nix index b6d4dbe25c03..37c26ea10f76 100644 --- a/nixos/modules/services/cluster/hadoop/yarn.nix +++ b/nixos/modules/services/cluster/hadoop/yarn.nix @@ -17,13 +17,7 @@ in { options.services.hadoop.yarn = { resourcemanager = { - enable = mkOption { - type = types.bool; - default = false; - description = '' - Whether to run the Hadoop YARN ResourceManager - ''; - }; + enable = mkEnableOption "Whether to run the Hadoop YARN ResourceManager"; inherit restartIfChanged; openFirewall = mkOption { type = types.bool; @@ -34,13 +28,7 @@ in }; }; nodemanager = { - enable = mkOption { - type = types.bool; - default = false; - description = '' - Whether to run the Hadoop YARN NodeManager - ''; - }; + enable = mkEnableOption "Whether to run the Hadoop YARN NodeManager"; inherit restartIfChanged; addBinBash = mkOption { type = types.bool;