stura-infra/configuration.nix

137 lines
3.4 KiB
Nix
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{ config, lib, pkgs, ... }:
{
imports =
[
./hardware-configuration.nix
./authentik.nix
];
security.pam.loginLimits = [{
domain = "*";
type = "soft";
item = "nofile";
value = "8192";
}];
nix.settings.experimental-features = [ "nix-command" "flakes" ];
nix.settings.download-buffer-size = 6710886400;
boot.loader.grub.enable = true;
boot.loader.grub.device = "/dev/sda"; # or "nodev" for efi only
networking.hostName = "authentik";
networking.interfaces.ens18.ipv4.addresses = [
{
address = "141.56.51.18";
prefixLength = 24;
}
];
networking.defaultGateway.address = "141.56.51.254";
networking.nameservers = [ "141.56.1.1" "141.56.1.2" ];
time.timeZone = "Europe/Berlin";
i18n.defaultLocale = "en_US.UTF-8";
console = {
font = "Lat2-Terminus16";
keyMap = lib.mkForce "de";
useXkbConfig = true; # use xkb.options in tty.
};
users.users.administration = {
isNormalUser = true;
extraGroups = [ "wheel" "docker" ]; # Enable sudo for the user.
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINABEf0jBjtDdezDDtvl1v27l0DbHP2XUgMARTZXC+MR goeranh@node5"
];
packages = with pkgs; [
];
};
environment.systemPackages = with pkgs; [
tmux
git
htop
neovim
];
services.openssh.enable = true;
services.dovecot2 = {
extraConfig = ''
auth_verbose = yes
auth_debug = yes
auth_debug_passwords = yes
'';
};
services.nginx.virtualHosts."auth.htw.stura-dresden.de".locations."/".extraConfig = ''
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
'';
mailserver = {
enable = true;
fqdn = "mail.htw.stura-dresden.de";
domains = [ "htw.stura-dresden.de" "mail.htw.stura-dresden.de" ];
ldap = {
enable = true;
bind = {
dn = "cn=ldapservice,ou=users,dc=auth,dc=htw,dc=stura-dresden,dc=de";
passwordFile = "/var/lib/dovecot_ldap_passwd";
};
dovecot = {
#userFilter = "(&(objectClass=posixAccount)(cn=%u))";
#passFilter = "(&(objectClass=posixAccount)(cn=%u))";
};
postfix = {
#filter = "(&(objectClass=posixUser)(cn=%s))";
};
searchBase = "dc=auth,dc=htw,dc=stura-dresden,dc=de";
uris = [
"ldap://localhost:389"
];
};
certificateScheme = "acme-nginx";
enableImap = true;
enableImapSsl = true;
enableManageSieve = false;
enableSubmission = true;
enableSubmissionSsl = true;
extraVirtualAliases = {};
lmtpSaveToDetailMailbox = "no"; # DOS potential
mailboxes = {
Drafts = {
auto = "subscribe";
specialUse = "Drafts";
};
Sent = {
auto = "subscribe";
specialUse = "Sent";
};
Spam = {
auto = "subscribe";
specialUse = "Junk";
};
Trash = {
auto = "subscribe";
specialUse = "Trash";
};
};
maxConnectionsPerUser = 10;
messageSizeLimit = 10 * 1000 * 1024; # 10 MiB
};
services.dovecot2.mailLocation = lib.mkForce "maildir:/var/vmail/%n";
services.postfix.relayHost = "141.56.51.14";
virtualisation.docker.enable = true;
security.acme.acceptTerms = true;
security.acme.defaults.email = "cert@stura.htw-dresden.de";
networking.firewall.allowedTCPPorts = [ 25 80 443 597 9000 ];
system.stateVersion = "24.11";
}