config/hosts/fwminex/configuration.nix

760 lines
21 KiB
Nix
Raw Normal View History

2024-07-22 18:59:59 +00:00
{
2025-02-10 20:01:01 +00:00
lib,
2024-07-22 18:59:59 +00:00
pkgs,
2024-07-23 19:01:40 +00:00
config,
2024-08-02 11:01:04 +00:00
myData,
2024-07-22 18:59:59 +00:00
...
2024-07-29 12:39:54 +00:00
}:
let
2024-07-16 02:40:40 +00:00
nvme = "/dev/disk/by-id/nvme-Samsung_SSD_970_EVO_Plus_2TB_S6P1NS0TA01331A_1";
2024-07-29 12:39:54 +00:00
in
{
2024-04-12 19:13:34 +00:00
imports = [
2024-07-16 02:40:40 +00:00
../../modules
../../modules/profiles/btrfs
2024-04-12 19:13:34 +00:00
];
age.secrets = {
2024-08-27 05:57:17 +00:00
motiejus-server-passwd-hash.file = ../../secrets/motiejus_server_passwd_hash.age;
root-server-passwd-hash.file = ../../secrets/root_server_passwd_hash.age;
sasl-passwd.file = ../../secrets/postfix_sasl_passwd.age;
borgbackup-password.file = ../../secrets/fwminex/borgbackup-password.age;
letsencrypt-account-key.file = ../../secrets/letsencrypt/account.key.age;
vaultwarden-secrets-env.file = ../../secrets/vaultwarden/secrets.env.age;
synapse-jakstys-signing-key.file = ../../secrets/synapse/jakstys_lt_signing_key.age;
synapse-registration-shared-secret.file = ../../secrets/synapse/registration_shared_secret.age;
synapse-macaroon-secret-key.file = ../../secrets/synapse/macaroon_secret_key.age;
syncthing-key.file = ../../secrets/fwminex/syncthing/key.pem.age;
syncthing-cert.file = ../../secrets/fwminex/syncthing/cert.pem.age;
2025-03-06 19:05:55 +00:00
frigate.file = ../../secrets/frigate.age;
2025-03-07 08:04:45 +00:00
#r1-htpasswd = {
# file = ../../secrets/r1-htpasswd.age;
# owner = "nginx";
#};
ssh8022-server = {
file = ../../secrets/ssh8022.age;
owner = "spiped";
path = "/var/lib/spiped/ssh8022.key";
};
2024-08-25 08:07:35 +00:00
};
2023-11-28 20:57:58 +00:00
boot = {
2024-12-03 11:54:57 +00:00
loader.systemd-boot.enable = true;
2025-02-10 20:01:01 +00:00
kernelPackages = lib.mkForce pkgs.linuxPackages_latest;
2024-07-16 02:40:40 +00:00
initrd = {
2024-08-28 05:09:36 +00:00
systemd.enable = true;
2024-07-29 12:39:54 +00:00
kernelModules = [ "usb_storage" ];
availableKernelModules = [
"xhci_pci"
"thunderbolt"
"nvme"
"usbhid"
2025-03-05 15:06:14 +00:00
"tpm_crb"
2024-07-29 12:39:54 +00:00
];
2024-07-16 02:40:40 +00:00
luks.devices = {
luksroot = {
device = "${nvme}-part3";
allowDiscards = true;
2025-03-05 16:13:52 +00:00
keyFileOffset = 9728;
keyFileSize = 512;
keyFile = "/dev/sda";
2024-07-16 02:40:40 +00:00
};
};
2023-11-28 20:57:58 +00:00
};
};
2024-07-16 02:40:40 +00:00
swapDevices = [
{
device = "${nvme}-part2";
randomEncryption.enable = true;
}
];
2023-11-28 20:57:58 +00:00
fileSystems = {
"/" = {
2024-07-16 02:40:40 +00:00
device = "/dev/mapper/luksroot";
fsType = "btrfs";
2024-07-29 12:39:54 +00:00
options = [ "compress=zstd" ];
2023-11-28 20:57:58 +00:00
};
"/boot" = {
2024-07-16 02:40:40 +00:00
device = "${nvme}-part1";
2023-11-28 20:57:58 +00:00
fsType = "vfat";
};
2023-09-13 09:17:43 +00:00
};
2025-01-26 21:53:35 +00:00
hardware = {
cpu.intel.updateMicrocode = true;
2025-02-06 18:11:58 +00:00
coral.usb.enable = true;
2025-01-26 21:53:35 +00:00
graphics = {
enable = true;
extraPackages = [ pkgs.intel-media-driver ];
};
};
2023-09-14 09:40:16 +00:00
nixpkgs.hostPlatform = "x86_64-linux";
2024-08-03 10:30:10 +00:00
systemd = {
tmpfiles.rules = [ "d /var/www 0755 motiejus users -" ];
services = {
2024-09-13 13:29:02 +00:00
weather-exporter = {
description = "Weather exporter for Vilnius";
wantedBy = [ "multi-user.target" ];
after = [ "network.target.target" ];
path = with pkgs; [
coreutils
jq
curl
bash
];
serviceConfig = {
2024-09-15 04:36:17 +00:00
type = "simple";
2024-09-15 04:47:47 +00:00
ExecStart = "${pkgs.weather}/bin/weather -l 127.0.0.1:${toString myData.ports.exporters.weather}";
2024-09-15 05:26:49 +00:00
DynamicUser = true;
2024-09-13 13:29:02 +00:00
};
};
2025-01-24 22:15:54 +00:00
2025-01-25 23:20:24 +00:00
nginx =
let
r1 = config.mj.services.nsd-acme.zones."r1.jakstys.lt";
in
{
serviceConfig.LoadCredential = [
"r1.jakstys.lt-cert.pem:${r1.certFile}"
"r1.jakstys.lt-key.pem:${r1.keyFile}"
];
after = [ "nsd-acme-r1.jakstys.lt.service" ];
requires = [ "nsd-acme-r1.jakstys.lt.service" ];
};
2024-08-03 10:30:10 +00:00
caddy =
let
2025-01-25 22:31:12 +00:00
r1 = config.mj.services.nsd-acme.zones."r1.jakstys.lt";
2024-08-03 10:30:10 +00:00
irc = config.mj.services.nsd-acme.zones."irc.jakstys.lt";
grafana = config.mj.services.nsd-acme.zones."grafana.jakstys.lt";
bitwarden = config.mj.services.nsd-acme.zones."bitwarden.jakstys.lt";
in
{
serviceConfig = {
# 2025-02-11 blocks system from upgrading during reload
ExecReload = lib.mkForce "";
LoadCredential = [
"r1.jakstys.lt-cert.pem:${r1.certFile}"
"r1.jakstys.lt-key.pem:${r1.keyFile}"
"irc.jakstys.lt-cert.pem:${irc.certFile}"
"irc.jakstys.lt-key.pem:${irc.keyFile}"
"grafana.jakstys.lt-cert.pem:${grafana.certFile}"
"grafana.jakstys.lt-key.pem:${grafana.keyFile}"
"bitwarden.jakstys.lt-cert.pem:${bitwarden.certFile}"
"bitwarden.jakstys.lt-key.pem:${bitwarden.keyFile}"
];
};
2024-08-03 10:30:10 +00:00
after = [
2025-01-25 22:31:12 +00:00
"nsd-acme-r1.jakstys.lt.service"
2024-08-03 10:30:10 +00:00
"nsd-acme-irc.jakstys.lt.service"
"nsd-acme-grafana.jakstys.lt.service"
"nsd-acme-bitwarden.jakstys.lt.service"
];
requires = [
2025-01-25 22:31:12 +00:00
"nsd-acme-r1.jakstys.lt.service"
2024-08-03 10:30:10 +00:00
"nsd-acme-irc.jakstys.lt.service"
"nsd-acme-grafana.jakstys.lt.service"
"nsd-acme-bitwarden.jakstys.lt.service"
];
};
2024-08-03 10:54:29 +00:00
soju =
let
acme = config.mj.services.nsd-acme.zones."irc.jakstys.lt";
in
{
serviceConfig = {
RuntimeDirectory = "soju";
LoadCredential = [
"irc.jakstys.lt-cert.pem:${acme.certFile}"
"irc.jakstys.lt-key.pem:${acme.keyFile}"
];
};
preStart = ''
ln -sf $CREDENTIALS_DIRECTORY/irc.jakstys.lt-cert.pem /run/soju/cert.pem
ln -sf $CREDENTIALS_DIRECTORY/irc.jakstys.lt-key.pem /run/soju/key.pem
'';
after = [ "nsd-acme-irc.jakstys.lt.service" ];
requires = [ "nsd-acme-irc.jakstys.lt.service" ];
};
2024-08-03 10:30:10 +00:00
cert-watcher = {
description = "Restart caddy when tls keys/certs change";
wantedBy = [ "multi-user.target" ];
unitConfig = {
StartLimitIntervalSec = 10;
StartLimitBurst = 5;
};
serviceConfig = {
Type = "oneshot";
ExecStart = "${pkgs.systemd}/bin/systemctl restart caddy.service";
};
};
};
paths = {
cert-watcher = {
wantedBy = [ "multi-user.target" ];
pathConfig = {
PathChanged = [
2025-01-25 22:31:12 +00:00
config.mj.services.nsd-acme.zones."r1.jakstys.lt".certFile
2024-08-03 10:30:10 +00:00
config.mj.services.nsd-acme.zones."irc.jakstys.lt".certFile
config.mj.services.nsd-acme.zones."grafana.jakstys.lt".certFile
config.mj.services.nsd-acme.zones."bitwarden.jakstys.lt".certFile
];
Unit = "cert-watcher.service";
};
};
};
};
2023-09-14 12:26:16 +00:00
2024-07-22 18:59:59 +00:00
services = {
pcscd.enable = true;
acpid.enable = true;
fwupd.enable = true;
2024-07-23 19:04:08 +00:00
logind = {
lidSwitch = "ignore";
powerKey = "suspend";
powerKeyLongPress = "poweroff";
};
2024-08-02 11:31:24 +00:00
2024-08-03 10:54:29 +00:00
soju = {
enable = true;
listen = [
":${toString myData.ports.soju}"
"wss://:${toString myData.ports.soju-ws}"
];
tlsCertificate = "/run/soju/cert.pem";
tlsCertificateKey = "/run/soju/key.pem";
hostName = "irc.jakstys.lt";
httpOrigins = [ "*" ];
};
2024-08-02 11:31:24 +00:00
caddy = {
enable = true;
2024-08-03 10:30:10 +00:00
email = "motiejus+acme@jakstys.lt";
2024-08-02 11:31:24 +00:00
globalConfig = ''
2024-08-03 03:14:17 +00:00
servers {
metrics
}
2024-08-02 11:31:24 +00:00
'';
2024-08-03 15:00:16 +00:00
virtualHosts = {
"vpn.jakstys.lt".extraConfig = ''reverse_proxy 127.0.0.1:${toString myData.ports.headscale}'';
"hass.jakstys.lt:80".extraConfig = ''
@denied not remote_ip ${myData.subnets.tailscale.cidr}
abort @denied
reverse_proxy 127.0.0.1:${toString myData.ports.hass}
'';
"grafana.jakstys.lt".extraConfig = ''
2024-08-03 10:30:10 +00:00
@denied not remote_ip ${myData.subnets.tailscale.cidr}
abort @denied
2024-08-03 15:00:16 +00:00
reverse_proxy 127.0.0.1:${toString myData.ports.grafana}
tls {$CREDENTIALS_DIRECTORY}/grafana.jakstys.lt-cert.pem {$CREDENTIALS_DIRECTORY}/grafana.jakstys.lt-key.pem
'';
"bitwarden.jakstys.lt".extraConfig = ''
@denied not remote_ip ${myData.subnets.tailscale.cidr}
abort @denied
tls {$CREDENTIALS_DIRECTORY}/bitwarden.jakstys.lt-cert.pem {$CREDENTIALS_DIRECTORY}/bitwarden.jakstys.lt-key.pem
2024-08-03 10:30:10 +00:00
2024-08-03 15:00:16 +00:00
# from https://github.com/dani-garcia/vaultwarden/wiki/Proxy-examples
encode gzip
header {
# Enable HTTP Strict Transport Security (HSTS)
Strict-Transport-Security "max-age=31536000;"
# Enable cross-site filter (XSS) and tell browser to block detected attacks
X-XSS-Protection "1; mode=block"
# Disallow the site to be rendered within a frame (clickjacking protection)
X-Frame-Options "SAMEORIGIN"
2024-10-10 02:52:35 +00:00
Alt-Svc "h3=\":443\"; ma=86400"
2024-08-03 15:00:16 +00:00
}
2024-08-03 10:30:10 +00:00
2024-08-03 15:00:16 +00:00
reverse_proxy 127.0.0.1:${toString myData.ports.vaultwarden} {
header_up X-Real-IP {remote_host}
}
'';
"www.jakstys.lt".extraConfig = ''
redir https://jakstys.lt
'';
2025-01-25 22:31:12 +00:00
"r1.jakstys.lt".extraConfig = ''
tls {$CREDENTIALS_DIRECTORY}/r1.jakstys.lt-cert.pem {$CREDENTIALS_DIRECTORY}/r1.jakstys.lt-key.pem
redir https://r1.jakstys.lt:8443
'';
2024-08-03 15:00:16 +00:00
"irc.jakstys.lt".extraConfig =
let
gamja = pkgs.compressDrvWeb (pkgs.gamja.override {
2024-08-03 15:00:16 +00:00
gamjaConfig = {
server = {
url = "irc.jakstys.lt:6698";
nick = "motiejus";
2024-08-03 10:30:10 +00:00
};
2024-08-03 15:00:16 +00:00
};
}) { };
in
''
@denied not remote_ip ${myData.subnets.tailscale.cidr}
abort @denied
tls {$CREDENTIALS_DIRECTORY}/irc.jakstys.lt-cert.pem {$CREDENTIALS_DIRECTORY}/irc.jakstys.lt-key.pem
2024-08-03 10:30:10 +00:00
2024-08-03 15:00:16 +00:00
root * ${gamja}
2024-08-03 10:30:10 +00:00
file_server browse {
2024-08-24 15:45:51 +00:00
precompressed zstd br gzip
2024-08-03 10:30:10 +00:00
}
'';
2024-08-03 15:00:16 +00:00
"dl.jakstys.lt".extraConfig = ''
root * /var/www/dl
file_server browse {
hide .stfolder
}
encode gzip
'';
"jakstys.lt".extraConfig = ''
header {
2024-08-24 14:10:23 +00:00
Strict-Transport-Security "max-age=15768000"
Content-Security-Policy "default-src 'self'"
X-Content-Type-Options "nosniff"
X-Frame-Options "DENY"
2024-10-10 02:52:35 +00:00
Alt-Svc "h3=\":443\"; ma=86400"
2024-08-03 10:30:10 +00:00
/_/* Cache-Control "public, max-age=31536000, immutable"
}
2024-08-03 10:30:10 +00:00
2024-08-03 15:00:16 +00:00
root * /var/www/jakstys.lt
file_server {
2024-08-24 15:45:51 +00:00
precompressed zstd br gzip
2024-08-03 15:00:16 +00:00
}
2024-08-03 10:30:10 +00:00
2024-08-03 15:00:16 +00:00
handle /.well-known/carddav {
redir https://cdav.migadu.com/
}
handle /.well-known/caldav {
redir https://cdav.migadu.com/
}
2024-08-03 15:57:29 +00:00
@matrixMatch {
path /.well-known/matrix/client
path /.well-known/matrix/server
}
header @matrixMatch Content-Type application/json
header @matrixMatch Access-Control-Allow-Origin *
header @matrixMatch Cache-Control "public, max-age=3600, immutable"
handle /.well-known/matrix/client {
respond "{\"m.homeserver\": {\"base_url\": \"https://jakstys.lt\"}}" 200
}
handle /.well-known/matrix/server {
respond "{\"m.server\": \"jakstys.lt:443\"}" 200
}
handle /_matrix/* {
reverse_proxy http://127.0.0.1:${toString myData.ports.matrix-synapse}
}
2024-08-03 15:00:16 +00:00
'';
};
2024-08-02 11:31:24 +00:00
};
2024-08-02 19:33:44 +00:00
2025-03-07 08:04:45 +00:00
#nginx = {
# defaultHTTPListenPort = 8081;
# defaultSSLListenPort = 8443;
# recommendedTlsSettings = true;
# virtualHosts."r1.jakstys.lt" = {
# extraConfig = ''
# error_page 497 301 =307 https://$host:$server_port$request_uri;
# auth_basic secured;
# auth_basic_user_file ${config.age.secrets.r1-htpasswd.path};
# '';
# addSSL = true;
# sslCertificate = "/run/credentials/nginx.service/r1.jakstys.lt-cert.pem";
# sslCertificateKey = "/run/credentials/nginx.service/r1.jakstys.lt-key.pem";
# };
#};
2025-01-25 23:20:24 +00:00
2024-08-03 03:18:52 +00:00
nsd = {
enable = true;
interfaces = [
"0.0.0.0"
"::"
];
zones = {
"jakstys.lt.".data = myData.jakstysLTZone;
};
};
2024-08-02 19:33:44 +00:00
prometheus = {
2024-08-03 02:43:54 +00:00
enable = true;
2024-08-02 19:33:44 +00:00
port = myData.ports.prometheus;
retentionTime = "2y";
2024-08-02 19:33:44 +00:00
globalConfig = {
2024-08-03 02:44:59 +00:00
scrape_interval = "10s";
2024-08-02 19:33:44 +00:00
evaluation_interval = "1m";
};
scrapeConfigs =
[
2024-09-16 12:10:54 +00:00
(
let
port = toString config.services.prometheus.exporters.ping.port;
hosts = [
2025-03-08 21:47:31 +00:00
"fwminex.jakst.vpn"
"vno3-nk.jakst.vpn"
"fra1-b.jakst.vpn"
"vno1-gdrx.jakst.vpn"
2024-09-16 12:10:54 +00:00
];
in
{
job_name = "ping";
relabel_configs = map (hostname: {
source_labels = [ "__address__" ];
regex = "${myData.hosts.${hostname}.jakstIP}:${port}";
replacement = "${hostname}:${port}";
2024-09-16 12:26:01 +00:00
target_label = "instance";
2024-09-16 12:10:54 +00:00
}) hosts;
2024-09-16 12:30:22 +00:00
static_configs = [ { targets = map (host: "${myData.hosts.${host}.jakstIP}:${port}") hosts; } ];
2024-09-16 12:10:54 +00:00
}
)
2024-08-02 19:33:44 +00:00
{
job_name = "prometheus";
static_configs = [ { targets = [ "127.0.0.1:${toString myData.ports.prometheus}" ]; } ];
}
{
job_name = "caddy";
static_configs = [ { targets = [ "127.0.0.1:${toString myData.ports.exporters.caddy}" ]; } ];
}
2024-09-12 14:11:48 +00:00
{
job_name = "hass_p7_50";
scrape_interval = "1m";
2024-09-12 14:11:48 +00:00
metrics_path = "/api/prometheus";
static_configs = [ { targets = [ "127.0.0.1:${toString myData.ports.hass}" ]; } ];
}
{
job_name = "weather";
2024-09-15 05:14:58 +00:00
scrape_interval = "10m";
static_configs = [ { targets = [ "127.0.0.1:${toString myData.ports.exporters.weather}" ]; } ];
}
2024-08-02 19:33:44 +00:00
{
2025-03-08 21:47:31 +00:00
job_name = "vno1-vinc.jakst.vpn";
static_configs = [ { targets = [ "${myData.hosts."vno1-vinc.jakst.vpn".jakstIP}:9100" ]; } ];
2024-08-02 19:33:44 +00:00
}
2024-08-03 15:11:44 +00:00
]
++ map
(
let
port = builtins.toString myData.ports.exporters.node;
in
s: {
2024-08-03 15:11:44 +00:00
job_name = s;
static_configs = [ { targets = [ "${myData.hosts.${s}.jakstIP}:${port}" ]; } ];
}
)
[
2025-03-08 21:47:31 +00:00
"fra1-b.jakst.vpn"
"vno3-nk.jakst.vpn"
"fwminex.jakst.vpn"
"mtworx.jakst.vpn"
"vno1-gdrx.jakst.vpn"
];
2024-08-02 19:33:44 +00:00
};
2024-08-03 02:57:15 +00:00
2024-07-22 18:59:59 +00:00
};
2023-09-13 09:17:43 +00:00
mj = {
2024-07-16 02:40:40 +00:00
stateVersion = "24.05";
2025-03-05 20:12:03 +00:00
timeZone = "UTC";
username = "motiejus";
2023-09-13 09:17:43 +00:00
2024-07-31 06:40:05 +00:00
base = {
users = {
enable = true;
root.hashedPasswordFile = config.age.secrets.root-server-passwd-hash.path;
user.hashedPasswordFile = config.age.secrets.motiejus-server-passwd-hash.path;
};
unitstatus = {
enable = true;
email = "motiejus+alerts@jakstys.lt";
};
2023-09-13 09:17:43 +00:00
};
services = {
2024-08-02 11:31:24 +00:00
gitea.enable = true;
2024-08-03 03:33:09 +00:00
hass.enable = true;
2024-08-03 15:11:44 +00:00
syncthing-relay.enable = true;
ping_exporter.enable = true;
node_exporter = {
enable = true;
extraSubnets = [ myData.subnets.vno1.cidr ];
};
2025-02-11 20:00:40 +00:00
frigate = {
2025-03-07 08:04:45 +00:00
enable = false;
2025-03-06 19:05:55 +00:00
secretsEnv = config.age.secrets.frigate.path;
2025-02-11 20:00:40 +00:00
};
2024-09-27 12:03:43 +00:00
immich = {
2024-11-20 20:30:10 +00:00
enable = true;
2024-09-27 17:04:41 +00:00
bindPaths = {
2024-09-29 19:33:46 +00:00
"M-Camera" = "/home/motiejus/annex2/M-Camera";
2024-09-27 12:03:43 +00:00
"Pictures" = "/home/motiejus/annex2/Pictures";
};
};
2024-08-25 08:07:35 +00:00
ssh8022.server = {
enable = true;
keyfile = config.age.secrets.ssh8022-server.path;
};
2024-08-03 04:03:15 +00:00
2024-12-28 16:39:41 +00:00
borgstor = {
enable = true;
dataDir = "/var/lib/borgstor";
sshKeys = with myData; [
2025-03-08 21:47:31 +00:00
hosts."vno3-nk.jakst.vpn".publicKey
2024-12-28 16:39:41 +00:00
people_pubkeys.motiejus
];
};
2024-08-03 03:53:37 +00:00
vaultwarden = {
enable = true;
port = myData.ports.vaultwarden;
secretsEnvFile = config.age.secrets.vaultwarden-secrets-env.path;
};
2024-08-02 11:31:24 +00:00
2024-08-03 04:03:15 +00:00
minidlna = {
enable = true;
paths = [ "/home/motiejus/video" ];
};
2024-08-03 02:57:15 +00:00
grafana = {
enable = true;
port = myData.ports.grafana;
};
2023-11-14 22:29:22 +00:00
tailscale = {
enable = true;
2024-07-16 02:40:40 +00:00
verboseLogs = false;
2025-03-06 21:27:04 +00:00
acceptDNS = true;
2023-11-14 22:29:22 +00:00
};
2024-08-02 11:01:04 +00:00
headscale = {
enable = true;
subnetCIDR = myData.subnets.tailscale.cidr;
};
2024-08-03 10:30:10 +00:00
nsd-acme =
let
accountKey = config.age.secrets.letsencrypt-account-key.path;
in
{
enable = true;
zones = {
2025-01-25 22:27:50 +00:00
"r1.jakstys.lt".accountKey = accountKey;
2024-08-03 10:30:10 +00:00
"irc.jakstys.lt".accountKey = accountKey;
"grafana.jakstys.lt".accountKey = accountKey;
"bitwarden.jakstys.lt".accountKey = accountKey;
};
};
2024-07-31 06:40:05 +00:00
btrfsborg = {
enable = true;
passwordPath = config.age.secrets.borgbackup-password.path;
sshKeyPath = "/etc/ssh/ssh_host_ed25519_key";
2024-12-01 21:05:41 +00:00
dirs =
builtins.concatMap
(
host:
let
prefix = "${host}:${config.networking.hostName}.${config.networking.domain}";
in
[
{
subvolume = "/var/lib";
repo = "${prefix}-var_lib";
paths = [
"hass"
"gitea"
"caddy"
"grafana"
"headscale"
"bitwarden_rs"
"matrix-synapse"
"private/soju"
2025-02-19 20:01:34 +00:00
"private/timelapse-r11"
2024-12-01 21:05:41 +00:00
# https://immich.app/docs/administration/backup-and-restore/
"immich/library"
"immich/upload"
"immich/profile"
"postgresql"
];
patterns = [ "- gitea/data/repo-archive/" ];
backup_at = "*-*-* 01:00:01 UTC";
}
{
subvolume = "/home";
repo = "${prefix}-home-motiejus-annex2";
paths = [ "motiejus/annex2" ];
backup_at = "*-*-* 02:30:01 UTC";
}
]
)
[
"zh2769@zh2769.rsync.net"
2025-03-08 21:47:31 +00:00
"borgstor@${myData.hosts."vno3-nk.jakst.vpn".jakstIP}"
2024-12-01 21:05:41 +00:00
];
2024-07-31 06:40:05 +00:00
};
2024-07-29 13:44:35 +00:00
btrfssnapshot = {
enable = true;
subvolumes = [
2024-07-29 14:00:55 +00:00
{
subvolume = "/home";
label = "hourly";
keep = 24;
refreshInterval = "*:00:00";
}
{
subvolume = "/home";
label = "nightly";
keep = 7;
refreshInterval = "daily UTC";
}
2024-07-29 13:44:35 +00:00
{
subvolume = "/var/lib";
label = "hourly";
keep = 24;
refreshInterval = "*:00:00";
}
];
};
2024-07-30 19:46:29 +00:00
syncthing = {
enable = true;
dataDir = "/home/motiejus/";
user = "motiejus";
group = "users";
};
2024-08-03 15:57:29 +00:00
matrix-synapse = {
enable = true;
signingKeyPath = config.age.secrets.synapse-jakstys-signing-key.path;
registrationSharedSecretPath = config.age.secrets.synapse-registration-shared-secret.path;
macaroonSecretKeyPath = config.age.secrets.synapse-macaroon-secret-key.path;
};
2024-07-29 12:39:54 +00:00
remote-builder.client =
let
2025-03-08 21:47:31 +00:00
host = myData.hosts."fra1-b.jakst.vpn";
2024-07-29 12:39:54 +00:00
in
{
enable = true;
inherit (host) system supportedFeatures;
hostName = host.jakstIP;
sshKey = "/etc/ssh/ssh_host_ed25519_key";
};
2024-07-16 02:40:40 +00:00
2023-09-13 09:17:43 +00:00
deployerbot = {
main = {
enable = true;
uidgid = myData.uidgid.updaterbot-deployer;
repo = "git@git.jakstys.lt:motiejus/config";
deployDerivations = [
".#fwminex"
2024-07-30 21:23:44 +00:00
".#fra1-b"
".#vno3-nk"
];
deployIfPresent = [
{
derivationTarget = ".#mtworx";
2025-03-08 21:47:31 +00:00
pingTarget = myData.hosts."mtworx.jakst.vpn".jakstIP;
}
2024-08-05 13:41:24 +00:00
{
derivationTarget = ".#vno1-gdrx";
2025-03-08 21:47:31 +00:00
pingTarget = myData.hosts."vno1-gdrx.jakst.vpn".jakstIP;
2024-08-05 13:41:24 +00:00
}
];
};
2023-09-13 09:17:43 +00:00
follower = {
2025-03-08 21:47:31 +00:00
publicKeys = [ myData.hosts."fwminex.jakst.vpn".publicKey ];
2023-10-01 20:14:05 +00:00
2023-09-13 09:17:43 +00:00
enable = true;
uidgid = myData.uidgid.updaterbot-deployee;
2024-07-29 12:39:54 +00:00
sshAllowSubnets = with myData.subnets; [ tailscale.sshPattern ];
2023-09-13 09:17:43 +00:00
};
};
2024-07-23 19:01:40 +00:00
postfix = {
enable = true;
saslPasswdPath = config.age.secrets.sasl-passwd.path;
};
2024-08-02 19:33:44 +00:00
friendlyport.ports = [
{
subnets = [ myData.subnets.tailscale.cidr ];
2024-10-10 02:23:28 +00:00
udp = [ 443 ];
2024-08-02 19:33:44 +00:00
tcp = with myData.ports; [
80
443
2024-08-03 10:54:29 +00:00
soju
2025-02-11 20:00:40 +00:00
frigate
2024-08-03 10:54:29 +00:00
soju-ws
2024-08-02 19:33:44 +00:00
prometheus
];
}
];
2024-12-01 16:31:56 +00:00
2023-09-13 09:17:43 +00:00
};
};
2024-07-22 18:59:59 +00:00
environment = {
2025-02-12 15:55:19 +00:00
enableDebugInfo = true;
2024-07-22 18:59:59 +00:00
systemPackages = with pkgs; [
2024-07-28 18:43:19 +00:00
acpi
2024-08-03 03:18:52 +00:00
yt-dlp
ffmpeg
2025-02-10 21:13:08 +00:00
inferno
2024-08-07 14:30:19 +00:00
rtorrent
2025-03-05 15:22:28 +00:00
tpm2-tools
2024-07-22 18:59:59 +00:00
age-plugin-yubikey
2025-02-12 15:55:19 +00:00
(python3.withPackages (
ps: with ps; [
ipython
]
))
2024-07-22 18:59:59 +00:00
];
};
2023-09-13 09:17:43 +00:00
networking = {
2024-07-16 02:40:40 +00:00
hostId = "a6b19da0";
2023-09-13 09:17:43 +00:00
hostName = "fwminex";
2025-03-08 21:47:31 +00:00
domain = "jakst.vpn";
2024-08-02 11:47:01 +00:00
firewall = {
rejectPackets = true;
allowedUDPPorts = [
53
80
443
2025-01-25 23:20:24 +00:00
8443
2024-08-02 11:47:01 +00:00
];
allowedTCPPorts = [
53
80
443
2025-01-25 23:20:24 +00:00
8443
2024-08-02 11:47:01 +00:00
];
};
2023-09-13 09:17:43 +00:00
};
}