2021-04-12 01:35:24 +01:00
|
|
|
{ config, pkgs, ... }:
|
|
|
|
|
|
|
|
{
|
2021-04-19 00:39:33 +01:00
|
|
|
imports = [
|
2021-05-13 21:12:11 +01:00
|
|
|
# ./services/gitea.nix
|
|
|
|
./services/hydra.nix
|
|
|
|
# ./services/minecraft.nix
|
|
|
|
# ./services/nextcloud.nix
|
|
|
|
# ./services/webserver.nix
|
2021-04-19 00:39:33 +01:00
|
|
|
./ids.nix
|
|
|
|
];
|
2021-04-12 01:35:24 +01:00
|
|
|
|
|
|
|
nix = {
|
2021-04-28 00:22:21 +01:00
|
|
|
# Enable flakes
|
2021-04-12 01:35:24 +01:00
|
|
|
package = pkgs.nixFlakes;
|
|
|
|
extraOptions = ''
|
|
|
|
experimental-features = nix-command flakes
|
|
|
|
'';
|
2021-04-28 00:22:21 +01:00
|
|
|
|
|
|
|
# Enable remote builds from tlater
|
|
|
|
trustedUsers = [ "@wheel" ];
|
2021-04-12 01:35:24 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
networking = {
|
|
|
|
hostName = "tlaternet";
|
|
|
|
|
|
|
|
usePredictableInterfaceNames = false;
|
|
|
|
useDHCP = false;
|
|
|
|
interfaces.eth0.useDHCP = true;
|
|
|
|
|
|
|
|
firewall.allowedTCPPorts = [ 80 443 2222 2221 25565 ];
|
|
|
|
};
|
|
|
|
|
|
|
|
time.timeZone = "Europe/London";
|
|
|
|
|
|
|
|
users.users.tlater = {
|
|
|
|
isNormalUser = true;
|
|
|
|
extraGroups = [ "wheel" ];
|
|
|
|
openssh.authorizedKeys.keyFiles = [ ../keys/tlater.pub ];
|
|
|
|
};
|
|
|
|
|
|
|
|
services.openssh = {
|
|
|
|
enable = true;
|
|
|
|
allowSFTP = false;
|
|
|
|
passwordAuthentication = false;
|
|
|
|
permitRootLogin = "no";
|
|
|
|
ports = [ 2222 ];
|
|
|
|
startWhenNeeded = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
services.nginx = {
|
|
|
|
enable = true;
|
|
|
|
recommendedTlsSettings = true;
|
|
|
|
recommendedOptimisation = true;
|
|
|
|
recommendedGzipSettings = true;
|
|
|
|
recommendedProxySettings = true;
|
|
|
|
clientMaxBodySize = "10G";
|
2021-04-12 01:41:31 +01:00
|
|
|
|
|
|
|
virtualHosts = let
|
|
|
|
host = port: extra:
|
|
|
|
{
|
|
|
|
forceSSL = true;
|
|
|
|
enableACME = true;
|
|
|
|
locations."/" = { proxyPass = "http://localhost:${toString port}"; };
|
|
|
|
} // extra;
|
2021-04-12 01:42:46 +01:00
|
|
|
in {
|
2021-05-13 21:12:11 +01:00
|
|
|
# "tlater.net" = host 3002 { serverAliases = [ "www.tlater.net" ]; };
|
|
|
|
# "gitea.tlater.net" = host 3000 { };
|
|
|
|
# "nextcloud.tlater.net" = host 3001 { };
|
|
|
|
"hydra.tlater.net" = host 3003 { };
|
2021-04-12 01:42:46 +01:00
|
|
|
};
|
2021-04-12 01:35:24 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
security.acme = {
|
|
|
|
email = "tm@tlater.net";
|
|
|
|
acceptTerms = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
virtualisation.oci-containers.backend = "podman";
|
|
|
|
|
|
|
|
system.stateVersion = "20.09";
|
|
|
|
}
|