2018-04-10 20:28:22 +02:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
domaine = "tars.nyanlout.re";
|
|
|
|
in
|
2018-04-01 15:04:49 +02:00
|
|
|
|
|
|
|
{
|
2018-04-11 22:09:44 +02:00
|
|
|
imports = [
|
2018-04-12 20:36:46 +02:00
|
|
|
./haproxy-acme.nix
|
2018-04-11 22:09:44 +02:00
|
|
|
./mail-server.nix
|
|
|
|
];
|
|
|
|
|
2018-04-12 20:36:46 +02:00
|
|
|
services.haproxy-acme.enable = true;
|
|
|
|
services.haproxy-acme.domaine = domaine;
|
|
|
|
services.haproxy-acme.services = {
|
|
|
|
grafana = { ip = "127.0.0.1"; port = 3000; auth = false; };
|
|
|
|
emby = { ip = "127.0.0.1"; port = 8096; auth = false; };
|
|
|
|
radarr = { ip = "127.0.0.1"; port = 7878; auth = false; };
|
|
|
|
sonarr = { ip = "127.0.0.1"; port = 8989; auth = false; };
|
|
|
|
transmission = { ip = "127.0.0.1"; port = 9091; auth = true; };
|
|
|
|
syncthing = { ip = "127.0.0.1"; port = 8384; auth = true; };
|
2018-04-03 21:13:18 +02:00
|
|
|
};
|
|
|
|
|
2018-04-12 20:36:46 +02:00
|
|
|
services.mailserver.enable = true;
|
|
|
|
services.mailserver.domaine = domaine;
|
2018-04-03 21:13:18 +02:00
|
|
|
|
2018-04-01 15:04:49 +02:00
|
|
|
services.influxdb.enable = true;
|
2018-04-03 08:47:49 +02:00
|
|
|
services.influxdb.dataDir = "/var/db/influxdb";
|
2018-04-01 15:04:49 +02:00
|
|
|
|
|
|
|
services.telegraf.enable = true;
|
|
|
|
services.telegraf.extraConfig = {
|
|
|
|
inputs = {
|
|
|
|
zfs = { poolMetrics = true; };
|
|
|
|
net = { interfaces = [ "eno1" "eno2" "eno3" "eno4" ]; };
|
|
|
|
netstat = {};
|
|
|
|
cpu = { totalcpu = true; };
|
|
|
|
kernel = {};
|
|
|
|
mem = {};
|
|
|
|
processes = {};
|
|
|
|
system = {};
|
2018-04-10 20:35:33 +02:00
|
|
|
disk = {};
|
2018-04-10 16:53:13 +02:00
|
|
|
ipmi_sensor = { path = "${pkgs.ipmitool}/bin/ipmitool"; };
|
2018-04-01 15:04:49 +02:00
|
|
|
};
|
|
|
|
outputs = {
|
|
|
|
influxdb = { database = "telegraf"; urls = [ "http://localhost:8086" ]; };
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2018-04-10 16:53:13 +02:00
|
|
|
services.udev.extraRules = ''
|
|
|
|
KERNEL=="ipmi*", MODE="660", OWNER="telegraf"
|
|
|
|
'';
|
|
|
|
|
2018-04-01 15:04:49 +02:00
|
|
|
services.grafana.enable = true;
|
2018-04-03 22:25:49 +02:00
|
|
|
services.grafana.addr = "127.0.0.1";
|
2018-04-03 08:47:49 +02:00
|
|
|
services.grafana.dataDir = "/var/lib/grafana";
|
2018-04-01 15:17:44 +02:00
|
|
|
|
|
|
|
services.emby.enable = true;
|
2018-04-03 08:47:49 +02:00
|
|
|
services.emby.dataDir = "/var/lib/emby/ProgramData-Server";
|
2018-04-01 15:17:44 +02:00
|
|
|
|
2018-04-03 19:21:26 +02:00
|
|
|
services.slimserver.enable = true;
|
|
|
|
services.slimserver.dataDir = "/var/lib/slimserver";
|
|
|
|
|
2018-04-03 08:47:49 +02:00
|
|
|
services.syncthing.enable = true;
|
|
|
|
services.syncthing.dataDir = "/var/lib/syncthing";
|
|
|
|
services.syncthing.openDefaultPorts = true;
|
|
|
|
|
2018-04-12 00:11:51 +02:00
|
|
|
# services.nfs.server = {
|
|
|
|
# enable = true;
|
|
|
|
# exports = ''
|
|
|
|
# /exports/steam 192.168.1.0/24(rw,no_root_squash)
|
|
|
|
# '';
|
|
|
|
# statdPort = 4000;
|
|
|
|
# lockdPort = 4001;
|
|
|
|
# mountdPort = 4002;
|
|
|
|
# };
|
2018-04-03 18:55:07 +02:00
|
|
|
|
2018-04-03 23:22:44 +02:00
|
|
|
services.transmission.enable = true;
|
|
|
|
services.transmission.home = "/var/lib/transmission";
|
|
|
|
services.transmission.settings = {
|
2018-04-03 23:54:27 +02:00
|
|
|
rpc-bind-address = "127.0.0.1";
|
|
|
|
rpc-host-whitelist = "*";
|
2018-04-03 23:22:44 +02:00
|
|
|
rpc-whitelist-enabled = false;
|
|
|
|
};
|
|
|
|
|
2018-04-03 23:09:51 +02:00
|
|
|
services.radarr.enable = true;
|
|
|
|
|
2018-04-11 22:09:29 +02:00
|
|
|
services.sonarr.enable = true;
|
|
|
|
|
2018-04-04 00:09:14 +02:00
|
|
|
services.murmur.enable = true;
|
|
|
|
services.murmur.bandwidth = 128000;
|
|
|
|
services.murmur.imgMsgLength = 0;
|
|
|
|
services.murmur.textMsgLength = 0;
|
|
|
|
|
2018-04-01 15:17:44 +02:00
|
|
|
networking.firewall.allowedTCPPorts = [
|
2018-04-03 21:13:18 +02:00
|
|
|
80 443 # HAProxy
|
2018-04-12 00:11:51 +02:00
|
|
|
# 111 2049 4000 4001 4002 # NFS
|
2018-04-12 09:08:45 +02:00
|
|
|
3483 9000 9090 # Slimserver
|
2018-04-04 22:15:27 +02:00
|
|
|
51413 # Transmission
|
2018-04-03 18:55:07 +02:00
|
|
|
];
|
|
|
|
networking.firewall.allowedUDPPorts = [
|
2018-04-12 00:11:51 +02:00
|
|
|
# 111 2049 4000 4001 4002 # NFS
|
2018-04-03 20:17:09 +02:00
|
|
|
3483 # Slimserver
|
2018-04-04 22:15:27 +02:00
|
|
|
51413 # Transmission
|
2018-04-01 15:17:44 +02:00
|
|
|
];
|
2018-04-01 15:04:49 +02:00
|
|
|
}
|