2015-09-27 13:23:54 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
2015-10-21 16:49:20 +00:00
|
|
|
with lib;
|
2015-09-27 13:23:54 +00:00
|
|
|
let
|
|
|
|
|
2015-10-21 16:49:20 +00:00
|
|
|
external-ip = head config.krebs.build.host.nets.internet.addrs4;
|
|
|
|
internal-ip = head config.krebs.build.host.nets.retiolum.addrs4;
|
2015-09-27 13:23:54 +00:00
|
|
|
in {
|
|
|
|
imports = [
|
2015-10-19 17:48:56 +00:00
|
|
|
# TODO: copy this config or move to krebs
|
|
|
|
../../tv/2configs/CAC-CentOS-7-64bit.nix
|
|
|
|
../2configs/base.nix
|
2015-10-21 16:49:20 +00:00
|
|
|
../2configs/unstable-sources.nix
|
2015-10-19 17:48:56 +00:00
|
|
|
../2configs/tinc-basic-retiolum.nix
|
|
|
|
|
2015-10-21 16:49:20 +00:00
|
|
|
../2configs/bepasty-dual.nix
|
|
|
|
|
2015-10-19 21:46:10 +00:00
|
|
|
../2configs/iodined.nix
|
|
|
|
|
2015-10-19 17:48:56 +00:00
|
|
|
# Reaktor
|
|
|
|
../2configs/Reaktor/simpleExtend.nix
|
2015-09-27 13:23:54 +00:00
|
|
|
];
|
2015-10-04 16:55:53 +00:00
|
|
|
|
2015-10-21 16:49:20 +00:00
|
|
|
krebs.build = {
|
|
|
|
user = config.krebs.users.makefu;
|
|
|
|
target = "root@wry";
|
|
|
|
host = config.krebs.hosts.wry;
|
|
|
|
};
|
2015-10-19 17:48:56 +00:00
|
|
|
|
2015-09-27 13:23:54 +00:00
|
|
|
|
2015-10-01 16:48:41 +00:00
|
|
|
|
2015-10-21 16:49:20 +00:00
|
|
|
krebs.Reaktor.enable = true;
|
|
|
|
|
|
|
|
# bepasty to listen only on the correct interfaces
|
|
|
|
krebs.bepasty.servers.internal.nginx.listen = [ "${internal-ip}:80" ];
|
|
|
|
krebs.bepasty.servers.external.nginx.listen = [ "${external-ip}:80" "${external-ip}:443 ssl" ];
|
2015-10-19 19:51:20 +00:00
|
|
|
|
2015-10-21 16:49:20 +00:00
|
|
|
# prepare graphs
|
2015-10-04 16:55:53 +00:00
|
|
|
krebs.nginx.enable = true;
|
2015-10-19 19:51:20 +00:00
|
|
|
krebs.retiolum-bootstrap.enable = true;
|
|
|
|
|
2015-10-21 16:49:20 +00:00
|
|
|
nixpkgs.config.packageOverrides = pkgs: { tinc = pkgs.tinc_pre; };
|
|
|
|
makefu.tinc_graphs = {
|
2015-10-04 16:55:53 +00:00
|
|
|
enable = true;
|
2015-10-21 16:49:20 +00:00
|
|
|
nginx = {
|
|
|
|
enable = true;
|
|
|
|
# TODO: remove hard-coded hostname
|
|
|
|
complete = {
|
|
|
|
listen = [ "${internal-ip}:80" ];
|
|
|
|
server-names = [ "graphs.wry" ];
|
|
|
|
};
|
|
|
|
anonymous = {
|
|
|
|
listen = [ "${external-ip}:80" ] ;
|
|
|
|
server-names = [ "graphs.krebsco.de" ];
|
|
|
|
};
|
|
|
|
};
|
2015-10-04 16:55:53 +00:00
|
|
|
};
|
2015-10-21 16:49:20 +00:00
|
|
|
networking = {
|
|
|
|
firewall.allowPing = true;
|
|
|
|
firewall.allowedTCPPorts = [ 53 80 443 ];
|
|
|
|
interfaces.enp2s1.ip4 = [{
|
|
|
|
address = external-ip;
|
|
|
|
prefixLength = 24;
|
|
|
|
}];
|
|
|
|
defaultGateway = "104.233.87.1";
|
|
|
|
nameservers = [ "8.8.8.8" ];
|
2015-09-27 13:23:54 +00:00
|
|
|
};
|
|
|
|
|
2015-10-21 16:49:20 +00:00
|
|
|
|
|
|
|
# based on ../../tv/2configs/CAC-Developer-2.nix
|
|
|
|
sound.enable = false;
|
2015-09-27 13:23:54 +00:00
|
|
|
}
|