Compare commits

..

No commits in common. "4bd78856e7b4bc63ca281b21ea03de2e9385b742" and "e12564358d56ffcb4d8c17fc7750a8fcf3ed34e3" have entirely different histories.

12 changed files with 40 additions and 195 deletions

View file

@ -15,7 +15,6 @@
matchBlocks."viridian" = { matchBlocks."viridian" = {
hostname = "192.168.1.102"; hostname = "192.168.1.102";
identityFile = "/home/sajenim/.ssh/sajenim_sk"; identityFile = "/home/sajenim/.ssh/sajenim_sk";
port = 62841;
}; };
}; };
} }

View file

@ -6,9 +6,7 @@
settings = { settings = {
PermitRootLogin = "no"; PermitRootLogin = "no";
PasswordAuthentication = false; PasswordAuthentication = false;
AllowUsers = [ "sajenim" ];
}; };
ports = [ 62841 ];
openFirewall = true; openFirewall = true;
}; };
} }

View file

@ -6,12 +6,8 @@
./minecraft ./minecraft
./borgbackup.nix ./borgbackup.nix
./forgejo.nix ./forgejo.nix
./lighttpd.nix ./httpd.nix
./mpd.nix ./mpd.nix
./samba.nix ./samba.nix
./grafana.nix
./mysql.nix
./prometheus.nix
./endlessh-go.nix
]; ];
} }

View file

@ -1,30 +0,0 @@
{ config, ... }:
{
services.endlessh-go = {
enable = true;
port = 22; # SSH port
prometheus = {
enable = true;
listenAddress = "127.0.0.1";
port = 2112; # Prometheus metrics port
};
extraOptions = [
"-interval_ms=1000"
"-logtostderr"
"-v=1"
"-geoip_supplier=ip-api"
];
openFirewall = true;
};
services.prometheus.scrapeConfigs = [
{
job_name = "endlessh";
static_configs = [{
targets = [ "127.0.0.1:${toString config.services.endlessh-go.prometheus.port}" ];
}];
}
];
}

View file

