2020-01-12 23:11:02 -08:00
|
|
|
# Ao -- my home development and user-facing server
|
2020-01-12 15:17:17 -08:00
|
|
|
|
2020-10-01 15:46:04 -07: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
|
|
|
|
2020-10-01 15:46:04 -07: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-10-01 15:46:04 -07:00
|
|
|
# services.syncthing.enable = true;
|
|
|
|
|
2020-10-23 17:54:25 -07:00
|
|
|
theme.active = "alucard";
|
2020-03-28 22:48:43 -07:00
|
|
|
};
|
|
|
|
|
2020-01-17 16:08:43 -08:00
|
|
|
|
2020-10-01 15:46:04 -07:00
|
|
|
## Local config
|
2020-01-12 15:17:17 -08:00
|
|
|
networking.networkmanager.enable = true;
|
|
|
|
|
|
|
|
# nginx hosts
|
|
|
|
services.nginx = {
|
2020-10-01 15:46:04 -07:00
|
|
|
user = config.user.name;
|
2020-01-12 15:17:17 -08:00
|
|
|
virtualHosts = {
|
|
|
|
"v0.io" = {
|
|
|
|
default = true;
|
|
|
|
enableACME = true;
|
|
|
|
forceSSL = true;
|
2020-12-18 20:42:24 -08:00
|
|
|
locations."/".proxyPass = http://192.168.1.3:8000;
|
2020-01-12 15:17:17 -08:00
|
|
|
};
|
|
|
|
"git.v0.io" = {
|
|
|
|
enableACME = true;
|
|
|
|
forceSSL = true;
|
|
|
|
locations."/".proxyPass = http://127.0.0.1:3000;
|
|
|
|
};
|
2020-12-18 20:42:24 -08:00
|
|
|
# "p.v0.io" = {
|
2020-10-01 15:46:04 -07:00
|
|
|
# enableACME = true;
|
|
|
|
# forceSSL = true;
|
2020-12-18 20:42:24 -08:00
|
|
|
# locations."/".proxyPass = http://127.0.0.1:9001;
|
2020-10-01 15:46:04 -07:00
|
|
|
# };
|
2020-01-12 15:17:17 -08:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2020-10-01 15:46:04 -07:00
|
|
|
security.acme = {
|
|
|
|
acceptTerms = true;
|
|
|
|
certs = let email = "henrik@lissner.net"; in {
|
|
|
|
"v0.io".email = email;
|
|
|
|
"git.v0.io".email = email;
|
2020-12-18 20:42:24 -08:00
|
|
|
# "p.v0.io".email = email;
|
2020-10-01 15:46:04 -07:00
|
|
|
};
|
2020-01-12 15:17:17 -08:00
|
|
|
};
|
|
|
|
|
|
|
|
services.gitea = {
|
|
|
|
appName = "V-NOUGHT";
|
|
|
|
domain = "v0.io";
|
|
|
|
rootUrl = "https://git.v0.io/";
|
2020-12-18 23:48:41 -08:00
|
|
|
settings.server.SSH_DOMAIN = "v0.io";
|
2020-01-12 15:17:17 -08:00
|
|
|
};
|
2020-01-17 01:22:50 -08:00
|
|
|
|
|
|
|
services.fail2ban = {
|
|
|
|
enable = true;
|
|
|
|
jails.DEFAULT = ''
|
|
|
|
ignoreip = 127.0.0.1/8,192.168.1.0/24
|
|
|
|
bantime = 3600
|
|
|
|
maxretry = 5
|
|
|
|
'';
|
|
|
|
jails.sshd = ''
|
|
|
|
filter = sshd
|
|
|
|
action = iptables[name=ssh, port=22, protocl=tcp]
|
|
|
|
enabled = true
|
|
|
|
'';
|
|
|
|
};
|
2020-01-12 15:17:17 -08:00
|
|
|
}
|