krebs.hosts: populate if enable, not via default

This commit is contained in:
tv 2015-07-24 21:27:19 +02:00
parent 62ad5ff9d2
commit b61f19e6ed
2 changed files with 184 additions and 168 deletions

View File

@ -9,6 +9,8 @@ let
in in
{ {
krebs.enable = true;
imports = [ imports = [
{ {
users.extraUsers = users.extraUsers =

View File

@ -13,13 +13,50 @@ let
./urlwatch.nix ./urlwatch.nix
]; ];
options.krebs = api; options.krebs = api;
config = mkIf cfg.enable imp; config = mkIf cfg.enable (mkMerge [
imp
{ krebs.hosts = lass-hosts; }
{ krebs.hosts = makefu-hosts; }
{ krebs.hosts = tv-hosts; }
]);
}; };
api = { api = {
enable = mkEnableOption "krebs";
hosts = mkOption { hosts = mkOption {
type = with types; attrsOf host; type = with types; attrsOf host;
default = addNames { };
users = mkOption {
type = with types; attrsOf user;
};
};
imp = {
krebs.users = addNames {
lass = {
pubkey = readFile ../../Zpubkeys/lass.ssh.pub;
};
makefu = {
pubkey = readFile ../../Zpubkeys/makefu.ssh.pub;
};
tv = {
pubkey = readFile ../../Zpubkeys/tv_wu.ssh.pub;
};
uriel = {
pubkey = readFile ../../Zpubkeys/uriel.ssh.pub;
};
};
};
lass-hosts = addNames {
};
makefu-hosts = addNames {
};
tv-hosts = addNames {
cd = { cd = {
cores = 2; cores = 2;
dc = "tv"; #dc = "cac"; dc = "tv"; #dc = "cac";
@ -172,29 +209,6 @@ let
secure = true; secure = true;
}; };
}; };
};
users = mkOption {
type = with types; attrsOf user;
default = addNames {
lass = {
pubkey = readFile ../../Zpubkeys/lass.ssh.pub;
};
makefu = {
pubkey = readFile ../../Zpubkeys/makefu.ssh.pub;
};
tv = {
pubkey = readFile ../../Zpubkeys/tv_wu.ssh.pub;
};
uriel = {
pubkey = readFile ../../Zpubkeys/uriel.ssh.pub;
};
};
};
};
imp = {
};
in in
out out