2021-04-12 01:35:24 +01:00
|
|
|
{
|
2022-10-10 13:03:08 +01:00
|
|
|
pkgs,
|
|
|
|
lib,
|
2022-10-13 00:03:32 +01:00
|
|
|
modulesPath,
|
2022-10-10 13:03:08 +01:00
|
|
|
...
|
|
|
|
}: {
|
2021-04-19 00:39:33 +01:00
|
|
|
imports = [
|
2022-10-13 00:03:32 +01:00
|
|
|
"${modulesPath}/profiles/headless.nix"
|
|
|
|
(import ../modules)
|
|
|
|
|
2021-04-19 00:39:33 +01:00
|
|
|
./services/gitea.nix
|
|
|
|
./services/nextcloud.nix
|
|
|
|
./services/webserver.nix
|
2022-04-23 04:08:45 +01:00
|
|
|
./services/starbound.nix
|
2022-10-12 18:04:06 +01:00
|
|
|
./services/postgres.nix
|
2022-10-12 02:03:22 +01:00
|
|
|
./sops.nix
|
2021-04-19 00:39:33 +01:00
|
|
|
];
|
2021-04-12 01:35:24 +01:00
|
|
|
|
2022-10-13 00:03:32 +01:00
|
|
|
nixpkgs.overlays = [
|
|
|
|
(final: prev: {
|
|
|
|
local = import ../pkgs {
|
|
|
|
pkgs = prev;
|
|
|
|
};
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2021-04-12 01:35:24 +01:00
|
|
|
nix = {
|
|
|
|
package = pkgs.nixFlakes;
|
|
|
|
extraOptions = ''
|
|
|
|
experimental-features = nix-command flakes
|
|
|
|
'';
|
2021-04-28 00:22:21 +01:00
|
|
|
|
|
|
|
# Enable remote builds from tlater
|
2022-10-10 13:03:08 +01:00
|
|
|
trustedUsers = ["@wheel"];
|
2021-04-12 01:35:24 +01:00
|
|
|
};
|
|
|
|
|
2022-04-23 04:08:45 +01:00
|
|
|
nixpkgs.config.allowUnfreePredicate = pkg:
|
2022-10-13 00:30:07 +01:00
|
|
|
builtins.elem (lib.getName pkg) ["steam-original" "steam-runtime" "steamcmd"];
|
2022-04-23 04:08:45 +01:00
|
|
|
|
2022-10-12 01:24:54 +01:00
|
|
|
# Optimization for minecraft servers, see:
|
|
|
|
# https://bugs.mojang.com/browse/MC-183518
|
2022-10-10 13:03:08 +01:00
|
|
|
boot.kernelParams = ["highres=off" "nohz=off"];
|
2021-08-25 19:45:15 +01:00
|
|
|
|
2021-04-12 01:35:24 +01:00
|
|
|
networking = {
|
|
|
|
hostName = "tlaternet";
|
|
|
|
|
|
|
|
usePredictableInterfaceNames = false;
|
|
|
|
useDHCP = false;
|
|
|
|
interfaces.eth0.useDHCP = true;
|
|
|
|
|
2022-10-12 19:43:24 +01:00
|
|
|
firewall.allowedTCPPorts = [80 443 2222 21025];
|
2021-04-12 01:35:24 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
time.timeZone = "Europe/London";
|
|
|
|
|
|
|
|
users.users.tlater = {
|
|
|
|
isNormalUser = true;
|
2022-10-10 13:03:08 +01:00
|
|
|
extraGroups = ["wheel"];
|
|
|
|
openssh.authorizedKeys.keyFiles = [../keys/tlater.pub];
|
2021-04-12 01:35:24 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
services.openssh = {
|
|
|
|
enable = true;
|
|
|
|
allowSFTP = false;
|
|
|
|
passwordAuthentication = false;
|
|
|
|
permitRootLogin = "no";
|
2022-10-10 13:03:08 +01:00
|
|
|
ports = [2222];
|
2021-04-12 01:35:24 +01:00
|
|
|
startWhenNeeded = true;
|
2022-10-10 13:01:26 +01:00
|
|
|
gatewayPorts = "yes";
|
2021-04-12 01:35:24 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
services.nginx = {
|
|
|
|
enable = true;
|
|
|
|
recommendedTlsSettings = true;
|
|
|
|
recommendedOptimisation = true;
|
|
|
|
recommendedGzipSettings = true;
|
|
|
|
recommendedProxySettings = true;
|
|
|
|
clientMaxBodySize = "10G";
|
2021-05-17 00:00:34 +01:00
|
|
|
domain = "tlater.net";
|
2021-04-12 01:35:24 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
security.acme = {
|
2022-10-12 19:58:09 +01:00
|
|
|
defaults.email = "tm@tlater.net";
|
2021-04-12 01:35:24 +01:00
|
|
|
acceptTerms = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
system.stateVersion = "20.09";
|
|
|
|
}
|