2021-05-29 18:05:31 +02:00
|
|
|
{ config, pkgs, lib, ... }: {
|
|
|
|
imports = [
|
2020-05-21 17:39:38 +02:00
|
|
|
../physical/fractal.nix
|
|
|
|
../roles/server.nix
|
|
|
|
../roles/homeserver.nix
|
|
|
|
../services/torrent-wg.nix
|
2018-03-11 18:28:25 +01:00
|
|
|
];
|
2016-01-28 02:59:31 +01:00
|
|
|
|
2021-01-03 18:59:55 +01:00
|
|
|
deployment.keyys = [ ../keys/grafana.env ];
|
|
|
|
|
2016-01-28 02:59:31 +01:00
|
|
|
system.stateVersion = "15.09";
|
2020-05-21 17:39:38 +02:00
|
|
|
networking.hostId = "0702dbe9";
|
2016-01-28 02:59:31 +01:00
|
|
|
|
2021-01-03 20:57:27 +01:00
|
|
|
services.nginx.enable = false;
|
|
|
|
# services.nginx.virtualHosts."${config.networking.hostName}" = {
|
|
|
|
# enableACME = lib.mkForce false;
|
|
|
|
# forceSSL = lib.mkForce false;
|
|
|
|
# default = true;
|
|
|
|
# };
|
2020-05-21 17:39:38 +02:00
|
|
|
boot.supportedFilesystems = [ "zfs" ];
|
|
|
|
services.yorick.torrent-vpn = {
|
2021-05-29 18:05:31 +02:00
|
|
|
enable = true;
|
|
|
|
name = "mullvad-nl4";
|
|
|
|
namespace = "torrent";
|
2020-05-21 17:39:38 +02:00
|
|
|
};
|
|
|
|
services.plex = {
|
|
|
|
enable = true;
|
|
|
|
openFirewall = true;
|
|
|
|
};
|
|
|
|
services.victoriametrics = {
|
|
|
|
enable = true;
|
|
|
|
retentionPeriod = 12;
|
|
|
|
};
|
|
|
|
services.prometheus = {
|
|
|
|
enable = true;
|
2021-05-29 18:05:31 +02:00
|
|
|
extraFlags = [ "--web.enable-admin-api" ];
|
2020-05-21 17:39:38 +02:00
|
|
|
# victoriametrics
|
2021-05-29 18:05:31 +02:00
|
|
|
remoteWrite = [{ url = "http://127.0.0.1:8428/api/v1/write"; }];
|
|
|
|
scrapeConfigs = [
|
|
|
|
{
|
|
|
|
job_name = "smartmeter";
|
|
|
|
# prometheus doesn't support mdns :thinking_face:
|
|
|
|
static_configs = [{ targets = [ "192.168.178.30" ]; }];
|
|
|
|
scrape_interval = "10s";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
job_name = "node";
|
|
|
|
static_configs = [{ targets = [ "localhost:9100" ]; }];
|
|
|
|
# } {
|
|
|
|
# job_name = "unifi";
|
|
|
|
# static_configs = [ { targets = [ "localhost:9130" ]; } ];
|
|
|
|
}
|
|
|
|
{
|
|
|
|
job_name = "thermometer";
|
|
|
|
static_configs = [{ targets = [ "192.168.178.21:8000" ]; }];
|
|
|
|
}
|
2021-08-08 17:23:50 +02:00
|
|
|
{
|
|
|
|
job_name = "esphome";
|
|
|
|
static_configs = [{ targets = [ "192.168.178.77" ]; }];
|
|
|
|
}
|
2021-05-29 18:05:31 +02:00
|
|
|
];
|
2020-05-21 17:39:38 +02:00
|
|
|
exporters.node.enable = true;
|
|
|
|
# exporters.unifi = {
|
|
|
|
# enable = true;
|
|
|
|
# unifiAddress = "https://woodhouse.home.yori.cc:8443";
|
|
|
|
# unifiInsecure = true;
|
|
|
|
# unifiUsername = "ReadOnlyUser";
|
|
|
|
# unifiPassword = "ReadOnlyPassword";
|
|
|
|
# };
|
|
|
|
};
|
2021-01-03 16:40:27 +01:00
|
|
|
boot.zfs.requestEncryptionCredentials = false;
|
2020-05-21 17:39:38 +02:00
|
|
|
networking.firewall.interfaces.wg-y.allowedTCPPorts = [ 3000 9090 ];
|
|
|
|
networking.firewall.allowedTCPPorts = [ 1883 ];
|
|
|
|
networking.firewall.allowedUDPPorts = [ 1883 ];
|
|
|
|
services.rabbitmq = {
|
|
|
|
enable = true;
|
|
|
|
plugins = [ "rabbitmq_mqtt" "rabbitmq_management" ];
|
|
|
|
};
|
|
|
|
services.grafana = {
|
|
|
|
enable = true;
|
|
|
|
addr = "0.0.0.0";
|
|
|
|
domain = "grafana.yori.cc";
|
2021-01-03 18:59:55 +01:00
|
|
|
rootUrl = "https://grafana.yori.cc/";
|
|
|
|
extraOptions = {
|
|
|
|
AUTH_BASIC_ENABLED = "false";
|
|
|
|
AUTH_DISABLE_LOGIN_FORM = "true";
|
|
|
|
AUTH_GOOGLE_ENABLED = "true";
|
|
|
|
AUTH_GOOGLE_ALLOW_SIGN_UP = "false";
|
|
|
|
};
|
2018-03-11 18:28:25 +01:00
|
|
|
};
|
2021-05-29 18:05:31 +02:00
|
|
|
systemd.services.grafana.serviceConfig.EnvironmentFile =
|
|
|
|
"/root/keys/grafana.env";
|
2021-01-03 19:00:09 +01:00
|
|
|
services.zfs = {
|
|
|
|
trim.enable = false; # no ssd's
|
|
|
|
autoScrub = {
|
|
|
|
enable = true;
|
|
|
|
interval = "*-*-01 02:00:00"; # monthly + 2 hours
|
|
|
|
};
|
|
|
|
};
|
2021-10-18 14:42:53 +02:00
|
|
|
users.users.plex.packages = with pkgs; [
|
|
|
|
ffmpeg
|
|
|
|
];
|
2021-06-07 09:00:31 +02:00
|
|
|
users.users.yorick.packages = with pkgs; [
|
|
|
|
borgbackup
|
|
|
|
bup
|
|
|
|
fzf
|
|
|
|
git-annex
|
|
|
|
magic-wormhole
|
2021-10-18 14:42:53 +02:00
|
|
|
python3
|
2021-06-07 09:00:31 +02:00
|
|
|
ranger
|
2021-10-18 14:42:53 +02:00
|
|
|
pyroscope
|
2021-06-07 09:00:31 +02:00
|
|
|
rtorrent
|
|
|
|
];
|
2018-03-11 18:28:25 +01:00
|
|
|
}
|