1
0
mirror of https://github.com/kmein/niveum synced 2026-03-16 10:11:08 +01:00
Files
niveum/systems/makanek/configuration.nix

117 lines
3.1 KiB
Nix
Raw Normal View History

{ lib, config, pkgs, ... }:
2020-10-31 20:51:25 +01:00
let
inherit (import <niveum/lib>) kieran;
in
{
imports = [
{
systemd.services.praesenzlehre = {
description = "Live Ticker zu praesenzlehre-berlin.org";
wants = [ "network.target" ];
wantedBy = [ "multi-user.target" ];
startAt = "daily";
path = [ pkgs.curl pkgs.pup pkgs.bc ];
environment.BOT_TOKEN = lib.strings.fileContents <system-secrets/telegram/kmein.token>;
script = ''
set -efu
count_file=/tmp/praesenzlehre-berlin.org
set_count() {
echo $* > "$count_file"
}
get_count() {
cat "$count_file"
}
notify() {
curl -sSL -X POST -H 'Content-Type: application/json' \
-d "{\"chat_id\": \"@praesenzlehre_berlin\", \"text\": \"$*\"}" \
"https://api.telegram.org/bot$BOT_TOKEN/sendMessage"
}
test -f "$count_file" || set_count 0
count="$(get_count)"
new_count="$(curl -sSL https://praesenzlehre-berlin.org/ | pup '.dk-speakout-signature-count span text{}' | tr -dc 0-9)"
if [ "$new_count" -gt "$count" ]; then
diff="$(echo "$new_count - $count" | bc)"
echo "$new_count (+ $diff)"
notify "$new_count Unterzeichner:innen! (+ $diff)"
set_count "$new_count"
fi
'';
};
}
2020-10-31 20:51:25 +01:00
./hardware-configuration.nix
2021-01-15 10:05:12 +01:00
<niveum/configs/hedgedoc.nix>
2020-10-31 20:51:25 +01:00
<niveum/configs/spacetime.nix>
<niveum/configs/sshd.nix>
<niveum/configs/nextcloud.nix>
2021-04-10 14:33:06 +02:00
<niveum/configs/moodle-dl/borsfaye.nix>
2020-10-31 20:51:25 +01:00
<niveum/configs/save-space.nix>
<niveum/configs/version.nix>
2021-06-08 22:04:17 +02:00
<niveum/configs/radio>
2020-11-11 10:18:04 +01:00
<niveum/configs/gitea.nix>
<niveum/configs/telegram-bots>
<niveum/configs/weechat.nix>
<niveum/configs/matterbridge.nix>
2020-10-31 20:51:25 +01:00
<niveum/modules/retiolum.nix>
];
boot.loader.grub.enable = true;
boot.loader.grub.version = 2;
2021-05-30 12:57:37 +02:00
nixpkgs.config = {
allowUnfree = true;
packageOverrides = pkgs: {
writeDashBin = pkgs.writers.writeDashBin;
writeDash = pkgs.writers.writeDash;
};
};
2021-01-31 10:08:09 +01:00
2020-10-31 20:51:25 +01:00
networking.useDHCP = false;
networking.interfaces.ens3.useDHCP = true;
networking.hostName = "makanek";
system.stateVersion = "20.03";
boot.loader.grub.devices = [ "/dev/sda" ];
services.openssh.enable = true;
networking.retiolum = {
ipv4 = "10.243.2.84";
2020-11-03 20:18:57 +01:00
ipv6 = "42:0:3c46:f7a9:1f0a:1b2b:822a:6050";
2020-10-31 20:51:25 +01:00
};
environment.etc."tinc/retiolum/rsa_key.priv" = {
text = builtins.readFile <system-secrets/retiolum.key>;
mode = "400";
};
networking.firewall.allowedTCPPorts = [ 80 443 ];
services.nginx = {
enable = true;
recommendedGzipSettings = true;
recommendedOptimisation = true;
recommendedProxySettings = true;
recommendedTlsSettings = true;
# Only allow PFS-enabled ciphers with AES256
sslCiphers = "AES256+EECDH:AES256+EDH:!aNULL";
};
security.acme = {
acceptTerms = true;
email = kieran.email;
};
environment.systemPackages = [ pkgs.vim pkgs.git pkgs.tmux pkgs.python3Packages.python ];
2020-10-31 20:51:25 +01:00
}