A new start
This commit is contained in:
commit
f4e2368893
93 changed files with 7621 additions and 0 deletions
79
systems/x86_64-linux/mx/acme.nix
Normal file
79
systems/x86_64-linux/mx/acme.nix
Normal file
|
@ -0,0 +1,79 @@
|
|||
{ pkgs, lib, config, ... }:
|
||||
{
|
||||
sops.secrets.internetbs = {
|
||||
sopsFile = ../../../.secrets/hetzner/internetbs.yaml; # bring your own password file
|
||||
};
|
||||
|
||||
security.acme = {
|
||||
acceptTerms = true;
|
||||
defaults = {
|
||||
email = "harald@hoyer.xyz";
|
||||
dnsProvider = "internetbs";
|
||||
credentialsFile = config.sops.secrets.internetbs.path;
|
||||
};
|
||||
certs = {
|
||||
"mx.surfsite.org" = { };
|
||||
|
||||
"surfsite.org" = {
|
||||
extraDomainNames = [
|
||||
"*.surfsite.org"
|
||||
];
|
||||
};
|
||||
|
||||
"hoyer.xyz" = {
|
||||
dnsProvider = "cloudflare";
|
||||
extraDomainNames = [
|
||||
"*.hoyer.xyz"
|
||||
"*.harald.hoyer.xyz"
|
||||
"*.hartwin.hoyer.xyz"
|
||||
];
|
||||
};
|
||||
|
||||
"hoyer.world" = {
|
||||
dnsProvider = "cloudflare";
|
||||
extraDomainNames = [
|
||||
"*.hoyer.world"
|
||||
"*.harald.hoyer.world"
|
||||
"*.hartwin.hoyer.world"
|
||||
];
|
||||
};
|
||||
|
||||
"hoyer.social" = {
|
||||
dnsProvider = "cloudflare";
|
||||
extraDomainNames = [
|
||||
"*.hoyer.social"
|
||||
"*.harald.hoyer.social"
|
||||
"*.hartwin.hoyer.social"
|
||||
];
|
||||
};
|
||||
|
||||
"hoyer.photos" = {
|
||||
dnsProvider = "cloudflare";
|
||||
extraDomainNames = [
|
||||
"*.hoyer.photos"
|
||||
"*.harald.hoyer.photos"
|
||||
"*.hartwin.hoyer.photos"
|
||||
];
|
||||
};
|
||||
|
||||
|
||||
"harald-hoyer.de" = {
|
||||
extraDomainNames = [
|
||||
"*.harald-hoyer.de"
|
||||
];
|
||||
};
|
||||
|
||||
"hartwin-hoyer.de" = {
|
||||
extraDomainNames = [
|
||||
"*.hartwin-hoyer.de"
|
||||
];
|
||||
};
|
||||
|
||||
"varlink.org" = {
|
||||
extraDomainNames = [
|
||||
"*.varlink.org"
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
18
systems/x86_64-linux/mx/backup.nix
Normal file
18
systems/x86_64-linux/mx/backup.nix
Normal file
|
@ -0,0 +1,18 @@
|
|||
{ pkgs, lib, ... }:
|
||||
{
|
||||
users.users.backup = {
|
||||
shell = pkgs.bash;
|
||||
isNormalUser = true;
|
||||
openssh.authorizedKeys.keys = [
|
||||
"restrict,command=\"/run/wrappers/bin/rrsync -ro /\" ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDQGdtB6BFdXN+cRepkzWhbG5KRIM5nXmHiw1K+CEhGihwWsNVKGgU/q4rePK6PVNflTIoHUfL30jkA7H8VpSzu0XOa97Tqf+sF9VQOFrMjpf2rOWv38nc2GnKpnUu68c17KRZ+i8cnPZH0VUqRzaY/1IPMFH3OYO4qHJAEN5oAsyMFI9pbqFLqRnwNALjxf8fUvR/XB88zt3P34vFFer15FtLr4dlIzoEFGdUSOErmGJGmDzTptMqi/t0kn2AgaBKzMxwGTDUj6adU6KKBERj4ii3ekOrPwcNjsws3Mtlm5p8ycUkwUFoIiXukF6XRzCRSWMbZOgSnu2TfC6jRRrdbMNWn4QGF/jdBvvKcBoD4sChzpG6aF4m+7ue0QuHES7Kd2Rwnq0jbesGuBnRciDN+jssGvxZKX7XEialuXiaTQ4jPUA4zgWq474CR6ksuxpUDlKpH+leWPLtuKlhEZZnJHCMhz8Ewk/ZwiNSbLO97cwJciBM71orGWpFxHciT1QE= root@sgx"
|
||||
];
|
||||
};
|
||||
|
||||
security.wrappers.rrsync = {
|
||||
source = "${pkgs.rrsync.out}/bin/rrsync";
|
||||
owner = "backup";
|
||||
group = "users";
|
||||
permissions = "u=rwx,g=,o=";
|
||||
capabilities = "cap_dac_read_search=+ep";
|
||||
};
|
||||
}
|
71
systems/x86_64-linux/mx/default.nix
Normal file
71
systems/x86_64-linux/mx/default.nix
Normal file
|
@ -0,0 +1,71 @@
|
|||
{ pkgs, lib, ... }:
|
||||
{
|
||||
imports = [
|
||||
./hardware-configuration.nix
|
||||
./rspamd.nix
|
||||
./goaccess.nix
|
||||
./nextcloud.nix
|
||||
./backup.nix
|
||||
./users.nix
|
||||
./kicker.nix
|
||||
./mailserver.nix
|
||||
./acme.nix
|
||||
./forgejo.nix
|
||||
./nginx.nix
|
||||
./network.nix
|
||||
];
|
||||
|
||||
metacfg = {
|
||||
base.enable = true;
|
||||
nix.enable = true;
|
||||
podman.enable = true;
|
||||
secureboot.enable = false;
|
||||
};
|
||||
|
||||
security = {
|
||||
tpm2.enable = lib.mkDefault true;
|
||||
tpm2.abrmd.enable = lib.mkDefault true;
|
||||
};
|
||||
|
||||
system.autoUpgrade = {
|
||||
enable = true;
|
||||
dates = "04:00";
|
||||
operation = "switch";
|
||||
allowReboot = true;
|
||||
flake = lib.mkForce "git+file:///var/lib/gitea/repositories/harald/nixcfg.git#mx";
|
||||
};
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
age
|
||||
apacheHttpd # for mkpasswd
|
||||
efibootmgr
|
||||
fgallery
|
||||
git
|
||||
htop
|
||||
mdadm
|
||||
rrsync
|
||||
tpm2-pkcs11
|
||||
tpm2-pkcs11.out
|
||||
tpm2-tools
|
||||
zola
|
||||
];
|
||||
|
||||
sops.age.sshKeyPaths = [ "/var/lib/secrets/ssh_host_ed25519_key" ];
|
||||
|
||||
services.openssh = {
|
||||
enable = true;
|
||||
hostKeys = [
|
||||
{
|
||||
path = "/var/lib/secrets/ssh_host_ed25519_key";
|
||||
type = "ed25519";
|
||||
}
|
||||
{
|
||||
path = "/var/lib/secrets/ssh_host_rsa_key";
|
||||
type = "rsa";
|
||||
bits = 4096;
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
system.stateVersion = "23.05";
|
||||
}
|
54
systems/x86_64-linux/mx/forgejo.nix
Normal file
54
systems/x86_64-linux/mx/forgejo.nix
Normal file
|
@ -0,0 +1,54 @@
|
|||
{ pkgs, lib, config, ... }:
|
||||
{
|
||||
sops.secrets."postgres/gitea_dbpass" = {
|
||||
sopsFile = ../../../.secrets/hetzner/postgres.yaml; # bring your own password file
|
||||
owner = config.services.forgejo.user;
|
||||
};
|
||||
|
||||
services.forgejo = {
|
||||
enable = true;
|
||||
user = "gitea";
|
||||
group = "gitea";
|
||||
stateDir = "/var/lib/gitea";
|
||||
database = {
|
||||
name = "gitea";
|
||||
user = "gitea";
|
||||
type = "postgres";
|
||||
passwordFile = config.sops.secrets."postgres/gitea_dbpass".path;
|
||||
};
|
||||
settings.service.DISABLE_REGISTRATION = true;
|
||||
settings.server = {
|
||||
DOMAIN = "git.hoyer.xyz";
|
||||
ROOT_URL = "https://git.hoyer.xyz/";
|
||||
HTTP_PORT = 3001;
|
||||
};
|
||||
settings.log.LEVEL = "Warn";
|
||||
};
|
||||
|
||||
users.users.gitea = {
|
||||
home = "/var/lib/gitea";
|
||||
useDefaultShell = true;
|
||||
group = "gitea";
|
||||
isSystemUser = true;
|
||||
};
|
||||
|
||||
users.groups.gitea = { };
|
||||
|
||||
services.postgresql = {
|
||||
package = pkgs.postgresql_14;
|
||||
ensureDatabases = [
|
||||
config.services.forgejo.database.name
|
||||
"nextcloud"
|
||||
];
|
||||
ensureUsers = [
|
||||
{
|
||||
name = config.services.forgejo.database.user;
|
||||
ensureDBOwnership = true;
|
||||
}
|
||||
{
|
||||
name = "nextcloud";
|
||||
ensureDBOwnership = true;
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
26
systems/x86_64-linux/mx/goaccess.nix
Normal file
26
systems/x86_64-linux/mx/goaccess.nix
Normal file
|
@ -0,0 +1,26 @@
|
|||
{ pkgs, lib, ... }:
|
||||
{
|
||||
systemd.timers."goaccess" = {
|
||||
wantedBy = [ "timers.target" ];
|
||||
timerConfig = {
|
||||
OnCalendar = "*:0/15";
|
||||
Unit = "goaccess.service";
|
||||
};
|
||||
};
|
||||
|
||||
systemd.services."goaccess" = {
|
||||
script = ''
|
||||
set -eu
|
||||
${pkgs.gzip}/bin/zcat -f /var/log/nginx/access.log* | ${pkgs.goaccess}/bin/goaccess --log-format=VCOMBINED -o /var/www/hoyer.xyz/html/stats/index.html -
|
||||
${pkgs.gzip}/bin/zcat -f /var/log/nginx/access.log* | ${pkgs.gnugrep}/bin/egrep '^harald.hoyer.xyz' | ${pkgs.goaccess}/bin/goaccess --log-format=VCOMBINED -o /var/www/hoyer.xyz/html/stats/harald-hoyer.html -
|
||||
${pkgs.gzip}/bin/zcat -f /var/log/nginx/access.log* | ${pkgs.gnugrep}/bin/egrep '^hartwin.hoyer.xyz' | ${pkgs.goaccess}/bin/goaccess --log-format=VCOMBINED -o /var/www/hoyer.xyz/html/stats/hartwin-hoyer.html -
|
||||
${pkgs.gzip}/bin/zcat -f /var/log/nginx/access.log* | ${pkgs.gnugrep}/bin/egrep '^git.hoyer.xyz' | ${pkgs.goaccess}/bin/goaccess --log-format=VCOMBINED -o /var/www/hoyer.xyz/html/stats/git-hoyer.html -
|
||||
${pkgs.gzip}/bin/zcat -f /var/log/nginx/access.log* | ${pkgs.gnugrep}/bin/egrep '^nc.hoyer.xyz' | ${pkgs.goaccess}/bin/goaccess --log-format=VCOMBINED -o /var/www/hoyer.xyz/html/stats/nc-hoyer.html -
|
||||
${pkgs.gzip}/bin/zcat -f /var/log/nginx/access.log* | ${pkgs.gnugrep}/bin/egrep '^kicker.surfsite.org' | ${pkgs.goaccess}/bin/goaccess --log-format=VCOMBINED -o /var/www/hoyer.xyz/html/stats/kicker.html -
|
||||
'';
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
User = "root";
|
||||
};
|
||||
};
|
||||
}
|
45
systems/x86_64-linux/mx/hardware-configuration.nix
Normal file
45
systems/x86_64-linux/mx/hardware-configuration.nix
Normal file
|
@ -0,0 +1,45 @@
|
|||
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||
# and may be overwritten by future invocations. Please make changes
|
||||
# to /etc/nixos/configuration.nix instead.
|
||||
{ lib, pkgs, modulesPath, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
(modulesPath + "/installer/scan/not-detected.nix")
|
||||
];
|
||||
|
||||
boot.kernelPackages = lib.mkForce pkgs.linuxPackages;
|
||||
|
||||
boot.initrd.luks.devices.crypted = {
|
||||
device = "/dev/md/raid1";
|
||||
preLVM = true;
|
||||
};
|
||||
|
||||
boot.initrd.availableKernelModules = [
|
||||
"xhci_pci"
|
||||
"ahci"
|
||||
"nvme"
|
||||
"sd_mod"
|
||||
"tpm"
|
||||
"tpm_tis"
|
||||
"trusted"
|
||||
"tpm_crb"
|
||||
"tpm_tis_core"
|
||||
"rng_core"
|
||||
];
|
||||
|
||||
|
||||
boot.swraid.enable = true;
|
||||
boot.swraid.mdadmConf = ''
|
||||
MAILADDR admin@hoyer.xyz
|
||||
'';
|
||||
disko.devices = import ./server-raid.nix {
|
||||
inherit lib;
|
||||
disks = [ "/dev/sda" "/dev/sdb" ];
|
||||
};
|
||||
|
||||
swapDevices = [{ device = "/swapfile"; }];
|
||||
|
||||
|
||||
|
||||
}
|
17
systems/x86_64-linux/mx/kicker.nix
Normal file
17
systems/x86_64-linux/mx/kicker.nix
Normal file
|
@ -0,0 +1,17 @@
|
|||
{ pkgs, lib, ... }:
|
||||
{
|
||||
virtualisation.oci-containers.containers = {
|
||||
kicker = {
|
||||
image = "quay.io/kicker/kicker:live";
|
||||
ports = [ "127.0.0.1:8087:80" ];
|
||||
volumes = [
|
||||
"/home/hartwin/kicker/.htaccess:/app/public/.htaccess"
|
||||
"/home/hartwin/kicker/.htpasswd:/app/public/.htpasswd"
|
||||
"/home/hartwin/kicker/live.db:/app/db/data/current.db"
|
||||
];
|
||||
extraOptions = [
|
||||
"--pull=always"
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
233
systems/x86_64-linux/mx/mailserver.nix
Normal file
233
systems/x86_64-linux/mx/mailserver.nix
Normal file
|
@ -0,0 +1,233 @@
|
|||
{ pkgs, lib, config, ... }:
|
||||
{
|
||||
# email addresses git smudged
|
||||
mailserver = {
|
||||
enable = true;
|
||||
fqdn = "mx.surfsite.org";
|
||||
sendingFqdn = "mx.surfsite.org";
|
||||
domains = [
|
||||
"harald-hoyer.de"
|
||||
"hartwin-hoyer.de"
|
||||
"herward-hoyer.de"
|
||||
"meike-knutz.de"
|
||||
"gerlinde-hoyer.de"
|
||||
|
||||
"hoyer.xyz"
|
||||
"nc.hoyer.xyz"
|
||||
"harald.hoyer.xyz"
|
||||
|
||||
"varlink.org"
|
||||
"surfsite.org"
|
||||
"myprivacy.tools"
|
||||
"hoyer.social"
|
||||
"hoyer.world"
|
||||
"hoyer.photos"
|
||||
"harald.hoyer.photos"
|
||||
"hartwin.hoyer.photos"
|
||||
"mx.surfsite.org"
|
||||
];
|
||||
|
||||
extraVirtualAliases = {
|
||||
"znk@ublre.klm" = [
|
||||
"unenyq@ublre.klm"
|
||||
"zu@ublre.klm"
|
||||
];
|
||||
|
||||
"sryvk@ublre.klm" = [
|
||||
"unenyq@ublre.klm"
|
||||
"zu@ublre.klm"
|
||||
];
|
||||
|
||||
"zhu@ublre.klm" = [
|
||||
"unenyq@ublre.klm"
|
||||
"zu@ublre.klm"
|
||||
];
|
||||
|
||||
"xvpxre@fhesfvgr.bet" = [
|
||||
"unenyq@ublre.klm"
|
||||
"unegjva@ublre.klm"
|
||||
];
|
||||
};
|
||||
# A list of all login accounts. To create the password hashes, use
|
||||
# nix-shell -p mkpasswd --run 'mkpasswd -sm bcrypt'
|
||||
loginAccounts = {
|
||||
"zu@ublre.klm" = {
|
||||
hashedPasswordFile = "/ubzr/unenyq/frpergf/zu@ublre.klm";
|
||||
aliases = [
|
||||
"zrvxr@unenyq-ublre.qr"
|
||||
"zrvxr@zrvxr-xahgm.qr"
|
||||
"zrvxr.ublre@zrvxr-xahgm.qr"
|
||||
"zrvxr@ublre.klm"
|
||||
];
|
||||
};
|
||||
"nyrk@ublre.klm" = {
|
||||
hashedPasswordFile = "/home/hartwin/secrets/alex-mail";
|
||||
aliases = [
|
||||
"nyrk@unegjva-ublre.qr"
|
||||
"nyrk.ublre@unegjva-ublre.qr"
|
||||
"nyrk@fhesfvgr.bet"
|
||||
"nyrk.ublre@fhesfvgr.bet"
|
||||
"nyrknaqre@ublre.klm"
|
||||
];
|
||||
};
|
||||
"wna@ublre.klm" = {
|
||||
hashedPasswordFile = "/home/hartwin/secrets/jan-mail";
|
||||
aliases = [
|
||||
"wna@unegjva-ublre.qr"
|
||||
"wna.ublre@unegjva-ublre.qr"
|
||||
"wna@fhesfvgr.bet"
|
||||
"wna.ublre@fhesfvgr.bet"
|
||||
];
|
||||
};
|
||||
"unaanu@ublre.klm" = {
|
||||
hashedPasswordFile = "/home/hartwin/secrets/hannah-mail";
|
||||
aliases = [
|
||||
"unaanu@unegjva-ublre.qr"
|
||||
"unaanu.ublre@unegjva-ublre.qr"
|
||||
"unaanu@fhesfvgr.bet"
|
||||
"unaanu.ublre@fhesfvgr.bet"
|
||||
];
|
||||
};
|
||||
"fgrssv@ublre.klm" = {
|
||||
hashedPasswordFile = "/home/hartwin/secrets/steffi-mail";
|
||||
aliases = [
|
||||
"fgrssv@fhesfvgr.bet"
|
||||
"fgrsnavrublre@fhesfvgr.bet"
|
||||
"fgrsnavr.ublre@fhesfvgr.bet"
|
||||
"fgrsnavr.ublre@ublre.klm"
|
||||
"fgrsnavr@ublre.klm"
|
||||
];
|
||||
};
|
||||
"unegjva@ublre.klm" = {
|
||||
hashedPasswordFile = "/home/hartwin/secrets/hartwin-mail";
|
||||
aliases = [
|
||||
"unegjva.ublre@unegjva-ublre.qr"
|
||||
"znvy@unegjva-ublre.qr"
|
||||
"unegjva@unegjva-ublre.qr"
|
||||
"lbhghor@unegjva-ublre.qr"
|
||||
"unegjva@ap.ublre.klm"
|
||||
"unegjva@ublre.cubgbf"
|
||||
"jroznfgre@unegjva.ublre.cubgbf"
|
||||
];
|
||||
};
|
||||
"uublre@urejneq-ublre.qr" = {
|
||||
hashedPasswordFile = "/home/hhoyer/secrets/hhoyer-mail";
|
||||
aliases = [
|
||||
"urejneq@urejneq-ublre.qr"
|
||||
"urejneq@if189018.ifreire.qr"
|
||||
"thn808@urejneq-ublre.qr"
|
||||
"znvy@urejneq-ublre.qr"
|
||||
"urejneq.ublre@urejneq-ublre.qr"
|
||||
"uublre@fhesfvgr.bet"
|
||||
"uublre@ublre.klm"
|
||||
"urejneq@ublre.klm"
|
||||
"urejneq@ap.ublre.klm"
|
||||
];
|
||||
};
|
||||
"unenyq@ublre.klm" = {
|
||||
hashedPasswordFile = "/ubzr/unenyq/frpergf/unenyq@ublre.klm";
|
||||
aliases = [
|
||||
"unenyq@zk.fhesfvgr.bet"
|
||||
"ebbg@zk.fhesfvgr.bet"
|
||||
|
||||
"nohfr@zk.fhesfvgr.bet"
|
||||
"nohfr@fhesfvgr.bet"
|
||||
"nohfr@unegjva-ublre.qr"
|
||||
"nohfr@urejneq-ublre.qr"
|
||||
"nohfr@zrvxr-xahgm.qr"
|
||||
"nohfr@treyvaqr-ublre.qr"
|
||||
"nohfr@ublre.klm"
|
||||
"nohfr@unenyq.ublre.klm"
|
||||
"nohfr@ineyvax.bet"
|
||||
"nohfr@zlcevinpl.gbbyf"
|
||||
"nohfr@ublre.fbpvny"
|
||||
"nohfr@ublre.jbeyq"
|
||||
"nohfr@ublre.cubgbf"
|
||||
|
||||
"cbfgznfgre@zk.fhesfvgr.bet"
|
||||
"cbfgznfgre@fhesfvgr.bet"
|
||||
"cbfgznfgre@unegjva-ublre.qr"
|
||||
"cbfgznfgre@urejneq-ublre.qr"
|
||||
"cbfgznfgre@zrvxr-xahgm.qr"
|
||||
"cbfgznfgre@treyvaqr-ublre.qr"
|
||||
"cbfgznfgre@ublre.klm"
|
||||
"cbfgznfgre@unenyq.ublre.klm"
|
||||
"cbfgznfgre@ineyvax.bet"
|
||||
"cbfgznfgre@zlcevinpl.gbbyf"
|
||||
"cbfgznfgre@ublre.fbpvny"
|
||||
"cbfgznfgre@ublre.jbeyq"
|
||||
"cbfgznfgre@ublre.cubgbf"
|
||||
|
||||
"jroznfgre@ublre.klm"
|
||||
"jroznfgre@fhesfvgr.bet"
|
||||
"jroznfgre@unenyq.ublre.klm"
|
||||
"jroznfgre@ineyvax.bet"
|
||||
"jroznfgre@zlcevinpl.gbbyf"
|
||||
"jroznfgre@ublre.fbpvny"
|
||||
"jroznfgre@ublre.jbeyq"
|
||||
"jroznfgre@ublre.cubgbf"
|
||||
"jroznfgre@unenyq.ublre.cubgbf"
|
||||
|
||||
"nqzva@ublre.klm"
|
||||
"nqzva@unenyq.ublre.klm"
|
||||
"nqzva@ap.ublre.klm"
|
||||
"nqzva@zk.fhesfvgr.bet"
|
||||
"nqzva@ublre.fbpvny"
|
||||
"nqzva@ublre.jbeyq"
|
||||
"nqzva@ublre.cubgbf"
|
||||
|
||||
"unenyq@fhesfvgr.bet"
|
||||
"unenyq@ublre.klm"
|
||||
"unenyq@ap.ublre.klm"
|
||||
"unenyq@ineyvax.bet"
|
||||
"unenyq@zlcevinpl.gbbyf"
|
||||
"unenyq@ublre.jbeyq"
|
||||
"unenyq@ublre.fbpvny"
|
||||
"unenyq@ublre.cubgbf"
|
||||
|
||||
"@unenyq.ublre.klm"
|
||||
"@unenyq-ublre.qr"
|
||||
|
||||
"cnlcny-unenyq@ublre.klm"
|
||||
"cubgb-unenyq@ublre.klm"
|
||||
|
||||
"so@fhesfvgr.bet"
|
||||
"servshax@fhesfvgr.bet"
|
||||
"sop@fhesfvgr.bet"
|
||||
"zvar@fhesfvgr.bet"
|
||||
"ovgpbva@fhesfvgr.bet"
|
||||
"ovgpbva@ublre.klm"
|
||||
"ebhyrggr@fhesfvgr.bet"
|
||||
"tvguho@fhesfvgr.bet"
|
||||
"zhn@fhesfvgr.bet"
|
||||
"nyvrkcerff@fhesfvgr.bet"
|
||||
|
||||
# Max
|
||||
"znk@ublre.klm"
|
||||
"znk.ublre@ublre.klm"
|
||||
"znkvzvyvna@ublre.klm"
|
||||
"znkvzvyvna.ublre@ublre.klm"
|
||||
|
||||
# Felix
|
||||
"sryvk@ublre.klm"
|
||||
"sryvk.ublre@ublre.klm"
|
||||
];
|
||||
};
|
||||
};
|
||||
certificateScheme = "acme";
|
||||
};
|
||||
|
||||
services.roundcube = {
|
||||
enable = true;
|
||||
# this is the url of the vhost, not necessarily the same as the fqdn of
|
||||
# the mailserver
|
||||
hostName = "webmail.hoyer.xyz";
|
||||
extraConfig = ''
|
||||
# starttls needed for authentication, so the fqdn required to match
|
||||
# the certificate
|
||||
$config['smtp_server'] = "tls://${config.mailserver.fqdn}";
|
||||
$config['smtp_user'] = "%u";
|
||||
$config['smtp_pass'] = "%p";
|
||||
'';
|
||||
};
|
||||
}
|
45
systems/x86_64-linux/mx/network.nix
Normal file
45
systems/x86_64-linux/mx/network.nix
Normal file
|
@ -0,0 +1,45 @@
|
|||
{ pkgs, lib, ... }:
|
||||
{
|
||||
services.fail2ban.enable = true;
|
||||
services.resolved.domains = [
|
||||
"surfsite.org"
|
||||
"hoyer.xyz"
|
||||
];
|
||||
services.resolved.extraConfig = "ReadEtcHosts=no";
|
||||
services.nscd.enableNsncd = false;
|
||||
|
||||
networking.firewall.allowedTCPPorts = [ 80 443 ];
|
||||
networking.firewall.allowPing = true;
|
||||
|
||||
networking.hostName = "mx"; # Define your hostname.
|
||||
networking.domain = "surfsite.org";
|
||||
networking.dhcpcd.enable = false;
|
||||
networking.firewall.logRefusedConnections = false;
|
||||
networking.networkmanager.enable = false;
|
||||
networking.useDHCP = false;
|
||||
networking.useNetworkd = true;
|
||||
networking.wireless.enable = false;
|
||||
networking.defaultGateway.address = "95.216.66.129";
|
||||
networking.defaultGateway.interface = "enp0s31f6";
|
||||
#networking.nameservers = [ "1.1.1.1" "8.8.8.8" ];
|
||||
networking.enableIPv6 = true;
|
||||
|
||||
networking.interfaces.enp0s31f6 = {
|
||||
ipv6 = {
|
||||
addresses = [{
|
||||
address = "2a01:4f9:2b:2e3::2"; # Your IPv6 here
|
||||
prefixLength = 64;
|
||||
}];
|
||||
# Default IPv6 route
|
||||
routes = [{
|
||||
address = "::";
|
||||
prefixLength = 0;
|
||||
via = "fe80::1";
|
||||
}];
|
||||
};
|
||||
ipv4.addresses = [{
|
||||
address = "95.216.66.178";
|
||||
prefixLength = 26;
|
||||
}];
|
||||
};
|
||||
}
|
29
systems/x86_64-linux/mx/nextcloud.nix
Normal file
29
systems/x86_64-linux/mx/nextcloud.nix
Normal file
|
@ -0,0 +1,29 @@
|
|||
{ pkgs, lib, ... }:
|
||||
{
|
||||
systemd.services."nextcloud-setup".requires = [ "postgresql.service" ];
|
||||
systemd.services."nextcloud-setup".after = [ "postgresql.service" ];
|
||||
|
||||
environment.etc."nextcloud-admin-pass".text = "test123";
|
||||
services.nextcloud = {
|
||||
enable = true;
|
||||
package = pkgs.nextcloud28;
|
||||
hostName = "nc.hoyer.xyz";
|
||||
https = true;
|
||||
configureRedis = true;
|
||||
extraOptions = {
|
||||
mail_smtpmode = "sendmail";
|
||||
mail_sendmailmode = "pipe";
|
||||
};
|
||||
phpOptions = {
|
||||
upload_max_filesize = lib.mkForce "1G";
|
||||
post_max_size = lib.mkForce "1G";
|
||||
"opcache.interned_strings_buffer" = "16";
|
||||
};
|
||||
config.adminpassFile = "/etc/nextcloud-admin-pass";
|
||||
config.defaultPhoneRegion = "DE";
|
||||
config.dbtype = "pgsql";
|
||||
config.dbname = "nextcloud";
|
||||
config.dbhost = "/run/postgresql";
|
||||
config.dbuser = "nextcloud";
|
||||
};
|
||||
}
|
166
systems/x86_64-linux/mx/nginx.nix
Normal file
166
systems/x86_64-linux/mx/nginx.nix
Normal file
|
@ -0,0 +1,166 @@
|
|||
{ pkgs, lib, ... }:
|
||||
{
|
||||
users.users.nginx.extraGroups = [ "acme" ];
|
||||
services.nginx = {
|
||||
enable = true;
|
||||
appendHttpConfig = ''
|
||||
log_format vcombined '$host:$server_port '
|
||||
'$remote_addr - $remote_user [$time_local] '
|
||||
'"$request" $status $body_bytes_sent '
|
||||
'"$http_referer" "$http_user_agent"';
|
||||
access_log /var/log/nginx/access.log vcombined;
|
||||
'';
|
||||
recommendedGzipSettings = true;
|
||||
recommendedOptimisation = true;
|
||||
recommendedProxySettings = true;
|
||||
recommendedTlsSettings = true;
|
||||
virtualHosts = {
|
||||
"00000" = {
|
||||
useACMEHost = "hoyer.xyz";
|
||||
serverName = "_";
|
||||
globalRedirect = "hoyer.xyz";
|
||||
addSSL = true;
|
||||
};
|
||||
|
||||
"hoyer.photos" = {
|
||||
enableACME = false;
|
||||
useACMEHost = "hoyer.photos";
|
||||
forceSSL = true;
|
||||
root = "/var/www/hoyer.xyz/html";
|
||||
};
|
||||
|
||||
|
||||
"hoyer.world" = {
|
||||
enableACME = false;
|
||||
useACMEHost = "hoyer.world";
|
||||
forceSSL = true;
|
||||
root = "/var/www/hoyer.xyz/html";
|
||||
};
|
||||
|
||||
"hoyer.social" = {
|
||||
enableACME = false;
|
||||
useACMEHost = "hoyer.social";
|
||||
forceSSL = true;
|
||||
root = "/var/www/hoyer.xyz/html";
|
||||
};
|
||||
|
||||
"hoyer.xyz" = {
|
||||
# serverName = "hoyer.xyz";
|
||||
serverAliases = [
|
||||
"www.hoyer.xyz"
|
||||
];
|
||||
useACMEHost = "hoyer.xyz";
|
||||
enableACME = false;
|
||||
forceSSL = true;
|
||||
root = "/var/www/hoyer.xyz/html";
|
||||
locations."/stats" = {
|
||||
basicAuthFile = "/var/www/hoyer.xyz/stats.htaccess";
|
||||
};
|
||||
};
|
||||
|
||||
"surfsite.org" = {
|
||||
useACMEHost = "surfsite.org";
|
||||
enableACME = false;
|
||||
forceSSL = true;
|
||||
root = "/var/www/surfsite.org";
|
||||
};
|
||||
|
||||
"kicker.surfsite.org" = {
|
||||
useACMEHost = "surfsite.org";
|
||||
enableACME = false;
|
||||
forceSSL = true;
|
||||
locations."/" = {
|
||||
proxyPass = "http://localhost:8087/";
|
||||
};
|
||||
};
|
||||
|
||||
"git.hoyer.xyz" = {
|
||||
useACMEHost = "hoyer.xyz";
|
||||
enableACME = false;
|
||||
forceSSL = true;
|
||||
locations."/" = {
|
||||
proxyPass = "http://localhost:3001/";
|
||||
};
|
||||
};
|
||||
|
||||
"webmail.hoyer.xyz" = {
|
||||
useACMEHost = "hoyer.xyz";
|
||||
enableACME = false;
|
||||
forceSSL = true;
|
||||
};
|
||||
|
||||
"harald.hoyer.photos" = {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
root = "/var/www/photo.harald-hoyer.de/html";
|
||||
};
|
||||
"photo.harald-hoyer.de" = {
|
||||
useACMEHost = "harald-hoyer.de";
|
||||
forceSSL = true;
|
||||
root = "/var/www/photo.harald-hoyer.de/html";
|
||||
};
|
||||
"photo-harald.hoyer.xyz" = {
|
||||
serverAliases = [ "photo.harald.hoyer.xyz" ];
|
||||
useACMEHost = "hoyer.xyz";
|
||||
forceSSL = true;
|
||||
root = "/var/www/photo.harald-hoyer.de/html";
|
||||
};
|
||||
|
||||
"harald-hoyer.de" = {
|
||||
serverAliases = [
|
||||
"www.harald-hoyer.de"
|
||||
];
|
||||
useACMEHost = "harald-hoyer.de";
|
||||
globalRedirect = "harald.hoyer.xyz";
|
||||
forceSSL = true;
|
||||
};
|
||||
"harald.hoyer.xyz" = {
|
||||
serverAliases = [
|
||||
"www.harald.hoyer.xyz"
|
||||
];
|
||||
useACMEHost = "hoyer.xyz";
|
||||
root = "/var/www/harald.hoyer.xyz/html/";
|
||||
extraConfig = ''
|
||||
rewrite ^/feed/rss$ /rss.xml permanent;
|
||||
rewrite ^/feed/rss/$ /rss.xml permanent;
|
||||
rewrite ^/feed/$ /rss.xml permanent;
|
||||
rewrite ^/feed/rss/index.html$ /rss.xml permanent;
|
||||
rewrite ^/fedora/fedora/RSS2$ /tags/fedora/rss.xml permanent;
|
||||
rewrite ^/linux/linux/RSS2$ /tags/linux/rss.xml permanent;
|
||||
rewrite ^/linux/feed$ /tags/linux/rss.xml permanent;
|
||||
rewrite ^/wp-rss2.php$ /rss.xml permanent;
|
||||
rewrite ^/aggregator/rss.xml$ /rss.xml permanent;
|
||||
rewrite ^/personal/blog/aggregator/RSS$ /rss.xml permanent;
|
||||
rewrite ^/personal/blog/aggregator/RSS2$ /rss.xml permanent;
|
||||
rewrite ^/aggregator/RSS$ /rss.xml permanent;
|
||||
rewrite ^/aggregator/RSS2$ /rss.xml permanent;
|
||||
rewrite ^/wp-commentsrss2.php$ /rss.xml permanent;
|
||||
'';
|
||||
forceSSL = true;
|
||||
};
|
||||
|
||||
"hartwin-hoyer.de" = {
|
||||
serverAliases = [
|
||||
"www.hartwin-hoyer.de"
|
||||
];
|
||||
useACMEHost = "hartwin-hoyer.de";
|
||||
globalRedirect = "hartwin.hoyer.xyz";
|
||||
forceSSL = true;
|
||||
};
|
||||
"hartwin.hoyer.xyz" = {
|
||||
serverAliases = [
|
||||
"testhartwin.hoyer.xyz"
|
||||
"www.hartwin.hoyer.xyz"
|
||||
];
|
||||
useACMEHost = "hoyer.xyz";
|
||||
root = "/var/www/hartwin.hoyer.xyz/html/";
|
||||
forceSSL = true;
|
||||
};
|
||||
|
||||
"nc.hoyer.xyz" = {
|
||||
useACMEHost = "hoyer.xyz";
|
||||
forceSSL = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
40
systems/x86_64-linux/mx/rspamd.nix
Normal file
40
systems/x86_64-linux/mx/rspamd.nix
Normal file
|
@ -0,0 +1,40 @@
|
|||
{ pkgs, lib, ... }:
|
||||
{
|
||||
services.rspamd.workers.controller.bindSockets = [{
|
||||
socket = "/run/rspamd/worker-controller.sock";
|
||||
mode = "0660";
|
||||
}];
|
||||
services.rspamd.locals = {
|
||||
"maps.d/spf_whitelist.inc.local" = {
|
||||
text = ''
|
||||
epicgames.com
|
||||
dmail.ai
|
||||
'';
|
||||
};
|
||||
"maps.d/spf_dkim_whitelist.inc.local" = {
|
||||
text = ''
|
||||
epicgames.com
|
||||
dmail.ai
|
||||
'';
|
||||
};
|
||||
"maps.d/dmarc_whitelist.inc.local" = {
|
||||
text = ''
|
||||
epicgames.com
|
||||
dmail.ai
|
||||
'';
|
||||
};
|
||||
"greylist-whitelist-domains.inc" = {
|
||||
text = ''
|
||||
dmail.ai
|
||||
epicgames.com
|
||||
'';
|
||||
};
|
||||
};
|
||||
services.rspamd.extraConfig = ''
|
||||
actions {
|
||||
reject = null;
|
||||
greylist = 4; # Apply greylisting when reaching this score
|
||||
add_header = 4; # Add header when reaching this score
|
||||
}
|
||||
'';
|
||||
}
|
77
systems/x86_64-linux/mx/server-raid.nix
Normal file
77
systems/x86_64-linux/mx/server-raid.nix
Normal file
|
@ -0,0 +1,77 @@
|
|||
{ disks ? [ "/dev/sda" "/dev/sdb" ], ... }: {
|
||||
disk = {
|
||||
one = {
|
||||
type = "disk";
|
||||
device = builtins.elemAt disks 0;
|
||||
content = {
|
||||
type = "gpt";
|
||||
partitions = {
|
||||
boot = {
|
||||
size = "1M";
|
||||
type = "EF02";
|
||||
};
|
||||
ESP = {
|
||||
size = "256M";
|
||||
type = "EF00";
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "vfat";
|
||||
mountpoint = "/boot";
|
||||
};
|
||||
};
|
||||
mdadm = {
|
||||
size = "100%";
|
||||
content = {
|
||||
type = "mdraid";
|
||||
name = "raid1";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
two = {
|
||||
type = "disk";
|
||||
device = builtins.elemAt disks 1;
|
||||
content = {
|
||||
type = "gpt";
|
||||
partitions = {
|
||||
boot = {
|
||||
size = "1M";
|
||||
type = "EF02";
|
||||
};
|
||||
ESP = {
|
||||
size = "256M";
|
||||
type = "EF00";
|
||||
};
|
||||
mdadm = {
|
||||
size = "100%";
|
||||
content = {
|
||||
type = "mdraid";
|
||||
name = "raid1";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
mdadm = {
|
||||
raid1 = {
|
||||
type = "mdadm";
|
||||
level = 1;
|
||||
content = {
|
||||
type = "luks";
|
||||
name = "crypted";
|
||||
extraOpenArgs = [ "--allow-discards" ];
|
||||
settings = {
|
||||
allowDiscards = true;
|
||||
};
|
||||
initrdUnlock = false;
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "btrfs";
|
||||
mountpoint = "/";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
23
systems/x86_64-linux/mx/users.nix
Normal file
23
systems/x86_64-linux/mx/users.nix
Normal file
|
@ -0,0 +1,23 @@
|
|||
{ pkgs, lib, ... }:
|
||||
{
|
||||
# Herward
|
||||
users.users.hhoyer = {
|
||||
shell = pkgs.bash;
|
||||
isNormalUser = true;
|
||||
description = "hhoyer";
|
||||
openssh.authorizedKeys.keys = [
|
||||
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCIlCnBiRkm8i/UQaTDv2UCO+mEzPC5OQ0e+DlzS1GVmJEjH5BqPosEivvDQheQP7WWNZOCWoHqAg8vvH8QpSA6AOqruvsWrbY1TmoMc4TlulgyEK5/z9aw/t3WUkQjj+fYeQbQXSNeT7pplN3hB49MCXAQNJ+LxnnntrZhp7tHRAsJFlGgK6NGFapCizeYt9DOqeh2KGTd+x9TXTa96ccWQTRovE5xWP/8X7LoejCl7sfe2dymeByU465Do+mvDs2DbyKI1XHlLpPZihsyxyU1/K0B9VF92U486vh8Ep3fnTgpu7D9n0KdN0wGMfSmH75rtrYZPiGvu6Qy0YzV6MUN newkex"
|
||||
];
|
||||
};
|
||||
|
||||
# Hartwin
|
||||
users.users.hartwin = {
|
||||
shell = pkgs.bash;
|
||||
isNormalUser = true;
|
||||
description = "hartwin";
|
||||
openssh.authorizedKeys.keys = [
|
||||
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDjeTezn11UITzlqfOS9U3/sOdEJ4au5MSo/vNUcMHVIfKWLXfOWH6skB2kVrRcSlevNydgWtmQfA/xD7n7Syx4esWLvaUUwRO75QNz8TJq9dgItxi6R+bxWlUqN79aAmNWQH6yftBs+bLDtTg7XABZYe2z53UcfLtG0iQOHG6mftcOL2YKyzdtd/1F7jgMmy2HJ1LzsFNb57hBQvA3cg+hDwXKfptrDh/8Xysm110vMj74T2ANbhmE3wT25PmUMN7B/sx0m7Rm7jg3COyLq6/MZzoFGyl+Kd9vxTPzp76aSq7bI70qGUzcq2aX6UnlkcrrAz2bzZBi5RMOHYO3QPmP hlh@aiur.localdomain"
|
||||
];
|
||||
};
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue