From c9ccf22b154205caf55262ba6aa305e2c2247a02 Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 27 Sep 2015 00:22:50 +0200 Subject: krebs.build: merge deploy and infest --- tv/1systems/cd.nix | 14 ++++++++------ tv/1systems/mkdir.nix | 42 ++++++++++++++++++++++++++++++++---------- tv/1systems/nomic.nix | 14 ++++++++------ tv/1systems/rmdir.nix | 35 ++++++++++++++++++++++++++--------- tv/1systems/wu.nix | 18 ++++++++++-------- tv/2configs/base.nix | 3 ++- tv/2configs/charybdis.nix | 4 ++-- tv/2configs/git.nix | 3 ++- tv/3modules/consul.nix | 2 +- tv/3modules/ejabberd.nix | 2 +- 10 files changed, 92 insertions(+), 45 deletions(-) (limited to 'tv') diff --git a/tv/1systems/cd.nix b/tv/1systems/cd.nix index b385848f1..54a37b796 100644 --- a/tv/1systems/cd.nix +++ b/tv/1systems/cd.nix @@ -8,16 +8,18 @@ with lib; krebs.build.target = "root@cd.internet"; - krebs.build.deps = { - nixpkgs = { + krebs.build.source = { + git.nixpkgs = { url = https://github.com/4z3/nixpkgs; rev = "03130ec91356cd250b80f144022ee2f4d665ca36"; # 1357692 }; - secrets = { - url = "/home/tv/secrets/${config.krebs.build.host.name}"; + dir.secrets = { + host = config.krebs.hosts.wu; + path = "/home/tv/secrets/cd"; }; - stockholm = { - url = toString ../..; + dir.stockholm = { + host = config.krebs.hosts.wu; + path = "/home/tv/stockholm"; }; }; diff --git a/tv/1systems/mkdir.nix b/tv/1systems/mkdir.nix index cd3d3b5c4..76432ba03 100644 --- a/tv/1systems/mkdir.nix +++ b/tv/1systems/mkdir.nix @@ -2,22 +2,37 @@ with lib; +let + # TODO merge with lass + getDefaultGateway = ip: + concatStringsSep "." (take 3 (splitString "." ip) ++ ["1"]); + + + primary-addr4 = + builtins.elemAt config.krebs.build.host.nets.internet.addrs4 0; + + #secondary-addr4 = + # builtins.elemAt config.krebs.build.host.nets.internet.addrs4 1; +in + { krebs.build.host = config.krebs.hosts.mkdir; krebs.build.user = config.krebs.users.tv; - krebs.build.target = "root@mkdir.internet"; + krebs.build.target = "root@${primary-addr4}"; - krebs.build.deps = { - nixpkgs = { + krebs.build.source = { + git.nixpkgs = { url = https://github.com/NixOS/nixpkgs; - rev = "9d5508d85c33b8fb22d79dde6176792eac2c2696"; + rev = "68bd8e4a9dc247726ae89cc8739574261718e328"; }; - secrets = { - url = "/home/tv/secrets/${config.krebs.build.host.name}"; + dir.secrets = { + host = config.krebs.hosts.wu; + path = "/home/tv/secrets/mkdir"; }; - stockholm = { - url = toString ../..; + dir.stockholm = { + host = config.krebs.hosts.wu; + path = "/home/tv/stockholm"; }; }; @@ -56,11 +71,18 @@ with lib; networking.interfaces.enp2s1.ip4 = [ { - address = "162.248.167.241"; # TODO + address = primary-addr4; prefixLength = 24; } + #{ + # address = secondary-addr4; + # prefixLength = 24; + #} ]; - networking.defaultGateway = "162.248.167.1"; + + # TODO define gateway in krebs/3modules/default.nix + networking.defaultGateway = getDefaultGateway primary-addr4; + networking.nameservers = [ "8.8.8.8" ]; diff --git a/tv/1systems/nomic.nix b/tv/1systems/nomic.nix index f08e74bbe..d5224b54a 100644 --- a/tv/1systems/nomic.nix +++ b/tv/1systems/nomic.nix @@ -8,16 +8,18 @@ with lib; krebs.build.target = "root@nomic.gg23"; - krebs.build.deps = { - nixpkgs = { + krebs.build.source = { + git.nixpkgs = { url = https://github.com/4z3/nixpkgs; rev = "03130ec91356cd250b80f144022ee2f4d665ca36"; # 1357692 }; - secrets = { - url = "/home/tv/secrets/${config.krebs.build.host.name}"; + dir.secrets = { + host = config.krebs.hosts.wu; + path = "/home/tv/secrets/nomic"; }; - stockholm = { - url = toString ../..; + dir.stockholm = { + host = config.krebs.hosts.wu; + path = "/home/tv/stockholm"; }; }; diff --git a/tv/1systems/rmdir.nix b/tv/1systems/rmdir.nix index c8ac43e4c..79e47c539 100644 --- a/tv/1systems/rmdir.nix +++ b/tv/1systems/rmdir.nix @@ -2,22 +2,37 @@ with lib; +let + # TODO merge with lass + getDefaultGateway = ip: + concatStringsSep "." (take 3 (splitString "." ip) ++ ["1"]); + + + primary-addr4 = + builtins.elemAt config.krebs.build.host.nets.internet.addrs4 0; + + #secondary-addr4 = + # builtins.elemAt config.krebs.build.host.nets.internet.addrs4 1; +in + { krebs.build.host = config.krebs.hosts.rmdir; krebs.build.user = config.krebs.users.tv; krebs.build.target = "root@rmdir.internet"; - krebs.build.deps = { - nixpkgs = { + krebs.build.source = { + git.nixpkgs = { url = https://github.com/NixOS/nixpkgs; - rev = "4c01e6d91993b6de128795f4fbdd25f6227fb870"; + rev = "68bd8e4a9dc247726ae89cc8739574261718e328"; }; - secrets = { - url = "/home/tv/secrets/${config.krebs.build.host.name}"; + dir.secrets = { + host = config.krebs.hosts.wu; + path = "/home/tv/secrets/rmdir"; }; - stockholm = { - url = toString ../..; + dir.stockholm = { + host = config.krebs.hosts.wu; + path = "/home/tv/stockholm"; }; }; @@ -57,11 +72,13 @@ with lib; networking.interfaces.enp2s1.ip4 = [ { - address = "167.88.44.94"; + address = primary-addr4; prefixLength = 24; } ]; - networking.defaultGateway = "167.88.44.1"; + # TODO define gateway in krebs/3modules/default.nix + networking.defaultGateway = getDefaultGateway primary-addr4; + networking.nameservers = [ "8.8.8.8" ]; diff --git a/tv/1systems/wu.nix b/tv/1systems/wu.nix index 36733ac41..629c4a5c8 100644 --- a/tv/1systems/wu.nix +++ b/tv/1systems/wu.nix @@ -8,16 +8,18 @@ with lib; krebs.build.target = "root@wu"; - krebs.build.deps = { - nixpkgs = { - url = https://github.com/4z3/nixpkgs; - rev = "03130ec91356cd250b80f144022ee2f4d665ca36"; # 1357692 + krebs.build.source = { + git.nixpkgs = { + url = https://github.com/NixOS/nixpkgs; + rev = "bd84ebaa1e0359f41350e053ed24592b169b5714"; }; - secrets = { - url = "/home/tv/secrets/${config.krebs.build.host.name}"; + dir.secrets = { + host = config.krebs.hosts.wu; + path = "/home/tv/secrets/wu"; }; - stockholm = { - url = toString ../..; + dir.stockholm = { + host = config.krebs.hosts.wu; + path = "/home/tv/stockholm"; }; }; diff --git a/tv/2configs/base.nix b/tv/2configs/base.nix index 89a66115a..1c6eba662 100644 --- a/tv/2configs/base.nix +++ b/tv/2configs/base.nix @@ -15,9 +15,10 @@ in imports = [ { + # TODO never put hashedPassword into the store users.extraUsers = mapAttrs (_: h: { hashedPassword = h; }) - (import /root/src/secrets/hashedPasswords.nix); + (import ); } { users.defaultUserShell = "/run/current-system/sw/bin/bash"; diff --git a/tv/2configs/charybdis.nix b/tv/2configs/charybdis.nix index a949026de..80c6f7c4a 100644 --- a/tv/2configs/charybdis.nix +++ b/tv/2configs/charybdis.nix @@ -21,7 +21,7 @@ let }; dhParams = mkOption { type = types.str; - default = "/root/src/secrets/charybdis.dh.pem"; + default = toString ; }; motd = mkOption { type = types.str; @@ -32,7 +32,7 @@ let }; sslKey = mkOption { type = types.str; - default = "/root/src/secrets/charybdis.key.pem"; + default = toString ; }; }; diff --git a/tv/2configs/git.nix b/tv/2configs/git.nix index 6624d62dc..5f5fae483 100644 --- a/tv/2configs/git.nix +++ b/tv/2configs/git.nix @@ -51,7 +51,8 @@ let collaborators = with config.krebs.users; [ lass makefu ]; }; } // - import /root/src/secrets/repos.nix { inherit config lib pkgs; } + # TODO don't put secrets/repos.nix into the store + import { inherit config lib pkgs; } ); make-public-repo = name: { desc ? null, ... }: { diff --git a/tv/3modules/consul.nix b/tv/3modules/consul.nix index 82a15c024..e764ab7b2 100644 --- a/tv/3modules/consul.nix +++ b/tv/3modules/consul.nix @@ -29,7 +29,7 @@ let }; encrypt-file = mkOption { type = types.str; # TODO path (but not just into store) - default = "/root/src/secrets/consul-encrypt.json"; + default = toString ; }; data-dir = mkOption { type = types.str; # TODO path (but not just into store) diff --git a/tv/3modules/ejabberd.nix b/tv/3modules/ejabberd.nix index 2910a9a69..6b231fb56 100644 --- a/tv/3modules/ejabberd.nix +++ b/tv/3modules/ejabberd.nix @@ -15,7 +15,7 @@ let certFile = mkOption { type = types.str; - default = "/root/src/secrets/ejabberd.pem"; + default = toString ; }; hosts = mkOption { -- cgit v1.2.3 From 46f4644f8ec790b07d6a60b0f7220adc1472c3af Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 27 Sep 2015 00:24:17 +0200 Subject: tv: reintroduce configs exim-smarthost --- tv/1systems/cd.nix | 54 +---------------------------------------- tv/2configs/exim-smarthost.nix | 55 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+), 53 deletions(-) create mode 100644 tv/2configs/exim-smarthost.nix (limited to 'tv') diff --git a/tv/1systems/cd.nix b/tv/1systems/cd.nix index 54a37b796..4f66b3592 100644 --- a/tv/1systems/cd.nix +++ b/tv/1systems/cd.nix @@ -28,6 +28,7 @@ with lib; ../2configs/CAC-CentOS-7-64bit.nix ../2configs/base.nix #../2configs/consul-server.nix + ../2configs/exim-smarthost.nix ../2configs/git.nix { imports = [ ../2configs/charybdis.nix ]; @@ -42,59 +43,6 @@ with lib; hosts = [ "jabber.viljetic.de" ]; }; } - { - krebs.exim-smarthost = { - enable = true; - primary_hostname = "${config.networking.hostName}.retiolum"; - sender_domains = [ - "shackspace.de" - "viljetic.de" - ]; - relay_from_hosts = [ - "10.243.13.37" - ]; - internet-aliases = with config.krebs.users; [ - { from = "tomislav@viljetic.de"; to = tv.mail; } - - # (mindestens) lisp-stammtisch und elli haben die: - { from = "tv@viljetic.de"; to = tv.mail; } - - { from = "tv@destroy.dyn.shackspace.de"; to = tv.mail; } - - { from = "mirko@viljetic.de"; to = mv.mail; } - - # TODO killme (wo wird die benutzt?) - { from = "tv@cd.retiolum"; to = tv.mail; } - - # TODO lists@smtp.retiolum [consul] - { from = "postmaster@krebsco.de"; to = tv.mail; } - - { from = "spam@krebsco.de"; - to = pkgs.lib.concatStringsSep "," [ - tv.mail - "lass@mors.retiolum" - makefu.mail - ]; - } - ]; - system-aliases = [ - { from = "mailer-daemon"; to = "postmaster"; } - { from = "postmaster"; to = "root"; } - { from = "nobody"; to = "root"; } - { from = "hostmaster"; to = "root"; } - { from = "usenet"; to = "root"; } - { from = "news"; to = "root"; } - { from = "webmaster"; to = "root"; } - { from = "www"; to = "root"; } - { from = "ftp"; to = "root"; } - { from = "abuse"; to = "root"; } - { from = "noc"; to = "root"; } - { from = "security"; to = "root"; } - { from = "root"; to = "tv"; } - { from = "mirko"; to = "mv"; } - ]; - }; - } { krebs.github-hosts-sync.enable = true; tv.iptables.input-internet-accept-new-tcp = diff --git a/tv/2configs/exim-smarthost.nix b/tv/2configs/exim-smarthost.nix new file mode 100644 index 000000000..811c8e4c7 --- /dev/null +++ b/tv/2configs/exim-smarthost.nix @@ -0,0 +1,55 @@ +{ config, pkgs, ... }: + +{ + krebs.exim-smarthost = { + enable = true; + primary_hostname = "${config.networking.hostName}.retiolum"; + sender_domains = [ + "shackspace.de" + "viljetic.de" + ]; + relay_from_hosts = [ + "10.243.13.37" + ]; + internet-aliases = with config.krebs.users; [ + { from = "tomislav@viljetic.de"; to = tv.mail; } + + # (mindestens) lisp-stammtisch und elli haben die: + { from = "tv@viljetic.de"; to = tv.mail; } + + { from = "tv@destroy.dyn.shackspace.de"; to = tv.mail; } + + { from = "mirko@viljetic.de"; to = mv.mail; } + + # TODO killme (wo wird die benutzt?) + { from = "tv@cd.retiolum"; to = tv.mail; } + + # TODO lists@smtp.retiolum [consul] + { from = "postmaster@krebsco.de"; to = tv.mail; } + + { from = "spam@krebsco.de"; + to = pkgs.lib.concatStringsSep "," [ + tv.mail + "lass@mors.retiolum" + makefu.mail + ]; + } + ]; + system-aliases = [ + { from = "mailer-daemon"; to = "postmaster"; } + { from = "postmaster"; to = "root"; } + { from = "nobody"; to = "root"; } + { from = "hostmaster"; to = "root"; } + { from = "usenet"; to = "root"; } + { from = "news"; to = "root"; } + { from = "webmaster"; to = "root"; } + { from = "www"; to = "root"; } + { from = "ftp"; to = "root"; } + { from = "abuse"; to = "root"; } + { from = "noc"; to = "root"; } + { from = "security"; to = "root"; } + { from = "root"; to = "tv"; } + { from = "mirko"; to = "mv"; } + ]; + }; +} -- cgit v1.2.3 From 1e7e36fe14049f2c569afac2a68539a34fb9c4bc Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 27 Sep 2015 00:38:18 +0200 Subject: tv.wu: bumblewhoo? --- tv/1systems/wu.nix | 3 --- 1 file changed, 3 deletions(-) (limited to 'tv') diff --git a/tv/1systems/wu.nix b/tv/1systems/wu.nix index 629c4a5c8..8792d7692 100644 --- a/tv/1systems/wu.nix +++ b/tv/1systems/wu.nix @@ -216,7 +216,6 @@ with lib; extraGroups = [ "audio" "video" - "bumblebee" ]; }; @@ -257,7 +256,6 @@ with lib; extraGroups = [ "audio" "video" - "bumblebee" ]; }; @@ -266,7 +264,6 @@ with lib; extraGroups = [ "audio" "video" - "bumblebee" ]; }; -- cgit v1.2.3 From e04efb378730a9dc451a95b06a027e4e53733489 Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 27 Sep 2015 00:38:37 +0200 Subject: tv.wu: /home is btrfs --- tv/1systems/wu.nix | 1 + 1 file changed, 1 insertion(+) (limited to 'tv') diff --git a/tv/1systems/wu.nix b/tv/1systems/wu.nix index 8792d7692..17394df25 100644 --- a/tv/1systems/wu.nix +++ b/tv/1systems/wu.nix @@ -331,6 +331,7 @@ with lib; }; "/home" = { device = "/dev/mapper/home"; + fsType = "btrfs"; options = "defaults,noatime,ssd,compress=lzo"; }; "/boot" = { -- cgit v1.2.3 From e5f71b82e6fa09c649e885741b929215246775ca Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 27 Sep 2015 00:39:03 +0200 Subject: nomic: systemPackages += gnupg --- tv/1systems/nomic.nix | 1 + 1 file changed, 1 insertion(+) (limited to 'tv') diff --git a/tv/1systems/nomic.nix b/tv/1systems/nomic.nix index d5224b54a..718f6ae24 100644 --- a/tv/1systems/nomic.nix +++ b/tv/1systems/nomic.nix @@ -114,6 +114,7 @@ with lib; exit 23 esac '') + gnupg ntp # ntpate rxvt_unicode.terminfo tmux -- cgit v1.2.3