2024-01-14 22:22:14 +01:00
|
|
|
{ pkgs, ... }:
|
|
|
|
let
|
2024-01-16 19:27:49 +01:00
|
|
|
rootDomain = "lgmrszd.xyz";
|
2024-01-14 22:22:14 +01:00
|
|
|
gtnhDomain = "gtnh.${rootDomain}";
|
2024-01-16 19:27:49 +01:00
|
|
|
discDomain = "discource.testdrive.${rootDomain}";
|
2024-01-14 22:22:14 +01:00
|
|
|
akkoDomain = "akko.testdrive.${rootDomain}";
|
|
|
|
iceDomain = "ice.testdrive.${rootDomain}";
|
|
|
|
in
|
|
|
|
{
|
2024-01-12 21:09:13 +01:00
|
|
|
imports = [
|
|
|
|
./hardware-configuration.nix
|
|
|
|
|
|
|
|
|
|
|
|
];
|
|
|
|
|
|
|
|
programs.fish.enable = true;
|
|
|
|
|
|
|
|
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
|
|
|
|
|
|
|
boot.tmp.cleanOnBoot = true;
|
|
|
|
zramSwap.enable = true;
|
|
|
|
networking.hostName = "lgm-vps1";
|
|
|
|
networking.domain = "contaboserver.net";
|
2024-01-14 21:10:59 +01:00
|
|
|
networking.firewall.allowedTCPPorts = [ 80 443 ];
|
|
|
|
services.openssh = {
|
|
|
|
enable = true;
|
|
|
|
ports = [ 37163 ];
|
|
|
|
settings.PermitRootLogin = "no";
|
|
|
|
settings.PasswordAuthentication = false;
|
|
|
|
};
|
2024-01-12 21:09:13 +01:00
|
|
|
|
|
|
|
services.endlessh-go = {
|
|
|
|
enable = true;
|
|
|
|
openFirewall = true;
|
|
|
|
port = 22;
|
|
|
|
};
|
|
|
|
|
2024-01-14 22:22:14 +01:00
|
|
|
users.users.nginx.extraGroups = [ "acme" ];
|
|
|
|
|
2024-01-14 20:54:43 +01:00
|
|
|
services.nginx = {
|
|
|
|
enable = true;
|
2024-01-14 22:22:14 +01:00
|
|
|
virtualHosts.${gtnhDomain} = {
|
2024-01-14 21:32:44 +01:00
|
|
|
# addSSL = true;
|
|
|
|
forceSSL = true;
|
2024-01-14 22:22:14 +01:00
|
|
|
# enableACME = true;
|
2024-01-15 02:00:18 +01:00
|
|
|
useACMEHost = "${rootDomain}";
|
2024-01-14 20:54:43 +01:00
|
|
|
root = "/var/www/gtnh";
|
|
|
|
};
|
2024-01-16 19:27:49 +01:00
|
|
|
virtualHosts.${discDomain} = {
|
|
|
|
forceSSL = true;
|
|
|
|
useACMEHost = "${rootDomain}";
|
|
|
|
root = "/var/www/todo";
|
|
|
|
};
|
2024-01-14 22:22:14 +01:00
|
|
|
virtualHosts.${akkoDomain} = {
|
2024-01-14 21:32:44 +01:00
|
|
|
forceSSL = true;
|
2024-01-15 02:00:18 +01:00
|
|
|
useACMEHost = "${rootDomain}";
|
2024-01-14 21:32:44 +01:00
|
|
|
root = "/var/www/todo";
|
|
|
|
};
|
2024-01-14 22:22:14 +01:00
|
|
|
virtualHosts.${iceDomain} = {
|
2024-01-14 21:32:44 +01:00
|
|
|
forceSSL = true;
|
2024-01-15 02:00:18 +01:00
|
|
|
useACMEHost = "${rootDomain}";
|
2024-01-14 21:32:44 +01:00
|
|
|
root = "/var/www/todo";
|
|
|
|
};
|
2024-01-14 22:22:14 +01:00
|
|
|
virtualHosts."acmechallenge.${rootDomain}" = {
|
|
|
|
# Catchall vhost, will redirect users to HTTPS for all vhosts
|
|
|
|
serverAliases = [ "*.${rootDomain}" ];
|
|
|
|
locations."/.well-known/acme-challenge" = {
|
|
|
|
root = "/var/lib/acme/.challenges";
|
|
|
|
};
|
|
|
|
locations."/" = {
|
|
|
|
return = "301 https://$host$request_uri";
|
|
|
|
};
|
|
|
|
};
|
2024-01-14 20:54:43 +01:00
|
|
|
};
|
|
|
|
|
2024-01-14 21:32:44 +01:00
|
|
|
security.acme = {
|
|
|
|
acceptTerms = true;
|
|
|
|
defaults.email = "lgmrszd@disroot.org";
|
2024-01-14 22:22:14 +01:00
|
|
|
certs.${rootDomain} = {
|
|
|
|
group = "nginx";
|
|
|
|
webroot = "/var/lib/acme/.challenges";
|
|
|
|
extraDomainNames = [
|
|
|
|
gtnhDomain
|
|
|
|
akkoDomain
|
|
|
|
iceDomain
|
2024-01-16 19:27:49 +01:00
|
|
|
discDomain
|
2024-01-14 22:22:14 +01:00
|
|
|
];
|
|
|
|
};
|
2024-01-14 21:32:44 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2024-01-12 21:09:13 +01:00
|
|
|
programs.mosh.enable = true;
|
2024-01-13 20:00:05 +01:00
|
|
|
|
|
|
|
environment.systemPackages = with pkgs; [
|
|
|
|
git
|
|
|
|
vim
|
|
|
|
];
|
2024-01-12 21:09:13 +01:00
|
|
|
|
|
|
|
users.users.lgm = {
|
|
|
|
isNormalUser = true;
|
|
|
|
description = "lgm";
|
2024-01-13 20:00:05 +01:00
|
|
|
extraGroups = [ "wheel""docker"];
|
2024-01-12 21:09:13 +01:00
|
|
|
shell = pkgs.fish;
|
2024-01-14 20:54:43 +01:00
|
|
|
openssh.authorizedKeys.keys = [''sk-ssh-ed25519@openssh.com AAAAGnNrLXNzaC1lZDI1NTE5QG9wZW5zc2guY29tAAAAIHFPA2RhqZIVCLwYuEUDQyOnJ4g1R6IfQyhGqZ2Cvvu+AAAABHNzaDo= lgm@lgm-nixos''];
|
2024-01-12 21:09:13 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
system.stateVersion = "23.11";
|
|
|
|
}
|