2015-09-27 13:23:54 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
2016-10-20 18:54:38 +00:00
|
|
|
with import <stockholm/lib>;
|
2015-09-27 13:23:54 +00:00
|
|
|
let
|
|
|
|
|
2016-04-08 01:53:34 +00:00
|
|
|
external-ip = config.krebs.build.host.nets.internet.ip4.addr;
|
|
|
|
internal-ip = config.krebs.build.host.nets.retiolum.ip4.addr;
|
2015-09-27 13:23:54 +00:00
|
|
|
in {
|
|
|
|
imports = [
|
2016-02-15 15:27:11 +00:00
|
|
|
../.
|
2015-10-19 17:48:56 +00:00
|
|
|
# TODO: copy this config or move to krebs
|
2016-06-13 14:22:51 +00:00
|
|
|
../2configs/hw/CAC.nix
|
|
|
|
../2configs/fs/CAC-CentOS-7-64bit.nix
|
2016-06-23 14:57:36 +00:00
|
|
|
../2configs/save-diskspace.nix
|
2015-10-19 17:48:56 +00:00
|
|
|
|
2016-12-25 00:08:49 +00:00
|
|
|
../2configs/bepasty-dual.nix
|
2015-10-21 16:49:20 +00:00
|
|
|
|
2015-10-19 21:46:10 +00:00
|
|
|
../2configs/iodined.nix
|
2016-10-19 10:31:13 +00:00
|
|
|
../2configs/backup.nix
|
2015-10-28 20:31:07 +00:00
|
|
|
|
|
|
|
# other nginx
|
|
|
|
../2configs/nginx/euer.wiki.nix
|
2015-11-05 11:28:25 +00:00
|
|
|
../2configs/nginx/euer.blog.nix
|
2016-12-24 22:41:33 +00:00
|
|
|
# ../2configs/nginx/euer.test.nix
|
2016-10-19 10:31:13 +00:00
|
|
|
|
2015-10-27 17:12:05 +00:00
|
|
|
# collectd
|
2017-01-10 10:34:44 +00:00
|
|
|
../2configs/logging/central-stats-client.nix
|
2017-02-08 17:37:15 +00:00
|
|
|
../2configs/logging/central-logging-client.nix
|
2016-07-20 15:18:57 +00:00
|
|
|
|
|
|
|
../2configs/tinc/retiolum.nix
|
2017-01-10 10:34:44 +00:00
|
|
|
# ../2configs/torrent.nix
|
2015-09-27 13:23:54 +00:00
|
|
|
];
|
2016-06-23 14:57:36 +00:00
|
|
|
|
2015-11-06 22:54:27 +00:00
|
|
|
krebs.build.host = config.krebs.hosts.wry;
|
2015-10-19 17:48:56 +00:00
|
|
|
|
2015-10-21 16:49:20 +00:00
|
|
|
# prepare graphs
|
2016-12-24 22:41:33 +00:00
|
|
|
services.nginx.enable = true;
|
2015-10-19 19:51:20 +00:00
|
|
|
krebs.retiolum-bootstrap.enable = true;
|
2016-12-25 00:08:49 +00:00
|
|
|
krebs.bepasty.servers."paste.r".nginx.extraConfig = ''
|
|
|
|
if ( $server_addr = "${external-ip}" ) {
|
|
|
|
return 403;
|
|
|
|
}
|
|
|
|
'';
|
2015-10-22 13:33:05 +00:00
|
|
|
krebs.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 = {
|
2016-12-24 22:41:33 +00:00
|
|
|
extraConfig = ''
|
|
|
|
if ( $server_addr = "${external-ip}" ) {
|
|
|
|
return 403;
|
|
|
|
}
|
|
|
|
'';
|
2017-03-24 12:03:46 +00:00
|
|
|
serverAliases = [ "graphs.r" "graphs.retiolum" "graphs.wry" "graphs.retiolum" "graphs.wry.retiolum" ];
|
2015-10-21 16:49:20 +00:00
|
|
|
};
|
|
|
|
anonymous = {
|
2016-12-24 22:41:33 +00:00
|
|
|
enableSSL = true;
|
|
|
|
forceSSL = true;
|
|
|
|
enableACME = true;
|
2015-10-21 16:49:20 +00:00
|
|
|
};
|
|
|
|
};
|
2015-10-04 16:55:53 +00:00
|
|
|
};
|
2015-11-06 22:54:27 +00:00
|
|
|
|
2015-10-21 16:49:20 +00:00
|
|
|
networking = {
|
2015-12-30 10:29:28 +00:00
|
|
|
firewall = {
|
2015-11-13 11:25:18 +00:00
|
|
|
allowPing = true;
|
|
|
|
logRefusedConnections = false;
|
|
|
|
allowedTCPPorts = [ 53 80 443 ];
|
2015-12-30 10:29:28 +00:00
|
|
|
allowedUDPPorts = [ 655 53 ];
|
2015-11-13 11:25:18 +00:00
|
|
|
};
|
2015-10-21 16:49:20 +00:00
|
|
|
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
|
|
|
};
|
|
|
|
|
2016-08-21 10:06:31 +00:00
|
|
|
environment.systemPackages = [ pkgs.screen ];
|
2015-09-27 13:23:54 +00:00
|
|
|
}
|