temp
This commit is contained in:
parent
2ccd17867f
commit
dc4f3160cc
@ -9,6 +9,11 @@
|
|||||||
secrets = {
|
secrets = {
|
||||||
sshconfig = { path = "/home/hadi/.ssh/config"; };
|
sshconfig = { path = "/home/hadi/.ssh/config"; };
|
||||||
github-key = { path = "/home/hadi/.ssh/github"; };
|
github-key = { path = "/home/hadi/.ssh/github"; };
|
||||||
|
nextcloud-adminpass = {
|
||||||
|
path = "/etc/nextcloud/adminpassFile";
|
||||||
|
owner = "nextcloud";
|
||||||
|
group = "nextcloud";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1,17 +0,0 @@
|
|||||||
{
|
|
||||||
services.nginx = {
|
|
||||||
enable = true;
|
|
||||||
virtualHosts = {
|
|
||||||
"test.anotherhadi.com" = {
|
|
||||||
locations."/" = {
|
|
||||||
proxy_set_header = [
|
|
||||||
"X-Real-IP $remote_addr"
|
|
||||||
"proxy_set_header Host $host"
|
|
||||||
"proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for"
|
|
||||||
];
|
|
||||||
proxyPass = "http://192.168.2.22:80";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,6 +0,0 @@
|
|||||||
{
|
|
||||||
services.openssh = {
|
|
||||||
enable = true;
|
|
||||||
ports = [ 22 ];
|
|
||||||
};
|
|
||||||
}
|
|
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 = ''
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -2,8 +2,8 @@
|
|||||||
imports = [
|
imports = [
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
./variables.nix
|
./variables.nix
|
||||||
../modules/openssh.nix
|
../modules/server/openssh.nix
|
||||||
../modules/nginx.nix
|
../modules/server/nginx.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
# Bootloader.
|
# Bootloader.
|
||||||
|
Loading…
Reference in New Issue
Block a user