diff options
author | tv <tv@krebsco.de> | 2016-02-06 18:54:01 +0100 |
---|---|---|
committer | tv <tv@krebsco.de> | 2016-02-06 18:54:01 +0100 |
commit | 29746aec06b7d42d3c87245f6f14f048234251e4 (patch) | |
tree | 2b999fc70077f40331665ef39b8a0f7c5d225910 | |
parent | c784d271c5dc8783e5e6308baf4f6dd26430bfca (diff) |
krebs.{backup.plans,hosts,users}.*.name: add default value
-rw-r--r-- | krebs/3modules/backup.nix | 3 | ||||
-rw-r--r-- | krebs/3modules/lass/default.nix | 4 | ||||
-rw-r--r-- | krebs/3modules/makefu/default.nix | 4 | ||||
-rw-r--r-- | krebs/3modules/mv/default.nix | 4 | ||||
-rw-r--r-- | krebs/3modules/shared/default.nix | 4 | ||||
-rw-r--r-- | krebs/3modules/tv/default.nix | 4 | ||||
-rw-r--r-- | krebs/4lib/types.nix | 6 | ||||
-rw-r--r-- | makefu/2configs/backup.nix | 2 | ||||
-rw-r--r-- | tv/2configs/backup.nix | 2 |
9 files changed, 18 insertions, 15 deletions
diff --git a/krebs/3modules/backup.nix b/krebs/3modules/backup.nix index a1f335905..17d8a3c98 100644 --- a/krebs/3modules/backup.nix +++ b/krebs/3modules/backup.nix @@ -12,7 +12,7 @@ let enable = mkEnableOption "krebs.backup" // { default = true; }; plans = mkOption { default = {}; - type = types.attrsOf (types.submodule ({ + type = types.attrsOf (types.submodule ({ config, ... }: { # TODO enable = mkEnableOption "TODO" // { default = true; }; options = { method = mkOption { @@ -20,6 +20,7 @@ let }; name = mkOption { type = types.str; + default = config._module.args.name; }; src = mkOption { type = types.krebs.file-location; diff --git a/krebs/3modules/lass/default.nix b/krebs/3modules/lass/default.nix index 26b0947bb..c880ea788 100644 --- a/krebs/3modules/lass/default.nix +++ b/krebs/3modules/lass/default.nix @@ -3,7 +3,7 @@ with lib; { - hosts = addNames { + hosts = { echelon = { cores = 2; dc = "lass"; #dc = "cac"; @@ -214,7 +214,7 @@ with lib; }; }; - users = addNames { + users = { lass = { pubkey = readFile ../../Zpubkeys/lass.ssh.pub; mail = "lass@mors.retiolum"; diff --git a/krebs/3modules/makefu/default.nix b/krebs/3modules/makefu/default.nix index 38e773b53..693a954ab 100644 --- a/krebs/3modules/makefu/default.nix +++ b/krebs/3modules/makefu/default.nix @@ -3,7 +3,7 @@ with lib; { - hosts = addNames { + hosts = { pnp = { cores = 1; dc = "makefu"; #vm on 'omo' @@ -364,7 +364,7 @@ TNs2RYfwDy/r6H/hDeB/BSngPouedEVcPwIDAQAB ssh.pubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIcxWFEPzke/Sdd9qNX6rSJgXal8NmINYajpFCxXfYdj root@gum"; }; }; - users = addNames rec { + users = rec { makefu = { mail = "makefu@pornocauster.retiolum"; pubkey = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCl3RTOHd5DLiVeUbUr/GSiKoRWknXQnbkIf+uNiFO+XxiqZVojPlumQUVhasY8UzDzj9tSDruUKXpjut50FhIO5UFAgsBeMJyoZbgY/+R+QKU00Q19+IiUtxeFol/9dCO+F4o937MC0OpAC10LbOXN/9SYIXueYk3pJxIycXwUqhYmyEqtDdVh9Rx32LBVqlBoXRHpNGPLiswV2qNe0b5p919IGcslzf1XoUzfE3a3yjk/XbWh/59xnl4V7Oe7+iQheFxOT6rFA30WYwEygs5As//ZYtxvnn0gA02gOnXJsNjOW9irlxOUeP7IOU6Ye3WRKFRR0+7PS+w8IJLag2xb makefu@pornocauster"; diff --git a/krebs/3modules/mv/default.nix b/krebs/3modules/mv/default.nix index 6da2abc85..70417157f 100644 --- a/krebs/3modules/mv/default.nix +++ b/krebs/3modules/mv/default.nix @@ -3,7 +3,7 @@ with lib; { - hosts = addNames { + hosts = { stro = { cores = 4; dc = "mv"; @@ -31,7 +31,7 @@ with lib; ssh.pubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIM+7Qa51l0NSkBiaK2s8vQEoeObV3UPZyEzMxfUK/ZAO root@stro"; }; }; - users = addNames { + users = { mv_stro = { mail = "mv@stro.retiolum"; pubkey = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCxM34g1GUm5EtU00DAOlGSx8MsCWunhGTrozurj460QT7EdUbZvj0AcrQC0lP9kaZyhX+KueTjmLC+ICsnlHYeg4zoSEnSAUkccuyZxfgynVc4wrpfNAc1nHjDhDb/ulnC+8wNxvxUpI0XlBgu/Y7AbbChZj3ofv6uGGHJKfG3uSyCkt9VTCi1KwydHpe9P252N8NbopnbnkT0EMkRHruh7ICEKr4/ivmUL/IUrbFicEeCy4SeRAl8+00x4WqqvbBPzgdXn0AIjKLvus3dBoQubJNpUoXnyXJbElnit5a7QcgZJNLMbV0kf9zzCGduxkADzHkAFB9D4PuSMYt62iy12QlGbm80A9ncuwaSyJf7hPTvNbU8VyCblyfRz/SCaudUrfk5Xbxxu26FHi4hZqr3IUQt4T8pD8JWYGl4n2ZKnD8hHz/jrmNBK8h9d+VFafU9t1hRxlFsW1AhMEM+kfWClyhfTcKBKbml2a657lgUEVmlZt+18kwwsivM1QhHNTgxn5urRXRkh1VQ40UQroVuV1OUmvAngyAthF441VPGc5z7kEI+D4qjmUjSy6k4dvEy/RGfsAgJCf63zilRuUbL68f2OpxE8aeZZUXPvgdLml284pry7+C5sjlnCDoJfCj/yhdVx6mU9pWUd/Q97CLQewbsYhMzsqlBlIkXuipkDQ== mv@stro"; diff --git a/krebs/3modules/shared/default.nix b/krebs/3modules/shared/default.nix index 91d92857b..52aa4de41 100644 --- a/krebs/3modules/shared/default.nix +++ b/krebs/3modules/shared/default.nix @@ -32,7 +32,7 @@ let }; }); in { - hosts = addNames { + hosts = { wolf = { dc = "shack"; nets = { @@ -68,7 +68,7 @@ in { ssh.pubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKYMXMWZIK0jjnZDM9INiYAKcwjXs2241vew54K8veCR"; }; } // testHosts; - users = addNames { + users = { shared = { mail = "spam@krebsco.de"; pubkey = "lol"; # TODO krebs.users.shared.pubkey should be unnecessary diff --git a/krebs/3modules/tv/default.nix b/krebs/3modules/tv/default.nix index 9adb0ce11..ca07acd17 100644 --- a/krebs/3modules/tv/default.nix +++ b/krebs/3modules/tv/default.nix @@ -6,7 +6,7 @@ with lib; dns.providers = { de.viljetic = "regfish"; }; - hosts = addNames { + hosts = { cd = rec { cores = 2; dc = "tv"; #dc = "cac"; @@ -351,7 +351,7 @@ with lib; ssh.pubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPnjfceKuHNQu7S4eYFN1FqgzMqiL7haNZMh2ZLhvuhK root@xu"; }; }; - users = addNames rec { + users = rec { mv = { mail = "mv@cd.retiolum"; pubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGer9e2+Lew7vnisgBbsFNECEIkpNJgEaqQqgb9inWkQ mv@vod"; diff --git a/krebs/4lib/types.nix b/krebs/4lib/types.nix index 6c396a132..2907a413a 100644 --- a/krebs/4lib/types.nix +++ b/krebs/4lib/types.nix @@ -10,6 +10,7 @@ types // rec { options = { name = mkOption { type = label; + default = config._module.args.name; }; dc = mkOption { type = label; @@ -155,19 +156,20 @@ types // rec { merge = mergeOneOption; }; - user = submodule { + user = submodule ({ config, ... }: { options = { mail = mkOption { type = str; # TODO retiolum mail address }; name = mkOption { type = str; # TODO + default = config._module.args.name; }; pubkey = mkOption { type = str; }; }; - }; + }); # TODO addr = str; diff --git a/makefu/2configs/backup.nix b/makefu/2configs/backup.nix index ed6d1f4a7..936f31c1c 100644 --- a/makefu/2configs/backup.nix +++ b/makefu/2configs/backup.nix @@ -24,7 +24,7 @@ let }; }; in { - krebs.backup.plans = addNames { + krebs.backup.plans = { wry-to-omo_var-www = defaultPull wry "/var/www"; }; } diff --git a/tv/2configs/backup.nix b/tv/2configs/backup.nix index ce937a744..f4d368557 100644 --- a/tv/2configs/backup.nix +++ b/tv/2configs/backup.nix @@ -1,7 +1,7 @@ { config, lib, ... }: with lib; { - krebs.backup.plans = addNames { + krebs.backup.plans = { wu-home-xu = { method = "push"; src = { host = config.krebs.hosts.wu; path = "/home"; }; |