Files
nixos-config/nixos-configurations/server/default.nix

85 lines
1.8 KiB
Nix
Raw Normal View History

2023-08-01 21:58:41 +00:00
{ inputs, pkgs, ... }:
2023-07-02 00:18:17 +02:00
{
imports = [
./hardware-configuration.nix
../shared.nix
];
2023-08-04 09:32:11 +00:00
nix.settings.trusted-users = [ "thiloho" ];
2023-07-29 22:59:36 +02:00
networking = {
2023-07-29 23:01:20 +02:00
hostName = "server";
2023-07-29 22:59:36 +02:00
firewall = {
allowedTCPPorts = [ 80 443 25565 ];
};
};
2023-07-24 15:17:18 +02:00
2023-07-29 22:33:53 +02:00
services = {
2023-08-04 20:44:41 +02:00
openssh = {
enable = true;
settings.PasswordAuthentication = false;
};
2023-07-29 22:33:53 +02:00
minecraft-server = {
enable = true;
eula = true;
declarative = true;
openFirewall = true;
whitelist = {
thilo_ho = "4e4d744d-7748-46bc-add8-b3e8ca3b4cf5";
};
serverProperties = {
difficulty = 3;
max-players = 10;
motd = "Minecraft server of Thilo.";
white-list = true;
};
2023-07-23 04:24:55 +02:00
};
2023-07-29 22:33:53 +02:00
nginx = {
enable = true;
virtualHosts = {
"thilohohlt.com" = {
2023-07-29 23:19:54 +02:00
enableACME = true;
forceSSL = true;
2023-07-29 22:33:53 +02:00
root = inputs.website;
};
2023-08-01 21:58:41 +00:00
"aurora.thilohohlt.com" = {
enableACME = true;
forceSSL = true;
2023-08-01 23:28:39 +00:00
root = inputs.aurora-blog-template.packages.${pkgs.system}.default;
2023-08-01 21:58:41 +00:00
};
2023-07-29 22:33:53 +02:00
};
2023-07-23 04:24:55 +02:00
};
2023-08-04 20:44:41 +02:00
nextcloud = {
enable = true;
2023-08-04 23:04:44 +02:00
package = pkgs.nextcloud27;
2023-08-04 20:44:41 +02:00
hostName = "cloud.thilohohlt.com";
database.createLocally = true;
config = {
2023-08-04 23:09:36 +02:00
dbtype = "pgsql";
2023-08-04 23:06:00 +02:00
adminpassFile = "/root/nextcloud-database-password.txt";
2023-08-04 20:44:41 +02:00
};
};
2023-07-24 14:38:54 +02:00
};
2023-08-04 20:44:41 +02:00
security = {
acme = {
acceptTerms = true;
defaults.email = "thilo.hohlt@tutanota.com";
};
sudo.extraConfig = ''
%wheel ALL=(ALL) NOPASSWD: ALL, SETENV: ALL
'';
2023-07-29 23:19:54 +02:00
};
2023-07-24 14:38:54 +02:00
users.users.thiloho.openssh.authorizedKeys.keys = [
2023-08-04 20:44:41 +02:00
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIP8j7z4RBSjoBcB5btwGodYu5J/Yprng8oBhy47iXWq+ thiloho@pc"
2023-07-24 14:38:54 +02:00
];
2023-07-02 00:18:17 +02:00
home-manager.users.thiloho = { pkgs, lib, ... }: {
home.stateVersion = "23.05";
};
system.stateVersion = "23.05";
}