2015-09-27 15:23:54 +02:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
2016-02-14 16:43:44 +01:00
|
|
|
with config.krebs.lib;
|
2015-09-27 15:23:54 +02:00
|
|
|
let
|
|
|
|
|
2015-10-21 18:49:20 +02:00
|
|
|
external-ip = head config.krebs.build.host.nets.internet.addrs4;
|
|
|
|
internal-ip = head config.krebs.build.host.nets.retiolum.addrs4;
|
2015-09-27 15:23:54 +02:00
|
|
|
in {
|
|
|
|
imports = [
|
2016-02-15 16:27:11 +01:00
|
|
|
../.
|
2015-10-19 19:48:56 +02:00
|
|
|
# TODO: copy this config or move to krebs
|
2015-11-05 12:28:25 +01:00
|
|
|
../../tv/2configs/hw/CAC.nix
|
|
|
|
../../tv/2configs/fs/CAC-CentOS-7-64bit.nix
|
2015-10-28 15:05:15 +01:00
|
|
|
../2configs/headless.nix
|
2015-10-19 19:48:56 +02:00
|
|
|
|
2015-10-21 18:49:20 +02:00
|
|
|
../2configs/bepasty-dual.nix
|
|
|
|
|
2015-10-19 23:46:10 +02:00
|
|
|
../2configs/iodined.nix
|
|
|
|
|
2015-10-28 21:31:07 +01:00
|
|
|
|
|
|
|
# other nginx
|
|
|
|
../2configs/nginx/euer.wiki.nix
|
2015-11-05 12:28:25 +01:00
|
|
|
../2configs/nginx/euer.blog.nix
|
2015-11-17 22:16:55 +01:00
|
|
|
../2configs/nginx/euer.test.nix
|
2015-11-05 12:28:25 +01:00
|
|
|
|
2015-10-27 18:12:05 +01:00
|
|
|
# collectd
|
|
|
|
../2configs/collectd/collectd-base.nix
|
2015-09-27 15:23:54 +02:00
|
|
|
];
|
2016-03-11 02:10:34 +01:00
|
|
|
krebs.retiolum.enable = true;
|
2016-02-28 02:25:53 +01:00
|
|
|
services.nixosManual.enable = false;
|
|
|
|
programs.man.enable = false;
|
2015-11-06 23:54:27 +01:00
|
|
|
krebs.build.host = config.krebs.hosts.wry;
|
2015-10-19 19:48:56 +02:00
|
|
|
|
2015-12-30 11:29:28 +01:00
|
|
|
krebs.Reaktor = {
|
|
|
|
nickname = "Reaktor|bot";
|
2015-12-30 11:53:48 +01:00
|
|
|
channels = [ "#krebs" "#shackspace" "#binaergewitter" ];
|
2015-12-30 11:29:28 +01:00
|
|
|
enable = true;
|
|
|
|
plugins = with pkgs.ReaktorPlugins;[
|
|
|
|
titlebot
|
|
|
|
# stockholm-issue
|
|
|
|
nixos-version
|
|
|
|
shack-correct
|
|
|
|
sed-plugin
|
|
|
|
random-emoji ];
|
|
|
|
};
|
2015-10-21 18:49:20 +02:00
|
|
|
|
|
|
|
# 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 21:51:20 +02:00
|
|
|
|
2015-10-21 18:49:20 +02:00
|
|
|
# prepare graphs
|
2015-10-04 18:55:53 +02:00
|
|
|
krebs.nginx.enable = true;
|
2015-10-19 21:51:20 +02:00
|
|
|
krebs.retiolum-bootstrap.enable = true;
|
|
|
|
|
2015-10-22 15:33:05 +02:00
|
|
|
krebs.tinc_graphs = {
|
2015-10-04 18:55:53 +02:00
|
|
|
enable = true;
|
2015-10-21 18:49:20 +02:00
|
|
|
nginx = {
|
|
|
|
enable = true;
|
|
|
|
# TODO: remove hard-coded hostname
|
|
|
|
complete = {
|
|
|
|
listen = [ "${internal-ip}:80" ];
|
2015-10-25 18:06:46 +01:00
|
|
|
server-names = [ "graphs.wry" "graphs.retiolum" "graphs.wry.retiolum" ];
|
2015-10-21 18:49:20 +02:00
|
|
|
};
|
|
|
|
anonymous = {
|
|
|
|
listen = [ "${external-ip}:80" ] ;
|
|
|
|
server-names = [ "graphs.krebsco.de" ];
|
|
|
|
};
|
|
|
|
};
|
2015-10-04 18:55:53 +02:00
|
|
|
};
|
2015-11-06 23:54:27 +01:00
|
|
|
|
2015-10-21 18:49:20 +02:00
|
|
|
networking = {
|
2015-12-30 11:29:28 +01:00
|
|
|
firewall = {
|
2015-11-13 12:25:18 +01:00
|
|
|
allowPing = true;
|
|
|
|
logRefusedConnections = false;
|
|
|
|
allowedTCPPorts = [ 53 80 443 ];
|
2015-12-30 11:29:28 +01:00
|
|
|
allowedUDPPorts = [ 655 53 ];
|
2015-11-13 12:25:18 +01:00
|
|
|
};
|
2015-10-21 18:49:20 +02:00
|
|
|
interfaces.enp2s1.ip4 = [{
|
|
|
|
address = external-ip;
|
|
|
|
prefixLength = 24;
|
|
|
|
}];
|
|
|
|
defaultGateway = "104.233.87.1";
|
|
|
|
nameservers = [ "8.8.8.8" ];
|
2015-09-27 15:23:54 +02:00
|
|
|
};
|
|
|
|
|
2015-11-17 22:16:55 +01:00
|
|
|
# small machine - do not forget to gc every day
|
|
|
|
nix.gc.automatic = true;
|
|
|
|
nix.gc.dates = "03:10";
|
|
|
|
|
|
|
|
environment.systemPackages = [ ];
|
2015-09-27 15:23:54 +02:00
|
|
|
}
|