helm/hosts/ao/default.nix

114 lines
2.6 KiB
Nix
Raw Normal View History

# Ao -- my home development and user-facing server
2020-01-12 15:17:17 -08:00
{ config, lib, ... }:
with lib.my;
2020-01-12 15:17:17 -08:00
{
2020-10-26 02:48:12 -07:00
imports = [
../personal.nix
./hardware-configuration.nix
];
2020-01-12 15:17:17 -08:00
## Modules
2020-03-28 22:48:43 -07:00
modules = {
shell.git.enable = true;
shell.zsh.enable = true;
services.ssh.enable = true;
2020-12-18 20:42:24 -08:00
services.nginx.enable = true;
services.gitea.enable = true;
2020-12-19 05:05:05 -08:00
services.bitwarden.enable = true;
# services.syncthing.enable = true;
theme.active = "alucard";
2020-03-28 22:48:43 -07:00
};
2020-01-17 16:08:43 -08:00
## Local config
2020-01-12 15:17:17 -08:00
networking.networkmanager.enable = true;
# nginx hosts
services.nginx = {
user = config.user.name;
2020-01-12 15:17:17 -08:00
virtualHosts = {
"v0.io" = {
default = true;
forceSSL = true;
2020-12-19 05:05:05 -08:00
enableACME = true;
extraConfig = ''
client_max_body_size 128M;
'';
2020-12-19 00:25:04 -08:00
locations."/" = {
proxyPass = "https://192.168.1.3:8001";
extraConfig = ''
proxy_ssl_server_name on;
proxy_pass_header Authorization;
'';
};
2020-01-12 15:17:17 -08:00
};
"git.v0.io" = {
forceSSL = true;
2020-12-19 05:05:05 -08:00
enableACME = true;
2020-12-19 00:25:04 -08:00
locations."/".proxyPass = "http://127.0.0.1:3000";
2020-01-12 15:17:17 -08:00
};
2020-12-19 05:05:05 -08:00
"p.v0.io" = {
forceSSL = true;
enableACME = true;
locations."/" = {
proxyPass = "http://127.0.0.1:8000";
extraConfig = ''
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
'';
};
locations."/notifications/hub" = {
proxyPass = "http://127.0.0.1:3012";
extraConfig = ''
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
'';
};
locations."/notifications/hub/negotiate" = {
proxyPass = "http://127.0.0.1:8001";
};
};
2020-01-12 15:17:17 -08:00
};
};
security.acme = {
acceptTerms = true;
certs = let email = "henrik@lissner.net"; in {
"v0.io".email = email;
"git.v0.io".email = email;
2020-12-19 05:05:05 -08:00
"p.v0.io".email = email;
};
2020-01-12 15:17:17 -08:00
};
services.gitea = {
appName = "V-NOUGHT";
domain = "v0.io";
rootUrl = "https://git.v0.io/";
settings.server.SSH_DOMAIN = "v0.io";
2020-01-12 15:17:17 -08:00
};
2020-01-17 01:22:50 -08:00
2020-12-19 05:05:05 -08:00
services.bitwarden_rs.config = {
signupsAllowed = false;
domain = "https://p.v0.io";
httpPort = 8002;
};
2020-01-17 01:22:50 -08:00
services.fail2ban = {
enable = true;
2020-12-19 05:05:05 -08:00
ignoreIP = [ "127.0.0.1/8" "192.168.1.0/24" ];
2020-01-17 01:22:50 -08:00
jails.DEFAULT = ''
bantime = 3600
'';
jails.sshd = ''
filter = sshd
action = iptables[name=ssh, port=22, protocl=tcp]
enabled = true
'';
};
2020-01-12 15:17:17 -08:00
}