diff --git a/hosts/redmine/default.nix b/hosts/redmine/default.nix index a4e3697..a2f50b5 100644 --- a/hosts/redmine/default.nix +++ b/hosts/redmine/default.nix @@ -1,34 +1,60 @@ { config, - lib, pkgs, + lib, + modulesPath, ... }: + { + imports = [ - ./hardware-configuration.nix + "${modulesPath}/virtualisation/proxmox-lxc.nix" ]; + system.stateVersion = "22.11"; - networking.hostName = "redmine"; - networking.domain = "test.htw.stura-dresden.de"; - networking.interfaces.ens18.ipv4.addresses = [ - { - address = "141.56.51.1235"; - prefixLength = 24; - } - ]; - networking.defaultGateway.address = "141.56.51.254"; - - security.acme.acceptTerms = true; - security.acme.defaults.email = "cert@stura.htw-dresden.de"; - - networking.firewall.allowedTCPPorts = [ - 25 - 80 - 443 - 597 - ]; - - system.stateVersion = "24.11"; + networking = { + hostName = "pro"; + domain = "htw.stura-dresden.de"; + firewall.allowedTCPPorts = [ + 80 + 443 + ]; + }; + services = { + redmine = { + enable = true; + components.imagemagick = true; + components.minimagick_font_path = "${pkgs.liberation_ttf.outPath}/share/fonts/truetype/LiberationSans-Regular.ttf"; + components.ghostscript = true; + settings.production.email_delivery = { + delivery_method = ":smtp"; + smtp_settings = { + address = "mail.${config.networking.domain}"; + port = 25; + }; + }; + }; + nginx = { + enable = true; + logError = "/dev/null emerg"; + appendHttpConfig = '' + access_log off; + ''; + recommendedOptimisation = true; + recommendedGzipSettings = true; + recommendedProxySettings = true; + recommendedTlsSettings = true; + virtualHosts = { + "pro.htw.stura-dresden.de" = { + locations."/" = { + proxyPass = "http://127.0.0.1:${toString config.services.redmine.port}"; + }; + forceSSL = true; + enableACME = true; + }; + }; + }; + }; } diff --git a/hosts/redmine/hetzner-disk.nix b/hosts/redmine/hetzner-disk.nix deleted file mode 100644 index a679e7c..0000000 --- a/hosts/redmine/hetzner-disk.nix +++ /dev/null @@ -1,56 +0,0 @@ -{ - disko.devices = { - disk = { - main = { - type = "disk"; - device = "/dev/sda"; - content = { - type = "gpt"; - partitions = { - boot = { - size = "1M"; - type = "EF02"; # for grub MBR - }; - ESP = { - priority = 1; - name = "ESP"; - start = "1M"; - end = "512M"; - type = "EF00"; - content = { - type = "filesystem"; - format = "vfat"; - mountpoint = "/boot"; - mountOptions = [ "umask=0077" ]; - }; - }; - root = { - size = "100%"; - content = { - type = "btrfs"; - extraArgs = [ "-f" ]; # Override existing partition - subvolumes = { - "/rootfs" = { - mountpoint = "/"; - }; - "/home" = { - mountOptions = [ "compress=zstd" ]; - mountpoint = "/home"; - }; - # Sub(sub)volume doesn't need a mountpoint as its parent is mounted - "/nix" = { - mountOptions = [ - "compress=zstd" - "noatime" - ]; - mountpoint = "/nix"; - }; - }; - }; - }; - }; - }; - }; - }; - }; -}