@ -1,4 +1,4 @@
{ config, ... }: { ... }:
{ {
services.forgejo = { services.forgejo = {
@ -33,7 +33,7 @@
services.traefik.dynamicConfigOptions.http.services = { services.traefik.dynamicConfigOptions.http.services = {
forgejo.loadBalancer.servers = [ forgejo.loadBalancer.servers = [
{ url = "http://127.0.0.1:${toString config.services.forgejo.settings.server.HTTP_PORT}"; } { url = "http://127.0.0.1:3131"; }
]; ];
}; };
} }

View file

@ -1,56 +0,0 @@
{ config, ... }:
{
# Setup grafana our grafana instance.
services.grafana = {
enable = true;
dataDir = "/srv/services/grafana";
settings = {
server = {
http_addr = "127.0.0.1";
http_port = 3400;
domain = "kanto.dev";
root_url = "https://kanto.dev/grafana/";
serve_from_sub_path = true;
};
database = {
type = "mysql";
name = "grafana";
user = "grafana";
host = "/var/run/mysqld/mysqld.sock";
};
};
};
# Setup our database for grafana.
services.mysql = {
ensureUsers = [{
name = "grafana";
ensurePermissions = {
"grafana.*" = "ALL PRIVILEGES";
};
}];
ensureDatabases = [ "grafana" ];
};
# Setup our traefik router.
services.traefik.dynamicConfigOptions.http.routers = {
grafana = {
rule = "Host(`kanto.dev`)";
entryPoints = [
"websecure"
];
middlewares = [
"admin"
];
service = "grafana";
};
};
# Setup our traefik service.
services.traefik.dynamicConfigOptions.http.services = {
grafana.loadBalancer.servers = [
{ url = "http://127.0.0.1:${toString config.services.grafana.settings.server.http_port}"; }
];
};
}

View file

@ -0,0 +1,35 @@
{ ... }:
{
services.httpd = {
enable = true;
virtualHosts."sajenim.dev" = {
documentRoot = "/srv/services/httpd/sajenim.dev";
listen = [{
ip = "192.168.1.102";
port = 5624;
}];
adminAddr = "its.jassy@pm.me";
};
};
services.traefik.dynamicConfigOptions.http.routers = {
httpd = {
rule = "Host(`sajenim.dev`)";
entryPoints = [
"websecure"
];
middlewares = [
"geoblock"
];
service = "httpd";
};
};
services.traefik.dynamicConfigOptions.http.services = {
httpd.loadBalancer.servers = [
{ url = "http://127.0.0.1:5624"; }
];
};
}

View file

@ -1,29 +0,0 @@
{ config, ... }:
{
services.lighttpd = {
enable = true;
port = 5624;
document-root = "/srv/services/websites/sajenim.dev";
};
services.traefik.dynamicConfigOptions.http.routers = {
lighttpd = {
rule = "Host(`sajenim.dev`)";
entryPoints = [
"websecure"
];
middlewares = [
"geoblock"
];
service = "lighttpd";
};
};
services.traefik.dynamicConfigOptions.http.services = {
lighttpd.loadBalancer.servers = [
{ url = "http://127.0.0.1:${toString config.services.lighttpd.port}"; }
];
};
}

View file

@ -1,4 +1,4 @@
{ inputs, pkgs, lib, config, ... }: { inputs, pkgs, lib, ... }:
let let
modpack = pkgs.fetchPackwizModpack rec { modpack = pkgs.fetchPackwizModpack rec {
version = "c9087bf"; version = "c9087bf";
@ -90,7 +90,7 @@ in
services.traefik.dynamicConfigOptions.http.services = { services.traefik.dynamicConfigOptions.http.services = {
minecraft.loadBalancer.servers = [ minecraft.loadBalancer.servers = [
{ url = "http://127.0.0.1:${toString config.services.minecraft-servers.servers.kanto.serverProperties.server-port}"; } { url = "http://127.0.0.1:25565"; }
]; ];
}; };
} }

View file

@ -1,10 +0,0 @@
{ pkgs, ... }:
{
services.mysql = {
enable = true;
package = pkgs.mariadb;
dataDir = "/srv/services/mysql";
};
}

View file

@ -1,33 +0,0 @@
{ config, ... }:
{
services.prometheus = {
enable = true;
port = 9001; # Port to listen on.
# Valid in all configuration contexts, defaults for other configuration sections.
globalConfig = {
scrape_interval = "15s";
};
# Collect specific metrics, format them, and expose them through HTTP endpoints for prometheus to scrape.
exporters = {
node = {
enable = true;
enabledCollectors = [ "systemd" "processes" ];
port = 9100;
};
};
# Specify a set of targets and parameters describing how to scrape them.
scrapeConfigs = [
{
job_name = "node";
static_configs = [{
targets = [ "127.0.0.1:${toString config.services.prometheus.exporters.node.port}" ];
}];
}
];
};
}

View file

@ -89,21 +89,6 @@
]; ];
}; };
}; };
# Used to expose metrics
metrics = {
address = ":8082";
};
};
# Provide metrics for the prometheus backend
metrics = {
prometheus = {
entryPoint = "metrics";
buckets = [ "0.1" "0.3" "1.2" "5.0" ];
addEntryPointsLabels = true;
addRoutersLabels = true;
addServicesLabels = true;
};
}; };
# Retrieve certificates from an ACME server # Retrieve certificates from an ACME server
@ -133,16 +118,6 @@
}; };
}; };
# Scrape our traefik metrics
services.prometheus.scrapeConfigs = [
{
job_name = "traefik";
static_configs = [{
targets = [ "127.0.0.1:8082" ];
}];
}
];
# Persist our traefik data & logs # Persist our traefik data & logs
environment.persistence."/persist" = { environment.persistence."/persist" = {
directories = [ directories = [