This commit is contained in:
Hadi 2024-06-07 23:34:02 +02:00
parent 24de104139
commit ca8abfde1c
4 changed files with 24 additions and 21 deletions

View File

@ -1,7 +1,7 @@
{ pkgs, config, ... }: { pkgs, config, ... }:
let variable = import ../../variables.nix; let variable = import ../../variables.nix;
in { in {
imports = [ ./hardware-configuration.nix ./openssh.nix ./nextcloud.nix ]; imports = [ ./hardware-configuration.nix ./openssh.nix ./nextcloud.nix ./firewall.nix ./nginx.nix ];
boot = { boot = {
loader.efi.canTouchEfiVariables = true; loader.efi.canTouchEfiVariables = true;

View File

@ -0,0 +1,7 @@
{
networking.firewall = {
enable = true;
allowedTCPPorts = [ 22 ];
};
}

View File

@ -1,4 +1,4 @@
{ pkgs, ... }: { { pkgs, config, ... }: {
environment.systemPackages = with pkgs; [ nextcloud29 ]; environment.systemPackages = with pkgs; [ nextcloud29 ];
@ -7,27 +7,12 @@
package = pkgs.nextcloud29; package = pkgs.nextcloud29;
hostName = "localhost"; hostName = "localhost";
config.adminpassFile = "/etc/nextcloudpwd"; config.adminpassFile = "/etc/nextcloudpwd";
nginx.enable = true;
}; };
networking.firewall.allowedTCPPorts = [ 80 443 ]; networking.firewall.allowedTCPPorts = [ 80 443 ];
services.nginx = { services.nginx.virtualHosts."localhost".listen = [{
enable = true; addr = "127.0.0.1";
port = 8080;
# Use recommended settings }];
recommendedGzipSettings = true;
recommendedOptimisation = true;
recommendedProxySettings = true;
recommendedTlsSettings = true;
# Only allow PFS-enabled ciphers with AES256
sslCiphers = "AES256+EECDH:AES256+EDH:!aNULL";
# Setup Nextcloud virtual host to listen on ports
virtualHosts = {
"localhost" = { };
};
};
} }

11
hosts/server/nginx.nix Normal file
View File

@ -0,0 +1,11 @@
{
services.nginx = {
enable = true;
recommendedGzipSettings = true;
recommendedOptimisation = true;
recommendedProxySettings = true;
recommendedTlsSettings = true;
};
networking.firewall = { allowedTCPPorts = [ 80 443 ]; };
}