temp
This commit is contained in:
23
hosts/modules/server/nextcloud.nix
Normal file
23
hosts/modules/server/nextcloud.nix
Normal file
@@ -0,0 +1,23 @@
|
||||
{ pkgs, ... }:
|
||||
let
|
||||
hostname = "cloud.anotherhadi.com";
|
||||
in
|
||||
{
|
||||
services.nextcloud = {
|
||||
enable = true;
|
||||
hostName = hostname;
|
||||
https = true;
|
||||
config = {
|
||||
adminUser = "jack";
|
||||
adminpassFile = "/etc/nextcloud/adminpassFile";
|
||||
};
|
||||
settings = {
|
||||
trusted_domains = [ "localhost" "127.0.0.1" "192.168.2.23" "cloud.anotherhadi.com" ];
|
||||
};
|
||||
nginx.recommendedHttpHeaders = true;
|
||||
};
|
||||
services.nginx.virtualHosts.${hostname} = {
|
||||
forceSSL = true;
|
||||
enableACME = true;
|
||||
}
|
||||
}
|
||||
8
hosts/modules/server/nginx.nix
Normal file
8
hosts/modules/server/nginx.nix
Normal file
@@ -0,0 +1,8 @@
|
||||
{config, ...}:{
|
||||
services.nginx.enable = true;
|
||||
security.acme = {
|
||||
acceptTerms = true;
|
||||
defaults.email = ${config.var.git.email};
|
||||
};
|
||||
networking.firewall.allowedTCPPorts = [ 80 443 ];
|
||||
}
|
||||
14
hosts/modules/server/openssh.nix
Normal file
14
hosts/modules/server/openssh.nix
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
services.openssh = {
|
||||
enable = true;
|
||||
ports = [ 22 ];
|
||||
settings = {
|
||||
PasswordAuthentication = true;
|
||||
AllowUsers = null; # Allows all users by default. Can be [ "user1" "user2" ]
|
||||
UseDns = true;
|
||||
X11Forwarding = false;
|
||||
PermitRootLogin = "no"; # "yes", "without-password", "prohibit-password", "forced-commands-only", "no"
|
||||
};
|
||||
};
|
||||
networking.firewall.allowedTCPPorts = [ 22 ];
|
||||
}
|
||||
7
hosts/modules/server/security.nix
Normal file
7
hosts/modules/server/security.nix
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
networking.firewall.enable = true;
|
||||
services.fail2ban = {
|
||||
enable = true;
|
||||
maxretry = 5;
|
||||
};
|
||||
}
|
||||
9
hosts/modules/server/vaultwarden.nix
Normal file
9
hosts/modules/server/vaultwarden.nix
Normal file
@@ -0,0 +1,9 @@
|
||||
let
|
||||
|
||||
in{
|
||||
services.vaultwarden = {
|
||||
enable = true;
|
||||
config = ''
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user