mirror of
https://github.com/kmein/niveum
synced 2026-03-19 11:31:09 +01:00
chore: format with alejandra
This commit is contained in:
@@ -1,8 +1,11 @@
|
||||
{ lib, config, pkgs, ... }:
|
||||
let
|
||||
inherit (import <niveum/lib>) kieran retiolumAddresses restic;
|
||||
in
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (import <niveum/lib>) kieran retiolumAddresses restic;
|
||||
in {
|
||||
imports = [
|
||||
./gitea.nix
|
||||
./hardware-configuration.nix
|
||||
@@ -33,7 +36,10 @@ in
|
||||
services.restic.backups.niveum = {
|
||||
initialize = true;
|
||||
inherit (restic) repository;
|
||||
timerConfig = { OnCalendar = "daily"; RandomizedDelaySec = "1h"; };
|
||||
timerConfig = {
|
||||
OnCalendar = "daily";
|
||||
RandomizedDelaySec = "1h";
|
||||
};
|
||||
passwordFile = toString <secrets/restic/password>;
|
||||
paths = [
|
||||
"/var/lib/codimd"
|
||||
@@ -46,10 +52,10 @@ in
|
||||
];
|
||||
};
|
||||
|
||||
nix.nixPath = [ "/var/src" ];
|
||||
nix.nixPath = ["/var/src"];
|
||||
|
||||
networking = {
|
||||
firewall.allowedTCPPorts = [ 80 443 ];
|
||||
firewall.allowedTCPPorts = [80 443];
|
||||
hostName = "makanek";
|
||||
interfaces.ens3.useDHCP = true;
|
||||
retiolum = retiolumAddresses.makanek;
|
||||
@@ -72,5 +78,5 @@ in
|
||||
email = kieran.email;
|
||||
};
|
||||
|
||||
environment.systemPackages = [ pkgs.vim pkgs.git pkgs.tmux pkgs.python3 ];
|
||||
environment.systemPackages = [pkgs.vim pkgs.git pkgs.tmux pkgs.python3];
|
||||
}
|
||||
|
||||
@@ -1,18 +1,22 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
{
|
||||
imports = [ <nixpkgs/nixos/modules/profiles/qemu-guest.nix> ];
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
imports = [<nixpkgs/nixos/modules/profiles/qemu-guest.nix>];
|
||||
|
||||
boot = {
|
||||
initrd = {
|
||||
availableKernelModules = [ "ata_piix" "virtio_pci" "xhci_pci" "sd_mod" "sr_mod" ];
|
||||
kernelModules = [ ];
|
||||
availableKernelModules = ["ata_piix" "virtio_pci" "xhci_pci" "sd_mod" "sr_mod"];
|
||||
kernelModules = [];
|
||||
};
|
||||
kernelModules = [ ];
|
||||
extraModulePackages = [ ];
|
||||
kernelModules = [];
|
||||
extraModulePackages = [];
|
||||
loader.grub = {
|
||||
enable = true;
|
||||
version = 2;
|
||||
devices = [ "/dev/sda" ];
|
||||
devices = ["/dev/sda"];
|
||||
};
|
||||
};
|
||||
|
||||
@@ -21,7 +25,7 @@
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
swapDevices = [ ];
|
||||
swapDevices = [];
|
||||
zramSwap.enable = true;
|
||||
|
||||
nix.maxJobs = lib.mkDefault 2;
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
{ config, pkgs, ... }:
|
||||
let
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
backupLocation = "/var/lib/codimd-backup";
|
||||
stateLocation = "/var/lib/codimd/state.sqlite";
|
||||
nixpkgs-unstable = import <nixpkgs-unstable> {};
|
||||
domain = "pad.kmein.de";
|
||||
in
|
||||
{
|
||||
imports = [ <stockholm/krebs/3modules/permown.nix> ];
|
||||
in {
|
||||
imports = [<stockholm/krebs/3modules/permown.nix>];
|
||||
|
||||
services.nginx.virtualHosts.${domain} = {
|
||||
enableACME = true;
|
||||
@@ -18,7 +20,7 @@ in
|
||||
};
|
||||
|
||||
security.acme.certs.${domain}.group = "hedgecert";
|
||||
users.groups.hedgecert.members = [ "codimd" "nginx" ];
|
||||
users.groups.hedgecert.members = ["codimd" "nginx"];
|
||||
|
||||
security.dhparams = {
|
||||
enable = true;
|
||||
@@ -28,7 +30,7 @@ in
|
||||
services.hedgedoc = {
|
||||
enable = true;
|
||||
configuration = {
|
||||
allowOrigin = [ domain ];
|
||||
allowOrigin = [domain];
|
||||
allowAnonymous = true;
|
||||
allowGravatar = false;
|
||||
allowFreeURL = true;
|
||||
@@ -40,35 +42,41 @@ in
|
||||
domain = domain;
|
||||
useSSL = true;
|
||||
protocolUseSSL = true;
|
||||
sslCAPath = [ "/etc/ssl/certs/ca-certificates.crt" ];
|
||||
sslCAPath = ["/etc/ssl/certs/ca-certificates.crt"];
|
||||
sslCertPath = "/var/lib/acme/${domain}/cert.pem";
|
||||
sslKeyPath = "/var/lib/acme/${domain}/key.pem";
|
||||
dhParamPath = config.security.dhparams.params.hedgedoc.path;
|
||||
};
|
||||
};
|
||||
|
||||
krebs.permown.${backupLocation} = { owner = "codimd"; group = "codimd"; umask = "0002"; };
|
||||
krebs.permown.${backupLocation} = {
|
||||
owner = "codimd";
|
||||
group = "codimd";
|
||||
umask = "0002";
|
||||
};
|
||||
|
||||
systemd.services.hedgedoc-backup = {
|
||||
description = "Hedgedoc backup service";
|
||||
script = ''
|
||||
${nixpkgs-unstable.sqlite}/bin/sqlite3 -json ${stateLocation} "select shortid, alias, ownerId, content from Notes" \
|
||||
| ${pkgs.writers.writePython3 "hedgedoc-json-to-fs.py" {} ''
|
||||
import json
|
||||
import pathlib
|
||||
import sys
|
||||
| ${
|
||||
pkgs.writers.writePython3 "hedgedoc-json-to-fs.py" {} ''
|
||||
import json
|
||||
import pathlib
|
||||
import sys
|
||||
|
||||
for note in json.load(sys.stdin):
|
||||
user_directory = pathlib.Path()
|
||||
if note["ownerId"]:
|
||||
user_directory = pathlib.Path(note["ownerId"])
|
||||
user_directory.mkdir(exist_ok=True)
|
||||
file_path = user_directory / (
|
||||
(note["alias"] if note["alias"] else note["shortid"]) + ".md"
|
||||
)
|
||||
file_path.write_text(note["content"])
|
||||
print(f"✔ {file_path}", file=sys.stderr)
|
||||
''}
|
||||
for note in json.load(sys.stdin):
|
||||
user_directory = pathlib.Path()
|
||||
if note["ownerId"]:
|
||||
user_directory = pathlib.Path(note["ownerId"])
|
||||
user_directory.mkdir(exist_ok=True)
|
||||
file_path = user_directory / (
|
||||
(note["alias"] if note["alias"] else note["shortid"]) + ".md"
|
||||
)
|
||||
file_path.write_text(note["content"])
|
||||
print(f"✔ {file_path}", file=sys.stderr)
|
||||
''
|
||||
}
|
||||
'';
|
||||
startAt = "hourly";
|
||||
serviceConfig = {
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
{ pkgs, lib, ... }:
|
||||
let
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
port = 5040;
|
||||
punkt = pkgs.fetchzip {
|
||||
url = "https://raw.githubusercontent.com/nltk/nltk_data/gh-pages/packages/tokenizers/punkt.zip";
|
||||
@@ -11,17 +14,19 @@ let
|
||||
hash = "sha256-KBAbCvayTEr4+cOHnMXHCBA+8RWDMiQF65xzP4fOdaE=";
|
||||
};
|
||||
horoscopy = import horoscopy-src;
|
||||
in
|
||||
{
|
||||
in {
|
||||
systemd.services.horoscopy = {
|
||||
wants = [ "network-online.target" ];
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
wants = ["network-online.target"];
|
||||
wantedBy = ["multi-user.target"];
|
||||
description = "AI astrologer";
|
||||
serviceConfig = {
|
||||
DynamicUser = true;
|
||||
};
|
||||
environment.NLTK_DATA = pkgs.linkFarm "punkt-tokenizers" [
|
||||
{ name = "tokenizers/punkt"; path = punkt; }
|
||||
{
|
||||
name = "tokenizers/punkt";
|
||||
path = punkt;
|
||||
}
|
||||
];
|
||||
script = ''
|
||||
cd ${horoscopy-src}
|
||||
|
||||
@@ -1,45 +1,53 @@
|
||||
{ pkgs, lib, ... }:
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
services.matterbridge = {
|
||||
enable = true;
|
||||
configPath =
|
||||
let bridgeBotToken = lib.strings.fileContents <system-secrets/telegram/kmein.token>;
|
||||
in toString ((pkgs.formats.toml {}).generate "config.toml" {
|
||||
general = {
|
||||
RemoteNickFormat = "[{NICK}] ";
|
||||
Charset = "utf-8";
|
||||
};
|
||||
telegram.kmein.Token = bridgeBotToken;
|
||||
irc =
|
||||
let Nick = "ponte";
|
||||
in {
|
||||
hackint = { Server = "irc.hackint.org:6697"; UseTLS = true; inherit Nick; };
|
||||
};
|
||||
mumble.lassulus = {
|
||||
Server = "lassul.us:64738";
|
||||
Nick = "krebs_bridge";
|
||||
SkipTLSVerify = true;
|
||||
};
|
||||
gateway = [
|
||||
{
|
||||
name = "krebs-bridge";
|
||||
enable = true;
|
||||
inout = [
|
||||
{
|
||||
account = "irc.hackint";
|
||||
channel = "#krebs";
|
||||
}
|
||||
{
|
||||
account = "telegram.kmein";
|
||||
channel = "-330372458";
|
||||
}
|
||||
{
|
||||
account = "mumble.lassulus";
|
||||
channel = 6; # "nixos"
|
||||
}
|
||||
];
|
||||
}
|
||||
];
|
||||
});
|
||||
configPath = let
|
||||
bridgeBotToken = lib.strings.fileContents <system-secrets/telegram/kmein.token>;
|
||||
in
|
||||
toString ((pkgs.formats.toml {}).generate "config.toml" {
|
||||
general = {
|
||||
RemoteNickFormat = "[{NICK}] ";
|
||||
Charset = "utf-8";
|
||||
};
|
||||
telegram.kmein.Token = bridgeBotToken;
|
||||
irc = let
|
||||
Nick = "ponte";
|
||||
in {
|
||||
hackint = {
|
||||
Server = "irc.hackint.org:6697";
|
||||
UseTLS = true;
|
||||
inherit Nick;
|
||||
};
|
||||
};
|
||||
mumble.lassulus = {
|
||||
Server = "lassul.us:64738";
|
||||
Nick = "krebs_bridge";
|
||||
SkipTLSVerify = true;
|
||||
};
|
||||
gateway = [
|
||||
{
|
||||
name = "krebs-bridge";
|
||||
enable = true;
|
||||
inout = [
|
||||
{
|
||||
account = "irc.hackint";
|
||||
channel = "#krebs";
|
||||
}
|
||||
{
|
||||
account = "telegram.kmein";
|
||||
channel = "-330372458";
|
||||
}
|
||||
{
|
||||
account = "mumble.lassulus";
|
||||
channel = 6; # "nixos"
|
||||
}
|
||||
];
|
||||
}
|
||||
];
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,13 +1,15 @@
|
||||
{ pkgs, lib, ... }:
|
||||
let
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
backend = pkgs.callPackage <menstruation-backend> {};
|
||||
telegram = pkgs.callPackage <menstruation-telegram> {};
|
||||
backendPort = 8000;
|
||||
in
|
||||
{
|
||||
in {
|
||||
services.redis.enable = true;
|
||||
|
||||
environment.systemPackages = [ pkgs.redis ];
|
||||
environment.systemPackages = [pkgs.redis];
|
||||
|
||||
systemd.services.menstruation-telegram = {
|
||||
wants = [
|
||||
@@ -15,7 +17,7 @@ in
|
||||
"menstruation-backend.service"
|
||||
"redis.service"
|
||||
];
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
wantedBy = ["multi-user.target"];
|
||||
environment = {
|
||||
MENSTRUATION_TOKEN = lib.strings.fileContents <system-secrets/telegram/menstruation.token>;
|
||||
MENSTRUATION_ENDPOINT = "http://localhost:${toString backendPort}";
|
||||
@@ -29,7 +31,7 @@ in
|
||||
};
|
||||
|
||||
systemd.services.menstruation-backend = {
|
||||
wants = [ "network-online.target" ];
|
||||
wants = ["network-online.target"];
|
||||
environment.ROCKET_PORT = toString backendPort;
|
||||
serviceConfig = {
|
||||
Restart = "always";
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
{pkgs, ...}: {
|
||||
systemd.services.moinbot = {
|
||||
startAt = "7:00";
|
||||
script = ''
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
method = "GET";
|
||||
no_follow_redirects = false;
|
||||
preferred_ip_protocol = "ip4";
|
||||
valid_http_versions = [ "HTTP/1.1" "HTTP/2.0" ];
|
||||
valid_http_versions = ["HTTP/1.1" "HTTP/2.0"];
|
||||
tls_config.insecure_skip_verify = true;
|
||||
};
|
||||
prober = "http";
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
{ lib, config, pkgs, ... }:
|
||||
let
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
lokiConfig = import ./loki.nix;
|
||||
blackboxConfig = import ./blackbox.nix;
|
||||
inherit (import <niveum/lib>) restic;
|
||||
in
|
||||
{
|
||||
in {
|
||||
services.grafana = {
|
||||
enable = true;
|
||||
domain = "grafana.kmein.r";
|
||||
@@ -19,103 +22,110 @@ in
|
||||
};
|
||||
};
|
||||
|
||||
services.prometheus.rules = let diskFreeThreshold = 10; in [(builtins.toJSON {
|
||||
groups = [{
|
||||
name = "niveum";
|
||||
rules = [
|
||||
services.prometheus.rules = let
|
||||
diskFreeThreshold = 10;
|
||||
in [
|
||||
(builtins.toJSON {
|
||||
groups = [
|
||||
{
|
||||
alert = "ServiceDown";
|
||||
expr = ''node_systemd_unit_state{state="failed"} == 1'';
|
||||
annotations = {
|
||||
summary = "{{$labels.name}} failed on {{$labels.job}}";
|
||||
};
|
||||
}
|
||||
{
|
||||
alert = "RootPartitionFull";
|
||||
for = "10m";
|
||||
expr = ''(node_filesystem_free_bytes{mountpoint="/"} * 100) / node_filesystem_size_bytes{mountpoint="/"} < ${toString diskFreeThreshold}'';
|
||||
annotations = {
|
||||
summary = ''{{ $labels.job }} running out of space: {{ $value | printf "%.2f" }}% < ${toString diskFreeThreshold}%'';
|
||||
};
|
||||
}
|
||||
{
|
||||
alert = "RootPartitionFullWeek";
|
||||
for = "1h";
|
||||
expr = ''node_filesystem_free_bytes{mountpoint="/"} ''
|
||||
+ ''and predict_linear(node_filesystem_free_bytes{mountpoint="/"}[2d], 7*24*3600) <= 0'';
|
||||
annotations = {
|
||||
summary = "{{$labels.job}} running out of space in 7 days";
|
||||
};
|
||||
}
|
||||
{
|
||||
alert = "HighLoad";
|
||||
expr = ''node_load15 / on(job) count(node_cpu_seconds_total{mode="system"}) by (job) >= 1.0'';
|
||||
for = "10m";
|
||||
annotations = {
|
||||
summary = "{{$labels.job}} running on high load: {{$value}}";
|
||||
};
|
||||
}
|
||||
{
|
||||
alert = "HighRAM";
|
||||
expr = "node_memory_MemFree_bytes + node_memory_Buffers_bytes + node_memory_Cached_bytes < node_memory_MemTotal_bytes * 0.1";
|
||||
for = "1h";
|
||||
annotations.summary = "{{$labels.job}} using lots of RAM";
|
||||
}
|
||||
{
|
||||
alert = "UptimeMonster";
|
||||
expr = "time() - node_boot_time_seconds > 2592000";
|
||||
annotations.summary = "uptime monster {{$labels.job}} up for more than 30 days";
|
||||
}
|
||||
{
|
||||
alert = "HostDown";
|
||||
expr = ''up == 0'';
|
||||
for = "5m";
|
||||
annotations = {
|
||||
summary = "{{ $labels.job }} seeming down since 5 minutes";
|
||||
};
|
||||
}
|
||||
{
|
||||
alert = "Reboot";
|
||||
expr = "time() - node_boot_time_seconds < 300";
|
||||
annotations.summary = "{{$labels.job}} rebooted";
|
||||
}
|
||||
{
|
||||
alert = "ProbeFailed";
|
||||
expr = "probe_success == 0";
|
||||
for = "5m";
|
||||
annotations.summary = "HTTP probe failed for {{$labels.instance}}";
|
||||
}
|
||||
{
|
||||
alert = "SlowProbe";
|
||||
expr = "avg_over_time(probe_http_duration_seconds[1m]) > 1";
|
||||
for = "5m";
|
||||
annotations.summary = "HTTP probe slow for {{$labels.instance}}";
|
||||
}
|
||||
{
|
||||
alert = "HttpStatusCode";
|
||||
expr = "probe_http_status_code != 0 AND (probe_http_status_code <= 199 OR probe_http_status_code >= 400)";
|
||||
for = "5m";
|
||||
annotations.summary = "status code {{$value}} for {{$labels.instance}}";
|
||||
}
|
||||
{
|
||||
alert = "SslExpirySoon";
|
||||
expr = "probe_ssl_earliest_cert_expiry - time() < 86400 * 30";
|
||||
for = "5m";
|
||||
annotations.summary = "SSL certificate for {{$labels.instance}} expires in 30 days";
|
||||
}
|
||||
{
|
||||
alert = "SslExpiry";
|
||||
expr = "probe_ssl_earliest_cert_expiry - time() <= 0";
|
||||
for = "5m";
|
||||
annotations.summary = "SSL certificate for {{$labels.instance}} has expired";
|
||||
name = "niveum";
|
||||
rules = [
|
||||
{
|
||||
alert = "ServiceDown";
|
||||
expr = ''node_systemd_unit_state{state="failed"} == 1'';
|
||||
annotations = {
|
||||
summary = "{{$labels.name}} failed on {{$labels.job}}";
|
||||
};
|
||||
}
|
||||
{
|
||||
alert = "RootPartitionFull";
|
||||
for = "10m";
|
||||
expr = ''(node_filesystem_free_bytes{mountpoint="/"} * 100) / node_filesystem_size_bytes{mountpoint="/"} < ${toString diskFreeThreshold}'';
|
||||
annotations = {
|
||||
summary = ''{{ $labels.job }} running out of space: {{ $value | printf "%.2f" }}% < ${toString diskFreeThreshold}%'';
|
||||
};
|
||||
}
|
||||
{
|
||||
alert = "RootPartitionFullWeek";
|
||||
for = "1h";
|
||||
expr =
|
||||
''node_filesystem_free_bytes{mountpoint="/"} ''
|
||||
+ ''and predict_linear(node_filesystem_free_bytes{mountpoint="/"}[2d], 7*24*3600) <= 0'';
|
||||
annotations = {
|
||||
summary = "{{$labels.job}} running out of space in 7 days";
|
||||
};
|
||||
}
|
||||
{
|
||||
alert = "HighLoad";
|
||||
expr = ''node_load15 / on(job) count(node_cpu_seconds_total{mode="system"}) by (job) >= 1.0'';
|
||||
for = "10m";
|
||||
annotations = {
|
||||
summary = "{{$labels.job}} running on high load: {{$value}}";
|
||||
};
|
||||
}
|
||||
{
|
||||
alert = "HighRAM";
|
||||
expr = "node_memory_MemFree_bytes + node_memory_Buffers_bytes + node_memory_Cached_bytes < node_memory_MemTotal_bytes * 0.1";
|
||||
for = "1h";
|
||||
annotations.summary = "{{$labels.job}} using lots of RAM";
|
||||
}
|
||||
{
|
||||
alert = "UptimeMonster";
|
||||
expr = "time() - node_boot_time_seconds > 2592000";
|
||||
annotations.summary = "uptime monster {{$labels.job}} up for more than 30 days";
|
||||
}
|
||||
{
|
||||
alert = "HostDown";
|
||||
expr = ''up == 0'';
|
||||
for = "5m";
|
||||
annotations = {
|
||||
summary = "{{ $labels.job }} seeming down since 5 minutes";
|
||||
};
|
||||
}
|
||||
{
|
||||
alert = "Reboot";
|
||||
expr = "time() - node_boot_time_seconds < 300";
|
||||
annotations.summary = "{{$labels.job}} rebooted";
|
||||
}
|
||||
{
|
||||
alert = "ProbeFailed";
|
||||
expr = "probe_success == 0";
|
||||
for = "5m";
|
||||
annotations.summary = "HTTP probe failed for {{$labels.instance}}";
|
||||
}
|
||||
{
|
||||
alert = "SlowProbe";
|
||||
expr = "avg_over_time(probe_http_duration_seconds[1m]) > 1";
|
||||
for = "5m";
|
||||
annotations.summary = "HTTP probe slow for {{$labels.instance}}";
|
||||
}
|
||||
{
|
||||
alert = "HttpStatusCode";
|
||||
expr = "probe_http_status_code != 0 AND (probe_http_status_code <= 199 OR probe_http_status_code >= 400)";
|
||||
for = "5m";
|
||||
annotations.summary = "status code {{$value}} for {{$labels.instance}}";
|
||||
}
|
||||
{
|
||||
alert = "SslExpirySoon";
|
||||
expr = "probe_ssl_earliest_cert_expiry - time() < 86400 * 30";
|
||||
for = "5m";
|
||||
annotations.summary = "SSL certificate for {{$labels.instance}} expires in 30 days";
|
||||
}
|
||||
{
|
||||
alert = "SslExpiry";
|
||||
expr = "probe_ssl_earliest_cert_expiry - time() <= 0";
|
||||
for = "5m";
|
||||
annotations.summary = "SSL certificate for {{$labels.instance}} has expired";
|
||||
}
|
||||
];
|
||||
}
|
||||
];
|
||||
}];
|
||||
})];
|
||||
})
|
||||
];
|
||||
|
||||
systemd.services.alertmanager-bot-telegram = {
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
after = [ "ip-up.target" ];
|
||||
wantedBy = ["multi-user.target"];
|
||||
after = ["ip-up.target"];
|
||||
environment.TELEGRAM_ADMIN = "18980945";
|
||||
environment.TELEGRAM_TOKEN = lib.strings.fileContents <system-secrets/telegram/prometheus.token>;
|
||||
serviceConfig = {
|
||||
@@ -123,17 +133,19 @@ in
|
||||
RestartSec = "15s";
|
||||
DynamicUser = true;
|
||||
StateDirectory = "alertbot";
|
||||
ExecStart = ''${pkgs.alertmanager-bot-telegram}/bin/alertmanager-bot \
|
||||
--alertmanager.url=http://localhost:9093 --log.level=info \
|
||||
--store=bolt --bolt.path=/var/lib/alertbot/bot.db \
|
||||
--listen.addr="0.0.0.0:16320" \
|
||||
--template.paths=${pkgs.writeText "template.tmpl" ''
|
||||
{{ define "telegram.default" }}
|
||||
{{range .Alerts -}}
|
||||
{{.Status}}: {{ index .Annotations "summary"}}
|
||||
{{end -}}
|
||||
{{end}}
|
||||
''}'';
|
||||
ExecStart = '' ${pkgs.alertmanager-bot-telegram}/bin/alertmanager-bot \
|
||||
--alertmanager.url=http://localhost:9093 --log.level=info \
|
||||
--store=bolt --bolt.path=/var/lib/alertbot/bot.db \
|
||||
--listen.addr="0.0.0.0:16320" \
|
||||
--template.paths=${
|
||||
pkgs.writeText "template.tmpl" ''
|
||||
{{ define "telegram.default" }}
|
||||
{{range .Alerts -}}
|
||||
{{.Status}}: {{ index .Annotations "summary"}}
|
||||
{{end -}}
|
||||
{{end}}
|
||||
''
|
||||
}'';
|
||||
};
|
||||
};
|
||||
|
||||
@@ -146,64 +158,88 @@ in
|
||||
repeat_interval = "4h";
|
||||
receiver = "me";
|
||||
};
|
||||
receivers = [{
|
||||
name = "me";
|
||||
webhook_configs = [{
|
||||
url = "http://localhost:16320";
|
||||
send_resolved = true;
|
||||
}];
|
||||
}];
|
||||
receivers = [
|
||||
{
|
||||
name = "me";
|
||||
webhook_configs = [
|
||||
{
|
||||
url = "http://localhost:16320";
|
||||
send_resolved = true;
|
||||
}
|
||||
];
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
services.prometheus.alertmanagers = [{
|
||||
scheme = "http";
|
||||
path_prefix = "/";
|
||||
static_configs = [ { targets = [ "localhost:9093" ]; } ];
|
||||
}];
|
||||
services.prometheus.alertmanagers = [
|
||||
{
|
||||
scheme = "http";
|
||||
path_prefix = "/";
|
||||
static_configs = [{targets = ["localhost:9093"];}];
|
||||
}
|
||||
];
|
||||
|
||||
services.prometheus.scrapeConfigs = [
|
||||
{
|
||||
job_name = "makanek";
|
||||
static_configs = [ { targets = [
|
||||
"127.0.0.1:${toString config.services.prometheus.exporters.node.port}"
|
||||
]; } ];
|
||||
static_configs = [
|
||||
{
|
||||
targets = [
|
||||
"127.0.0.1:${toString config.services.prometheus.exporters.node.port}"
|
||||
];
|
||||
}
|
||||
];
|
||||
}
|
||||
{
|
||||
scrape_interval = "5m";
|
||||
job_name = "blackbox";
|
||||
metrics_path = "/probe";
|
||||
params.module = [ "http_2xx" ];
|
||||
params.module = ["http_2xx"];
|
||||
relabel_configs = [
|
||||
{ source_labels = ["__address__"]; target_label = "__param_target"; }
|
||||
{ source_labels = ["__param_target"]; target_label = "instance"; }
|
||||
{ replacement = "127.0.0.1:${toString config.services.prometheus.exporters.blackbox.port}"; target_label = "__address__"; }
|
||||
{
|
||||
source_labels = ["__address__"];
|
||||
target_label = "__param_target";
|
||||
}
|
||||
{
|
||||
source_labels = ["__param_target"];
|
||||
target_label = "instance";
|
||||
}
|
||||
{
|
||||
replacement = "127.0.0.1:${toString config.services.prometheus.exporters.blackbox.port}";
|
||||
target_label = "__address__";
|
||||
}
|
||||
];
|
||||
static_configs = [
|
||||
{
|
||||
targets = [
|
||||
"alew.hu-berlin.de"
|
||||
"pad.kmein.de"
|
||||
"code.kmein.de"
|
||||
"radio.kmein.de"
|
||||
"tarot.kmein.de"
|
||||
"cloud.xn--kiern-0qa.de"
|
||||
"grafana.kmein.r"
|
||||
"names.kmein.r"
|
||||
"rrm.r"
|
||||
"graph.r"
|
||||
];
|
||||
}
|
||||
];
|
||||
static_configs = [{
|
||||
targets = [
|
||||
"alew.hu-berlin.de"
|
||||
"pad.kmein.de"
|
||||
"code.kmein.de"
|
||||
"radio.kmein.de"
|
||||
"tarot.kmein.de"
|
||||
"cloud.xn--kiern-0qa.de"
|
||||
"grafana.kmein.r"
|
||||
"names.kmein.r"
|
||||
"rrm.r"
|
||||
"graph.r"
|
||||
];
|
||||
}];
|
||||
}
|
||||
{
|
||||
job_name = "zaatar";
|
||||
static_configs = [ { targets = [
|
||||
"zaatar.r:${toString config.services.prometheus.exporters.node.port}"
|
||||
"zaatar.r:${toString restic.port}"
|
||||
]; } ];
|
||||
static_configs = [
|
||||
{
|
||||
targets = [
|
||||
"zaatar.r:${toString config.services.prometheus.exporters.node.port}"
|
||||
"zaatar.r:${toString restic.port}"
|
||||
];
|
||||
}
|
||||
];
|
||||
}
|
||||
];
|
||||
|
||||
|
||||
services.prometheus.exporters.blackbox = {
|
||||
enable = true;
|
||||
configFile = (pkgs.formats.yaml {}).generate "blackbox.yaml" blackboxConfig;
|
||||
|
||||
@@ -17,11 +17,11 @@
|
||||
};
|
||||
final_sleep = "0s";
|
||||
};
|
||||
chunk_idle_period = "1h"; # Any chunk not receiving new logs in this time will be flushed
|
||||
max_chunk_age = "1h"; # All chunks will be flushed when they hit this age, default is 1h
|
||||
chunk_target_size = 1048576; # Loki will attempt to build chunks up to 1.5MB, flushing first if chunk_idle_period or max_chunk_age is reached first
|
||||
chunk_retain_period = "30s"; # Must be greater than index read cache TTL if using an index cache (Default index read cache TTL is 5m)
|
||||
max_transfer_retries = 0; # Chunk transfers disabled
|
||||
chunk_idle_period = "1h"; # Any chunk not receiving new logs in this time will be flushed
|
||||
max_chunk_age = "1h"; # All chunks will be flushed when they hit this age, default is 1h
|
||||
chunk_target_size = 1048576; # Loki will attempt to build chunks up to 1.5MB, flushing first if chunk_idle_period or max_chunk_age is reached first
|
||||
chunk_retain_period = "30s"; # Must be greater than index read cache TTL if using an index cache (Default index read cache TTL is 5m)
|
||||
max_transfer_retries = 0; # Chunk transfers disabled
|
||||
};
|
||||
schema_config.configs = [
|
||||
{
|
||||
@@ -39,7 +39,7 @@
|
||||
boltdb_shipper = {
|
||||
active_index_directory = "/tmp/loki/boltdb-shipper-active";
|
||||
cache_location = "/tmp/loki/boltdb-shipper-cache";
|
||||
cache_ttl = "24h"; # Can be increased for faster performance over longer query periods, uses more disk space
|
||||
cache_ttl = "24h"; # Can be increased for faster performance over longer query periods, uses more disk space
|
||||
shared_store = "filesystem";
|
||||
};
|
||||
filesystem.directory = "/tmp/loki/chunks";
|
||||
|
||||
@@ -1,11 +1,16 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
let
|
||||
moodle-dl-package = pkgs.moodle-dl.overrideAttrs (old: old // {
|
||||
patches = [ <niveum/packages/moodle-dl/telegram-format.patch> ];
|
||||
});
|
||||
in
|
||||
{
|
||||
imports = [ <niveum/modules/moodle-dl.nix> ];
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
moodle-dl-package = pkgs.moodle-dl.overrideAttrs (old:
|
||||
old
|
||||
// {
|
||||
patches = [<niveum/packages/moodle-dl/telegram-format.patch>];
|
||||
});
|
||||
in {
|
||||
imports = [<niveum/modules/moodle-dl.nix>];
|
||||
|
||||
services.moodle-dl = {
|
||||
enable = true;
|
||||
|
||||
@@ -1,13 +1,15 @@
|
||||
{ pkgs, lib, ... }:
|
||||
let
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
port = 5703;
|
||||
geogen-src = "${<scripts>}/onomastics";
|
||||
geogen = pkgs.callPackage geogen-src {};
|
||||
in
|
||||
{
|
||||
in {
|
||||
systemd.services.names = {
|
||||
wants = [ "network-online.target" ];
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
wants = ["network-online.target"];
|
||||
wantedBy = ["multi-user.target"];
|
||||
description = "Better clone of geogen.stoepel.net";
|
||||
serviceConfig = {
|
||||
DynamicUser = true;
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
{ pkgs, lib, ... }:
|
||||
let
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
passwordFile = path: toString (pkgs.writeText "password" (lib.strings.fileContents path));
|
||||
inherit (import <niveum/lib>) localAddresses;
|
||||
in
|
||||
{
|
||||
in {
|
||||
services.nextcloud = {
|
||||
enable = true;
|
||||
package = pkgs.nextcloud22;
|
||||
@@ -33,7 +35,7 @@ in
|
||||
|
||||
services.postgresql = {
|
||||
enable = true;
|
||||
ensureDatabases = [ "nextcloud" ];
|
||||
ensureDatabases = ["nextcloud"];
|
||||
ensureUsers = [
|
||||
{
|
||||
name = "nextcloud";
|
||||
@@ -42,7 +44,6 @@ in
|
||||
];
|
||||
};
|
||||
|
||||
|
||||
services.nginx.virtualHosts."cloud.xn--kiern-0qa.de" = {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
{ pkgs, lib, ... }:
|
||||
let
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (import <niveum/lib>) serveHtml;
|
||||
remote = "https://cgit.lassul.us/stockholm";
|
||||
in
|
||||
{
|
||||
in {
|
||||
services.nginx.virtualHosts."redaktion.r".locations."/".extraConfig = serveHtml <niveum/lib/radio-news.html> pkgs;
|
||||
|
||||
systemd.services.stockholm-history = {
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
{ lib, pkgs, config, ... }:
|
||||
let
|
||||
{
|
||||
lib,
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}: let
|
||||
inherit (import <niveum/lib>) tmpfilesConfig;
|
||||
liquidsoapDirectory = "/var/cache/liquidsoap";
|
||||
icecastPassword = "hackme";
|
||||
@@ -105,7 +109,6 @@ in {
|
||||
})
|
||||
];
|
||||
|
||||
|
||||
services.icecast = {
|
||||
enable = true;
|
||||
hostname = "radio.kmein.de";
|
||||
@@ -118,7 +121,6 @@ in {
|
||||
'';
|
||||
};
|
||||
|
||||
|
||||
services.nginx.virtualHosts."radio.kmein.de" = {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
let
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
network = "retiolum";
|
||||
|
||||
stateDirectory = "retiolum-map";
|
||||
@@ -8,11 +12,10 @@ let
|
||||
geo-ip-database-path = "${config.services.geoipupdate.settings.DatabaseDirectory}/${geo-ip-database}";
|
||||
|
||||
tinc-graph = pkgs.callPackage <tinc-graph> {};
|
||||
in
|
||||
{
|
||||
in {
|
||||
systemd.services.retiolum-index = {
|
||||
description = "Retiolum indexing service";
|
||||
wants = [ "tinc.${network}.service" ];
|
||||
wants = ["tinc.${network}.service"];
|
||||
script = ''
|
||||
${tinc-graph}/bin/tinc-graph --geoip-file ${geo-ip-database-path} --network ${network} \
|
||||
| ${pkgs.coreutils}/bin/tee network.json \
|
||||
@@ -23,7 +26,7 @@ in
|
||||
cp ${tinc-graph}/static/graph.html graph.html
|
||||
'';
|
||||
startAt = "hourly";
|
||||
path = [ pkgs.coreutils pkgs.jq pkgs.tinc_pre ];
|
||||
path = [pkgs.coreutils pkgs.jq pkgs.tinc_pre];
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
User = "root";
|
||||
@@ -37,7 +40,7 @@ in
|
||||
settings = {
|
||||
AccountID = 608777;
|
||||
LicenseKey = toString <system-secrets/maxmind/license.key>;
|
||||
EditionIDs = [ "GeoLite2-City" ];
|
||||
EditionIDs = ["GeoLite2-City"];
|
||||
};
|
||||
};
|
||||
|
||||
@@ -53,7 +56,7 @@ in
|
||||
};
|
||||
|
||||
systemd.services.geoip-share = {
|
||||
after = [ "geoipupdate.service" ];
|
||||
after = ["geoipupdate.service"];
|
||||
script = let
|
||||
cyberlocker-tools = pkgs.callPackage <stockholm/krebs/5pkgs/simple/cyberlocker-tools> {};
|
||||
in "${cyberlocker-tools}/bin/cput ${geo-ip-database} < ${geo-ip-database-path}";
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
let
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
tarotPort = 7407;
|
||||
tarotFiles = pkgs.fetchzip {
|
||||
url = "https://c.krebsco.de/tarot.zip";
|
||||
@@ -10,37 +14,38 @@ let
|
||||
url = "http://c.krebsco.de/tarot.pdf";
|
||||
sha256 = "1n2m53kjg2vj9dbr70b9jrsbqwdfrcb48l4wswn21549fi24g6dx";
|
||||
};
|
||||
in
|
||||
{
|
||||
imports = [ <stockholm/krebs/3modules/htgen.nix> ];
|
||||
in {
|
||||
imports = [<stockholm/krebs/3modules/htgen.nix>];
|
||||
|
||||
krebs.htgen.tarot = {
|
||||
port = tarotPort;
|
||||
user.name = "radio";
|
||||
script = ''. ${pkgs.writers.writeDash "tarot" ''
|
||||
case "$Method $Request_URI" in
|
||||
"GET /")
|
||||
if item=$(${pkgs.findutils}/bin/find ${toString tarotFiles} -type f | ${pkgs.coreutils}/bin/shuf -n1); then
|
||||
card=$(mktemp --tmpdir tarot.XXX)
|
||||
trap 'rm $card' EXIT
|
||||
reverse=$(${pkgs.coreutils}/bin/shuf -i0-1 -n1)
|
||||
if [ "$reverse" -eq 1 ]; then
|
||||
${pkgs.imagemagick}/bin/convert -rotate 180 "$item" "$card"
|
||||
else
|
||||
${pkgs.coreutils}/bin/cp "$item" "$card"
|
||||
fi
|
||||
printf 'HTTP/1.1 200 OK\r\n'
|
||||
printf 'Content-Type: %s\r\n' "$(${pkgs.file}/bin/file -ib "$card")"
|
||||
printf 'Server: %s\r\n' "$Server"
|
||||
printf 'Connection: close\r\n'
|
||||
printf 'Content-Length: %d\r\n' $(${pkgs.coreutils}/bin/wc -c < "$card")
|
||||
printf '\r\n'
|
||||
cat "$card"
|
||||
exit
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
''}'';
|
||||
script = ''. ${
|
||||
pkgs.writers.writeDash "tarot" ''
|
||||
case "$Method $Request_URI" in
|
||||
"GET /")
|
||||
if item=$(${pkgs.findutils}/bin/find ${toString tarotFiles} -type f | ${pkgs.coreutils}/bin/shuf -n1); then
|
||||
card=$(mktemp --tmpdir tarot.XXX)
|
||||
trap 'rm $card' EXIT
|
||||
reverse=$(${pkgs.coreutils}/bin/shuf -i0-1 -n1)
|
||||
if [ "$reverse" -eq 1 ]; then
|
||||
${pkgs.imagemagick}/bin/convert -rotate 180 "$item" "$card"
|
||||
else
|
||||
${pkgs.coreutils}/bin/cp "$item" "$card"
|
||||
fi
|
||||
printf 'HTTP/1.1 200 OK\r\n'
|
||||
printf 'Content-Type: %s\r\n' "$(${pkgs.file}/bin/file -ib "$card")"
|
||||
printf 'Server: %s\r\n' "$Server"
|
||||
printf 'Connection: close\r\n'
|
||||
printf 'Content-Length: %d\r\n' $(${pkgs.coreutils}/bin/wc -c < "$card")
|
||||
printf '\r\n'
|
||||
cat "$card"
|
||||
exit
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
''
|
||||
}'';
|
||||
};
|
||||
|
||||
services.nginx.virtualHosts."tarot.kmein.de" = {
|
||||
@@ -50,8 +55,14 @@ in
|
||||
"/".proxyPass = "http://127.0.0.1:${toString tarotPort}";
|
||||
"/files/" = {
|
||||
root = pkgs.linkFarm "tarot" [
|
||||
{ name = "files/key.pdf"; path = tarotKey; }
|
||||
{ name = "files/cards"; path = tarotFiles; }
|
||||
{
|
||||
name = "files/key.pdf";
|
||||
path = tarotKey;
|
||||
}
|
||||
{
|
||||
name = "files/cards";
|
||||
path = tarotFiles;
|
||||
}
|
||||
];
|
||||
extraConfig = ''
|
||||
autoindex on;
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
{ pkgs, config, lib, ... }:
|
||||
let
|
||||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (import <niveum/lib>) kieran;
|
||||
|
||||
urlwatchDir = "/var/lib/urlwatch";
|
||||
@@ -10,17 +14,17 @@ let
|
||||
{
|
||||
name = "Corona-Verordnung";
|
||||
url = "https://www.berlin.de/corona/massnahmen/verordnung/";
|
||||
filter = [ { css = "[role=main]"; } "html2text" "strip" ];
|
||||
filter = [{css = "[role=main]";} "html2text" "strip"];
|
||||
}
|
||||
{
|
||||
name = "HU Semester";
|
||||
url = "https://agnes.hu-berlin.de/lupo/rds?state=change&type=6&moduleParameter=semesterSelect&nextdir=change&next=SearchSelect.vm&subdir=applications&targettype=7&targetstate=change&getglobal=semester";
|
||||
filter = [ { css = "fieldset"; } "html2text" "strip" ];
|
||||
filter = [{css = "fieldset";} "html2text" "strip"];
|
||||
}
|
||||
{
|
||||
name = "Lammla 2021";
|
||||
url = "http://lammla.info/index.php?reihe=30";
|
||||
filter = [ "html2text" "strip" ];
|
||||
filter = ["html2text" "strip"];
|
||||
}
|
||||
{
|
||||
name = "Tatort";
|
||||
@@ -38,77 +42,77 @@ let
|
||||
{
|
||||
name = "Kratylos";
|
||||
url = "https://kratylos.reichert-online.org/current_issue/KRATYLOS";
|
||||
filter = [ { element-by-id = "content"; } "html2text" "strip" ];
|
||||
filter = [{element-by-id = "content";} "html2text" "strip"];
|
||||
}
|
||||
{
|
||||
name = "Zeno Free E-Books";
|
||||
url = "http://www.zeno.org/Lesesaal/M/E-Books";
|
||||
filter = [ { element-by-class = "zenoCOMain"; } "html2text" "strip" ];
|
||||
filter = [{element-by-class = "zenoCOMain";} "html2text" "strip"];
|
||||
}
|
||||
{
|
||||
name = "Arnshaugk Neuerscheinungen";
|
||||
url = "http://www.arnshaugk.de/index.php";
|
||||
filter = [ "html2text" "strip" ];
|
||||
filter = ["html2text" "strip"];
|
||||
}
|
||||
{
|
||||
name = "Carolina Welslau";
|
||||
url = "https://carolinawelslau.de/";
|
||||
filter = [ { element-by-id = "main"; } "html2text" "strip" ];
|
||||
filter = [{element-by-id = "main";} "html2text" "strip"];
|
||||
}
|
||||
{
|
||||
name = "Lisa Littmann";
|
||||
url = "https://lisalittmann.de/";
|
||||
filter = [ { element-by-id = "main"; } "html2text" "strip" ];
|
||||
filter = [{element-by-id = "main";} "html2text" "strip"];
|
||||
}
|
||||
{
|
||||
name = "Lisa Littmann: Projects";
|
||||
url = "https://lisalittmann.de/projects/";
|
||||
filter = [ { element-by-id = "main"; } "html2text" "strip" ];
|
||||
filter = [{element-by-id = "main";} "html2text" "strip"];
|
||||
}
|
||||
{
|
||||
name = "Lisa Littmann: Archive";
|
||||
url = "https://lisalittmann.de/archive/";
|
||||
filter = [ { element-by-id = "main"; } "html2text" "strip" ];
|
||||
filter = [{element-by-id = "main";} "html2text" "strip"];
|
||||
}
|
||||
{
|
||||
name = "WarpGrid: Idiomarium";
|
||||
url = "https://warpgrid.de/idiomarium/";
|
||||
filter = [ { element-by-id = "site-content"; } "html2text" "strip" ];
|
||||
filter = [{element-by-id = "site-content";} "html2text" "strip"];
|
||||
}
|
||||
{
|
||||
name = "WarpGrid: Futurism";
|
||||
url = "https://warpgrid.de/futurism/";
|
||||
filter = [ { element-by-id = "site-content"; } "html2text" "strip" ];
|
||||
filter = [{element-by-id = "site-content";} "html2text" "strip"];
|
||||
}
|
||||
{
|
||||
name = "WarpGrid: Imagiary";
|
||||
url = "https://warpgrid.de/imagiary/";
|
||||
filter = [ { element-by-id = "site-content"; } "html2text" "strip" ];
|
||||
filter = [{element-by-id = "site-content";} "html2text" "strip"];
|
||||
}
|
||||
{
|
||||
name = "WarpGrid: Cook";
|
||||
url = "https://warpgrid.de/alchemy/";
|
||||
filter = [ { element-by-id = "site-content"; } "html2text" "strip" ];
|
||||
filter = [{element-by-id = "site-content";} "html2text" "strip"];
|
||||
}
|
||||
{
|
||||
name = "Indogermanische Forschungen";
|
||||
url = "https://www.degruyter.com/journal/key/INDO/html";
|
||||
filter = [ { element-by-id = "latestIssue"; } "html2text" "strip" ];
|
||||
filter = [{element-by-id = "latestIssue";} "html2text" "strip"];
|
||||
}
|
||||
{
|
||||
name = "IG Neuigkeiten";
|
||||
url = "https://www.indogermanistik.org/aktuelles/neuigkeiten.html";
|
||||
filter = [ { css = "[itemprop=articleBody]"; } "html2text" "strip" ];
|
||||
filter = [{css = "[itemprop=articleBody]";} "html2text" "strip"];
|
||||
}
|
||||
{
|
||||
name = "IG Tagungen";
|
||||
url = "https://www.indogermanistik.org/tagungen/tagungen-der-ig.html";
|
||||
filter = [ { css = "[itemprop=articleBody]"; } "html2text" "strip" ];
|
||||
filter = [{css = "[itemprop=articleBody]";} "html2text" "strip"];
|
||||
}
|
||||
{
|
||||
name = "Christian-Metz-Blamage";
|
||||
url = "https://www.deutschlandfunk.de/meine-nacht-schlaeft-nicht-pflanze-mich-nicht-in-dein-herz.700.de.html?dram:article_id=486475";
|
||||
filter = [ { element-by-class = "dlf-articledetail"; } "html2text" "strip" ];
|
||||
filter = [{element-by-class = "dlf-articledetail";} "html2text" "strip"];
|
||||
}
|
||||
{
|
||||
name = "fxght.or.flxght";
|
||||
@@ -170,10 +174,9 @@ let
|
||||
};
|
||||
};
|
||||
urlwatch = pkgs.urlwatch.overrideAttrs (attrs: {
|
||||
patches = [ <niveum/packages/urlwatch-insecure.patch> ];
|
||||
patches = [<niveum/packages/urlwatch-insecure.patch>];
|
||||
});
|
||||
in
|
||||
{
|
||||
in {
|
||||
users.extraUsers.urlwatch = {
|
||||
home = urlwatchDir;
|
||||
createHome = true;
|
||||
|
||||
@@ -1,25 +1,29 @@
|
||||
{ lib, pkgs, ... }:
|
||||
let
|
||||
{
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (import <niveum/lib>) kieran;
|
||||
relayPassword = lib.fileContents <system-secrets/weechat/relay>;
|
||||
in {
|
||||
systemd.services.weechat =
|
||||
let
|
||||
systemd.services.weechat = let
|
||||
tmux = pkgs.writers.writeDash "tmux" ''
|
||||
exec ${pkgs.tmux}/bin/tmux -f ${pkgs.writeText "tmux.conf" ''
|
||||
set-option -g prefix `
|
||||
unbind-key C-b
|
||||
bind ` send-prefix
|
||||
exec ${pkgs.tmux}/bin/tmux -f ${
|
||||
pkgs.writeText "tmux.conf" ''
|
||||
set-option -g prefix `
|
||||
unbind-key C-b
|
||||
bind ` send-prefix
|
||||
|
||||
set-option -g status off
|
||||
set-option -g default-terminal screen-256color
|
||||
set-option -g status off
|
||||
set-option -g default-terminal screen-256color
|
||||
|
||||
#use session instead of windows
|
||||
bind-key c new-session
|
||||
bind-key p switch-client -p
|
||||
bind-key n switch-client -n
|
||||
bind-key C-s switch-client -l
|
||||
''} "$@"
|
||||
#use session instead of windows
|
||||
bind-key c new-session
|
||||
bind-key p switch-client -p
|
||||
bind-key n switch-client -n
|
||||
bind-key C-s switch-client -l
|
||||
''
|
||||
} "$@"
|
||||
'';
|
||||
weechat = pkgs.weechat-declarative.override {
|
||||
config = {
|
||||
@@ -28,7 +32,9 @@ in {
|
||||
pkgs.weechatScripts.colorize_nicks
|
||||
pkgs.weechatScripts.weechat-matrix
|
||||
];
|
||||
settings = let nick = "kmein"; in {
|
||||
settings = let
|
||||
nick = "kmein";
|
||||
in {
|
||||
weechat = {
|
||||
look.mouse = true;
|
||||
look.prefix_align_max = 15;
|
||||
@@ -52,7 +58,7 @@ in {
|
||||
address = "irc.hackint.org/6697";
|
||||
ipv6 = true;
|
||||
ssl = true;
|
||||
autojoin = [ "#krebs" "#hsmr" "#nixos" "#the_playlist" "#flipdot-berlin" "#hackint" ];
|
||||
autojoin = ["#krebs" "#hsmr" "#nixos" "#the_playlist" "#flipdot-berlin" "#hackint"];
|
||||
sasl_mechanism = "plain";
|
||||
sasl_username = nick;
|
||||
sasl_password = lib.strings.fileContents <system-secrets/irc/hackint>;
|
||||
@@ -61,7 +67,7 @@ in {
|
||||
autoconnect = true;
|
||||
address = "irc.libera.chat/6697";
|
||||
ssl = true;
|
||||
autojoin = [ "#flipdot" "#haskell" "#nixos" "#fysi" "#binaergewitter" "#neovim" "#lojban" "#vim" ];
|
||||
autojoin = ["#flipdot" "#haskell" "#nixos" "#fysi" "#binaergewitter" "#neovim" "#lojban" "#vim"];
|
||||
sasl_mechanism = "plain";
|
||||
sasl_username = nick;
|
||||
sasl_password = lib.strings.fileContents <system-secrets/irc/libera>;
|
||||
@@ -75,12 +81,12 @@ in {
|
||||
"/msg nickserv identify ${lib.strings.fileContents <system-secrets/irc/oftc>}"
|
||||
"/msg nickserv set cloak on"
|
||||
];
|
||||
autojoin = [ "#home-manager" ];
|
||||
autojoin = ["#home-manager"];
|
||||
};
|
||||
retiolum = {
|
||||
autoconnect = true;
|
||||
address = "irc.r";
|
||||
autojoin = [ "#xxx" "#brockman" "#flix" "#autowifi" ];
|
||||
autojoin = ["#xxx" "#brockman" "#flix" "#autowifi"];
|
||||
command = lib.concatStringsSep "\\;" [
|
||||
"/oper admin aidsballs"
|
||||
"/msg nickserv always-on true"
|
||||
@@ -94,7 +100,7 @@ in {
|
||||
news = {
|
||||
autoconnect = true;
|
||||
address = "news.r";
|
||||
autojoin = [ "#cook" "#drachengame" "#oepnv" "#kmeinung" "#memes" ];
|
||||
autojoin = ["#cook" "#drachengame" "#oepnv" "#kmeinung" "#memes"];
|
||||
command = "/oper aids balls";
|
||||
};
|
||||
};
|
||||
@@ -134,7 +140,7 @@ in {
|
||||
};
|
||||
bots = {
|
||||
buffer = "irc.retiolum.*";
|
||||
tags = [ "nick_gitlab" ];
|
||||
tags = ["nick_gitlab"];
|
||||
regex = "*";
|
||||
};
|
||||
};
|
||||
@@ -144,10 +150,10 @@ in {
|
||||
};
|
||||
in {
|
||||
description = "Weechat bouncer";
|
||||
after = [ "network.target" ];
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
after = ["network.target"];
|
||||
wantedBy = ["multi-user.target"];
|
||||
restartIfChanged = true;
|
||||
path = [ pkgs.alacritty.terminfo ];
|
||||
path = [pkgs.alacritty.terminfo];
|
||||
environment.WEECHAT_HOME = "/var/lib/weechat";
|
||||
preStart = "${pkgs.coreutils}/bin/rm $WEECHAT_HOME/*.conf";
|
||||
script = "${tmux} -2 new-session -d -s IM ${weechat}/bin/weechat";
|
||||
@@ -163,13 +169,15 @@ in {
|
||||
users.groups.weechat = {};
|
||||
users.extraUsers.weechat = {
|
||||
useDefaultShell = true;
|
||||
openssh.authorizedKeys.keys = kieran.sshKeys pkgs ++ [
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIC+KVDmYYH7mA8v81e9O3swXm3ZVYY9t4HP65ud61uXy weechat_android@heym"
|
||||
];
|
||||
openssh.authorizedKeys.keys =
|
||||
kieran.sshKeys pkgs
|
||||
++ [
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIC+KVDmYYH7mA8v81e9O3swXm3ZVYY9t4HP65ud61uXy weechat_android@heym"
|
||||
];
|
||||
createHome = true;
|
||||
group = "weechat";
|
||||
home = "/var/lib/weechat";
|
||||
isSystemUser = true;
|
||||
packages = [ pkgs.tmux ];
|
||||
packages = [pkgs.tmux];
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user