diff --git a/authentik.nix b/authentik.nix index da271f4..45f4e45 100644 --- a/authentik.nix +++ b/authentik.nix @@ -1,4 +1,10 @@ -{ config, lib, pkgs, ... }: { +{ + config, + lib, + pkgs, + ... +}: +{ users.groups.authentik = { }; users.users.authentik = { isSystemUser = true; diff --git a/configuration.nix b/configuration.nix index d446705..fb3c51f 100644 --- a/configuration.nix +++ b/configuration.nix @@ -1,19 +1,28 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: { - imports = - [ - ./hardware-configuration.nix - ./authentik.nix - ]; + imports = [ + ./hardware-configuration.nix + ./authentik.nix + ]; - security.pam.loginLimits = [{ - domain = "*"; - type = "soft"; - item = "nofile"; - value = "8192"; - }]; - nix.settings.experimental-features = [ "nix-command" "flakes" ]; + security.pam.loginLimits = [ + { + domain = "*"; + type = "soft"; + item = "nofile"; + value = "8192"; + } + ]; + nix.settings.experimental-features = [ + "nix-command" + "flakes" + ]; nix.settings.trusted-users = [ "administration" ]; nix.settings.download-buffer-size = 6710886400; # boot.loader.grub.enable = true; @@ -39,7 +48,10 @@ } ]; networking.defaultGateway.address = "172.31.1.1"; - networking.nameservers = [ "9.9.9.9" "1.1.1.1" ]; + networking.nameservers = [ + "9.9.9.9" + "1.1.1.1" + ]; time.timeZone = "Europe/Berlin"; @@ -98,7 +110,7 @@ hyperkitty = { enable = true; }; - serve.enable=true; + serve.enable = true; webHosts = [ "lists.${config.networking.domain}" ]; @@ -118,7 +130,11 @@ mailserver = { enable = true; fqdn = "mail.${config.networking.domain}"; - domains = [ "${config.networking.domain}" "lists.${config.networking.domain}" "mail.${config.networking.domain}" ]; + domains = [ + "${config.networking.domain}" + "lists.${config.networking.domain}" + "mail.${config.networking.domain}" + ]; ldap = { enable = true; bind = { @@ -126,11 +142,11 @@ passwordFile = "/var/lib/dovecot_ldap_passwd"; }; dovecot = { - #userFilter = "(&(objectClass=posixAccount)(cn=%u))"; - #passFilter = "(&(objectClass=posixAccount)(cn=%u))"; + #userFilter = "(&(objectClass=posixAccount)(cn=%u))"; + #passFilter = "(&(objectClass=posixAccount)(cn=%u))"; }; postfix = { - #filter = "(&(objectClass=posixUser)(cn=%s))"; + #filter = "(&(objectClass=posixUser)(cn=%s))"; }; searchBase = "dc=auth,dc=htw,dc=stura-dresden,dc=de"; uris = [ @@ -139,12 +155,12 @@ }; certificateScheme = "acme-nginx"; - enableImap = true; + enableImap = true; enableImapSsl = true; enableManageSieve = false; enableSubmission = true; enableSubmissionSsl = true; - extraVirtualAliases = {}; + extraVirtualAliases = { }; lmtpSaveToDetailMailbox = "no"; # DOS potential mailboxes = { Drafts = { @@ -172,14 +188,17 @@ 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 ]; + networking.firewall.allowedTCPPorts = [ + 25 + 80 + 443 + 597 + ]; system.stateVersion = "24.11"; } - diff --git a/flake.nix b/flake.nix index 0cdb51e..6c00a53 100644 --- a/flake.nix +++ b/flake.nix @@ -16,10 +16,10 @@ }; mailserver = { url = "git+https://gitlab.com/simple-nixos-mailserver/nixos-mailserver?ref=nixos-25.05"; -inputs = { + inputs = { nixpkgs.follows = "nixpkgs"; nixpkgs-25_05.follows = "nixpkgs"; - }; + }; }; # mailserver.url = "gitlab:simple-nixos-mailserver/nixos-mailserver/nixos-24.11"; disko = { @@ -28,20 +28,28 @@ inputs = { }; }; - outputs = { self, nixpkgs, authentik, mailserver, disko }: { - formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.nixpkgs-fmt; + outputs = + { + self, + nixpkgs, + authentik, + mailserver, + disko, + }: + { + formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.nixfmt-rfc-style; - nixosConfigurations = { - authentik = nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - modules = [ - ./configuration.nix - ./hetzner-disk.nix - disko.nixosModules.disko - authentik.nixosModules.default - mailserver.nixosModules.mailserver - ]; + nixosConfigurations = { + authentik = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = [ + ./configuration.nix + ./hetzner-disk.nix + disko.nixosModules.disko + authentik.nixosModules.default + mailserver.nixosModules.mailserver + ]; + }; }; }; - }; } diff --git a/hardware-configuration.nix b/hardware-configuration.nix index 499ea00..b92ae55 100644 --- a/hardware-configuration.nix +++ b/hardware-configuration.nix @@ -1,15 +1,27 @@ # 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. -{ config, lib, pkgs, modulesPath, ... }: +{ + config, + lib, + pkgs, + modulesPath, + ... +}: { - imports = - [ - (modulesPath + "/profiles/qemu-guest.nix") - ]; + imports = [ + (modulesPath + "/profiles/qemu-guest.nix") + ]; - boot.initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "virtio_pci" "virtio_scsi" "sd_mod" "sr_mod" ]; + boot.initrd.availableKernelModules = [ + "ata_piix" + "uhci_hcd" + "virtio_pci" + "virtio_scsi" + "sd_mod" + "sr_mod" + ]; boot.initrd.kernelModules = [ ]; boot.kernelModules = [ ]; boot.extraModulePackages = [ ];