diff --git a/hosts/ftp/default.nix b/hosts/ftp/default.nix index b19ce24f..02c8fa3b 100644 --- a/hosts/ftp/default.nix +++ b/hosts/ftp/default.nix @@ -28,45 +28,44 @@ services.nginx = { enable = true; additionalModules = [ pkgs.nginxModules.fancyindex ]; - }; + virtualHosts."ftp.c3d2.de" = + let + theme = pkgs.fetchFromGitHub { + owner = "barrowclift"; + repo = "directory-theme"; + rev = "fca275a3ab1d64e8cdbff7e4d2e1d44eec924e2e"; + sha256 = "sha256-UCQbQ+tyzR/Dpa0t2cogjzBJE+IJ9KAD2dtmq3gbq/U="; + }; + in + { + default = true; + enableACME = true; + forceSSL = true; - services.nginx.virtualHosts."ftp.c3d2.de" = - let - theme = pkgs.fetchFromGitHub { - owner = "barrowclift"; - repo = "directory-theme"; - rev = "fca275a3ab1d64e8cdbff7e4d2e1d44eec924e2e"; - sha256 = "sha256-UCQbQ+tyzR/Dpa0t2cogjzBJE+IJ9KAD2dtmq3gbq/U="; - }; - in - { - default = true; - enableACME = true; - forceSSL = true; + locations."/.theme/" = { + alias = "${theme}/"; + }; - locations."/.theme/" = { - alias = "${theme}/"; - }; + locations."/" = { + root = "/var/www/ftp.c3d2.de"; + extraConfig = '' + charset UTF-8; # fix mojibake - locations."/" = { - root = "/var/www/ftp.c3d2.de"; - extraConfig = '' - charset UTF-8; # fix mojibake - - fancyindex on; - fancyindex_exact_size off; - fancyindex_css_href /.theme/style.css; - ''; - }; + fancyindex on; + fancyindex_exact_size off; + fancyindex_css_href /.theme/style.css; + ''; + }; + }; }; services.openssh.extraConfig = '' - Match User ftpupload - X11Forwarding no - ChrootDirectory /var/www/ftp.c3d2.de - AllowTcpForwarding no - ForceCommand internal-sftp - ''; + Match User ftpupload + X11Forwarding no + ChrootDirectory /var/www/ftp.c3d2.de + AllowTcpForwarding no + ForceCommand internal-sftp + ''; sops = { age.sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ];