dot_testing/boxes/netbox.nix

143 lines
3.2 KiB
Nix
Raw Normal View History

2023-07-07 23:44:40 -05:00
{ lib, config, pkgs, ... }:
{
2023-07-07 23:44:40 -05:00
imports =
[
../modules/mail.nix
../common/main.nix
2023-07-07 23:44:40 -05:00
];
boot.loader.grub.enable = true;
boot.loader.grub.device = "/dev/vda";
2023-07-07 23:44:40 -05:00
networking.hostName = "netbox";
2023-07-07 23:44:40 -05:00
users.users.useracc = {
isNormalUser = true;
extraGroups = [ "wheel" "docker" ];
};
2023-07-07 23:44:40 -05:00
environment.systemPackages = with pkgs; [
# nothing more needed, at the moment
];
2023-07-07 23:44:40 -05:00
services.openssh = {
enable = true;
ports = [55555];
};
networking.usePredictableInterfaceNames = false;
2023-07-07 23:44:40 -05:00
services.nixosmail.enable = true;
services.gitea = {
enable = true;
appName = "crappy code"; # Give the site a name
database = {
type = "postgres";
passwordFile = "/etc/gittea-pass";
};
settings.server = {
DOMAIN = "git.beepboop.systems";
ROOT_URL = "https://git.beepboop.systems/";
HTTP_PORT = 3001;
2023-07-07 23:44:40 -05:00
};
};
2023-07-07 23:44:40 -05:00
services.postgresql = {
enable = true; # Ensure postgresql is enabled
authentication = ''
local gitea all ident map=gitea-users
'';
identMap = # Map the gitea user to postgresql
''
gitea-users gitea gitea
2023-07-07 23:44:40 -05:00
'';
};
2023-07-07 23:44:40 -05:00
services.nginx.enable = true;
services.nginx.clientMaxBodySize = "100m";
2023-07-07 23:44:40 -05:00
services.nginx.virtualHosts."beepboop.systems" = {
forceSSL = true;
enableACME = true;
root = "/var/www/beepboop.systems";
};
2023-07-07 23:44:40 -05:00
services.nginx.virtualHosts."git.beepboop.systems" = {
forceSSL = true;
enableACME = true;
locations."/".proxyPass = "http://localhost:3001";
};
2023-07-07 23:44:40 -05:00
services.nginx.virtualHosts."paperless.beepboop.systems" = {
forceSSL = true;
enableACME = true;
locations."/".proxyPass = "http://localhost:3004";
};
2023-07-07 23:44:40 -05:00
services.nginx.virtualHosts."bitwarden.beepboop.systems" = {
forceSSL = true;
enableACME = true;
locations."/" = {
proxyPass = "http://127.0.0.1:8000";
2023-07-07 23:44:40 -05:00
};
};
2023-07-07 23:44:40 -05:00
2023-07-15 23:10:22 -05:00
services.nginx.virtualHosts."ntfy.beepboop.systems" = {
forceSSL = true;
enableACME = true;
locations."/" = {
proxyPass = "http://127.0.0.1:3500";
};
};
services.nginx.virtualHosts."skillissue.agency" = {
forceSSL = true;
enableACME = true;
root = "/var/www/skillissue.agency";
};
2023-07-07 23:44:40 -05:00
security.acme = {
acceptTerms = true;
email = "nickforanick@protonmail.com";
};
2023-07-07 23:44:40 -05:00
services.roundcube = {
enable = true;
# this is the url of the vhost, not necessarily the same as the fqdn of
# the mailserver
hostName = "cube.beepboop.systems";
extraConfig = ''
# starttls needed for authentication, so the fqdn required to match
# the certificate
$config['smtp_server'] = "tls://${config.mailserver.fqdn}";
$config['smtp_user'] = "%u";
$config['smtp_pass'] = "%p";
'';
};
2023-07-07 23:44:40 -05:00
services.paperless = {
enable = true;
passwordFile = "/etc/paperless-password";
port = 3004;
address = "localhost";
extraConfig = {
PAPERLESS_URL = "https://paperless.beepboop.systems";
2023-07-07 23:44:40 -05:00
};
};
2023-07-07 23:44:40 -05:00
2023-07-15 23:53:22 -05:00
# services.ntfy-sh = {
# enable = true;
# settings = {
# listen-http = ":3500";
# };
# };
2023-07-15 23:10:22 -05:00
services.vaultwarden.enable = true;
2023-07-07 23:44:40 -05:00
# Open ports in the firewall.
networking.firewall.enable = false;
networking.firewall.allowedTCPPorts = [ 55555 80 443 ];
2023-07-07 23:44:40 -05:00
}