depot/hosts/VEGAS/system.nix

108 lines
2.8 KiB
Nix
Raw Normal View History

{ aspect, config, inputs, lib, pkgs, tools, ... }:
{
imports =
[
# Hardware
./hardware-configuration.nix
2021-10-16 23:24:00 +03:00
# Plumbing
./modules/database
2021-10-16 21:16:46 +03:00
./modules/nginx
2021-10-16 20:39:49 +03:00
./modules/oauth2-proxy
2021-10-16 20:29:15 +03:00
./modules/redis
2021-10-16 20:29:29 +03:00
./modules/virtualisation
2021-10-16 21:17:23 +03:00
inputs.agenix.nixosModules.age
# Services
./services/backbone-routing
2021-10-16 20:34:42 +03:00
./services/bitwarden
2021-10-16 16:07:53 +03:00
./services/cdn-shield
2021-10-16 21:20:16 +03:00
./services/dns
2021-10-16 20:34:13 +03:00
./services/fbi
2021-10-16 20:35:22 +03:00
./services/bitwarden
# TODO: fix this one
./services/forum
2021-10-16 20:35:50 +03:00
./services/git
2021-12-01 23:27:26 +02:00
./services/hydra
2021-11-13 13:33:25 +02:00
./services/hyprspace
2021-10-16 20:36:25 +03:00
./services/ipfs
2021-10-16 20:36:32 +03:00
./services/jokes
2021-10-16 21:24:57 +03:00
./services/meet
2021-10-16 21:23:55 +03:00
./services/nextcloud
2021-10-16 21:22:40 +03:00
./services/nfs
2021-10-16 21:22:48 +03:00
./services/mail
./services/matrix
2021-10-16 21:24:13 +03:00
./services/nix/binary-cache.nix
2021-10-16 21:24:25 +03:00
./services/nix/nar-serve.nix
2021-10-16 20:59:06 +03:00
./services/object-storage
2021-10-16 20:59:19 +03:00
./services/openvpn
2021-10-16 21:24:30 +03:00
./services/sso
2021-11-26 22:49:21 +02:00
./services/vault
2021-10-16 21:22:58 +03:00
./services/warehouse
2021-10-16 21:00:53 +03:00
./services/websites
]
# TODO: fix users
# ++ (import ../../users "server").groups.admin
++ aspect.sets.backbone;
# Use the GRUB 2 boot loader.
boot.loader.grub.enable = true;
boot.loader.grub.version = 2;
boot.loader.grub.device = "/dev/sda";
networking.hostName = "VEGAS";
networking.domain = "backbone.${tools.meta.domain}";
time.timeZone = "Europe/Helsinki";
networking.useDHCP = false;
networking.interfaces.enp0s31f6.useDHCP = true;
i18n.defaultLocale = "en_US.UTF-8";
services.openssh.enable = true;
networking.firewall.enable = true;
system.stateVersion = "21.05";
services.openssh.passwordAuthentication = false;
systemd.additionalUpstreamSystemUnits = [
"systemd-journald@.service"
"systemd-journald@.socket"
"systemd-journald-varlink@.socket"
];
nixpkgs.config.allowUnfree = true;
services.minecraft-server = let
modpack = fetchTarball {
url = "https://bafybeiar4mnqvbwkb4glerj6yibccgscbff7nzeojf6px3oapxn7f7hymq.ipfs.privatevoid.net/modpack.tar.gz";
sha256 = "sha256:1iqd6mlknbq4r3iqpfsibp8h2kknaaqkqarnw03z2s61ivsqq7lc";
};
in {
enable = true;
eula = true;
openFirewall = true;
package = pkgs.minecraft-server.overrideAttrs (_: {
version = "forge-1.12.2";
src = "${modpack}/forge-1.12.2-14.23.5.2796-universal.jar"; # HACK
});
};
systemd.services.minecraft-server.path = [ pkgs.jre8 ];
systemd.services.minecraft-server.serviceConfig = {
ExecStart = lib.mkForce "/var/lib/minecraft/start.sh";
};
users.users.minecraft.group = "minecraft-sftp";
users.groups.minecraft-sftp = {};
services.openssh.extraConfig = ''
Match Group minecraft-sftp
ChrootDirectory /srv/minecraft-cc-sftp
ForceCommand internal-sftp -u 0002
AllowTcpForwarding no
X11Forwarding no
'';
}