1{ config, lib, pkgs, ...}:
2
3with lib;
4{
5 imports = [ ./yarn.nix ./hdfs.nix ];
6
7 options.services.hadoop = {
8 coreSite = mkOption {
9 default = {};
10 example = {
11 "fs.defaultFS" = "hdfs://localhost";
12 };
13 description = "Hadoop core-site.xml definition";
14 };
15
16 hdfsSite = mkOption {
17 default = {};
18 example = {
19 "dfs.nameservices" = "namenode1";
20 };
21 description = "Hadoop hdfs-site.xml definition";
22 };
23
24 mapredSite = mkOption {
25 default = {};
26 example = {
27 "mapreduce.map.cpu.vcores" = "1";
28 };
29 description = "Hadoop mapred-site.xml definition";
30 };
31
32 yarnSite = mkOption {
33 default = {};
34 example = {
35 "yarn.resourcemanager.ha.id" = "resourcemanager1";
36 };
37 description = "Hadoop yarn-site.xml definition";
38 };
39
40 package = mkOption {
41 type = types.package;
42 default = pkgs.hadoop;
43 defaultText = "pkgs.hadoop";
44 example = literalExample "pkgs.hadoop";
45 description = ''
46 '';
47 };
48 };
49
50
51 config = mkMerge [
52 (mkIf (builtins.hasAttr "yarn" config.users.users ||
53 builtins.hasAttr "hdfs" config.users.users) {
54 users.groups.hadoop = {
55 gid = config.ids.gids.hadoop;
56 };
57 })
58
59 ];
60}