delete pterodactyl
This commit is contained in:
@ -1,289 +0,0 @@
|
||||
# Edit this configuration file to define what should be installed on
|
||||
# your system. Help is available in the configuration.nix(5) man page
|
||||
# and in the NixOS manual (accessible by running ‘nixos-help’).
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
imports = [
|
||||
# Include the results of the hardware scan.
|
||||
./hardware-configuration.nix
|
||||
<home-manager/nixos>
|
||||
|
||||
# Include Services
|
||||
./services/pterodactyl.nix
|
||||
./services/wings.nix
|
||||
];
|
||||
|
||||
# Bootloader.
|
||||
boot = {
|
||||
loader.grub.enable = true;
|
||||
loader.grub.device = "/dev/sda";
|
||||
loader.grub.useOSProber = true;
|
||||
|
||||
# NOTE: I think this needs a separate EFI partition?
|
||||
# loader.systemd-boot = {
|
||||
# enable = true;
|
||||
# configurationLimit = 5;
|
||||
# editor = false;
|
||||
# # canTouchEfiVariables = true;
|
||||
# # efiSysMountPoint = "/boot";
|
||||
# };
|
||||
};
|
||||
|
||||
# hardware = {
|
||||
# opengl = {
|
||||
# enable = true;
|
||||
# driSupport = true;
|
||||
# driSupport32Bit = true;
|
||||
# };
|
||||
|
||||
# nvidia = {
|
||||
# modesetting.enable = true;
|
||||
# powerManagement.enable = false; # Experimental option, maybe this is the reason fileflows fails after some time?
|
||||
# open = false;
|
||||
# nvidiaSettings = false;
|
||||
# };
|
||||
# };
|
||||
|
||||
networking = {
|
||||
hostName = "pterodactyl"; # Define your hostname.
|
||||
# wireless.enable = true; # Enables wireless support via wpa_supplicant.
|
||||
|
||||
# Configure network proxy if necessary
|
||||
# proxy.default = "http://user:password@proxy:port/";
|
||||
# proxy.noProxy = "127.0.0.1,localhost,internal.domain";
|
||||
|
||||
# Enable networking
|
||||
networkmanager.enable = true;
|
||||
|
||||
interfaces.ens18.ipv4.addresses = [{
|
||||
address = "192.168.86.35";
|
||||
prefixLength = 24;
|
||||
}];
|
||||
defaultGateway = "192.168.86.5";
|
||||
nameservers = [
|
||||
"192.168.86.5"
|
||||
];
|
||||
};
|
||||
|
||||
systemd.services.init-pterodactyl-docker-network = {
|
||||
description = "Create a docker network bridge for pterodactyl.";
|
||||
after = [ "network.target" ];
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
|
||||
serviceConfig.Type = "oneshot";
|
||||
script = let
|
||||
dockercli = "${config.virtualisation.docker.package}/bin/docker";
|
||||
network = "pterodactyl";
|
||||
in ''
|
||||
# Put a true at the end to prevent getting non-zero return code, which will
|
||||
# crash the whole service.
|
||||
check=$(${dockercli} network ls | grep ${network} || true)
|
||||
if [ -z "$check" ]; then
|
||||
${dockercli} network create ${network}
|
||||
else
|
||||
echo "${network} already exists in docker"
|
||||
fi
|
||||
'';
|
||||
};
|
||||
|
||||
systemd.services.init-wings-docker-network = {
|
||||
description = "Create a docker network bridge for wings.";
|
||||
after = [ "network.target" ];
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
|
||||
serviceConfig.Type = "oneshot";
|
||||
script = let
|
||||
dockercli = "${config.virtualisation.docker.package}/bin/docker";
|
||||
network = "wings";
|
||||
in ''
|
||||
# Put a true at the end to prevent getting non-zero return code, which will
|
||||
# crash the whole service.
|
||||
check=$(${dockercli} network ls | grep ${network} || true)
|
||||
if [ -z "$check" ]; then
|
||||
${dockercli} network create ${network}
|
||||
else
|
||||
echo "${network} already exists in docker"
|
||||
fi
|
||||
'';
|
||||
};
|
||||
|
||||
# Set your time zone.
|
||||
time.timeZone = "Europe/Berlin";
|
||||
|
||||
# Select internationalisation properties.
|
||||
i18n.defaultLocale = "en_US.UTF-8";
|
||||
|
||||
i18n.extraLocaleSettings = {
|
||||
LC_ADDRESS = "de_DE.UTF-8";
|
||||
LC_IDENTIFICATION = "de_DE.UTF-8";
|
||||
LC_MEASUREMENT = "de_DE.UTF-8";
|
||||
LC_MONETARY = "de_DE.UTF-8";
|
||||
LC_NAME = "de_DE.UTF-8";
|
||||
LC_NUMERIC = "de_DE.UTF-8";
|
||||
LC_PAPER = "de_DE.UTF-8";
|
||||
LC_TELEPHONE = "de_DE.UTF-8";
|
||||
LC_TIME = "de_DE.UTF-8";
|
||||
};
|
||||
|
||||
# Configure console keymap
|
||||
console.keyMap = "us-acentos";
|
||||
|
||||
# Define a user account. Don't forget to set a password with ‘passwd’.
|
||||
users.users.christoph = {
|
||||
isNormalUser = true;
|
||||
description = "Christoph";
|
||||
extraGroups = ["networkmanager" "wheel"];
|
||||
shell = pkgs.fish;
|
||||
packages = with pkgs; [];
|
||||
};
|
||||
|
||||
home-manager.users.christoph = {pkgs, ...}: {
|
||||
home.packages = with pkgs; [
|
||||
lazygit
|
||||
keychain
|
||||
alejandra
|
||||
nnn
|
||||
busybox
|
||||
|
||||
docker-compose
|
||||
];
|
||||
|
||||
programs = {
|
||||
fish = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
git = {
|
||||
enable = true;
|
||||
userEmail = "christoph.urlacher@protonmail.com";
|
||||
userName = "Christoph Urlacher";
|
||||
};
|
||||
|
||||
keychain = {
|
||||
enable = true;
|
||||
enableFishIntegration = true;
|
||||
agents = ["ssh"];
|
||||
keys = ["id_ed25519"];
|
||||
};
|
||||
|
||||
starship = {
|
||||
enable = true;
|
||||
enableFishIntegration = true;
|
||||
};
|
||||
|
||||
yt-dlp = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
home.stateVersion = "23.05";
|
||||
};
|
||||
|
||||
virtualisation = {
|
||||
docker = {
|
||||
enable = true;
|
||||
autoPrune.enable = true;
|
||||
# enableNvidia = true;
|
||||
# rootless = {
|
||||
# enable = true;
|
||||
# setSocketVariable = true;
|
||||
# };
|
||||
};
|
||||
oci-containers.backend = "docker";
|
||||
};
|
||||
|
||||
# Allow unfree packages
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
|
||||
# List packages installed in system profile. To search, run:
|
||||
# $ nix search wget
|
||||
environment.systemPackages = with pkgs; [
|
||||
# vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
|
||||
wget
|
||||
helix
|
||||
git
|
||||
];
|
||||
|
||||
programs = {
|
||||
firejail.enable = true;
|
||||
fish.enable = true;
|
||||
git.enable = true;
|
||||
neovim.enable = true;
|
||||
# fuse.userAllowOther = true;
|
||||
};
|
||||
|
||||
# Some programs need SUID wrappers, can be configured further or are
|
||||
# started in user sessions.
|
||||
# programs.mtr.enable = true;
|
||||
# programs.gnupg.agent = {
|
||||
# enable = true;
|
||||
# enableSSHSupport = true;
|
||||
# };
|
||||
|
||||
# List services that you want to enable:
|
||||
|
||||
services = {
|
||||
# Configure keymap in X11
|
||||
xserver = {
|
||||
layout = "us";
|
||||
xkbVariant = "altgr-intl";
|
||||
# videoDrivers = ["nvidia"];
|
||||
};
|
||||
|
||||
# Trims the journal if it gets too large
|
||||
journald.extraConfig = ''
|
||||
SystemMaxUse=50M
|
||||
'';
|
||||
|
||||
# Enable the OpenSSH daemon.
|
||||
openssh.enable = true;
|
||||
|
||||
ntp.enable = true;
|
||||
qemuGuest.enable = true;
|
||||
};
|
||||
|
||||
networking.firewall = {
|
||||
# Open ports in the firewall.
|
||||
allowedTCPPorts = [
|
||||
# Pterodactyl Panel
|
||||
80
|
||||
443
|
||||
];
|
||||
allowedUDPPorts = [
|
||||
# Pterodactyl Panel
|
||||
80
|
||||
443
|
||||
];
|
||||
allowedTCPPortRanges = [
|
||||
# Pterodactyl Node/Servers
|
||||
{
|
||||
from = 10000;
|
||||
to = 10099;
|
||||
}
|
||||
];
|
||||
allowedUDPPortRanges = [
|
||||
# Pterodactyl Node/Servers
|
||||
{
|
||||
from = 10000;
|
||||
to = 10099;
|
||||
}
|
||||
];
|
||||
# Or disable the firewall altogether.
|
||||
enable = true;
|
||||
|
||||
trustedInterfaces = [
|
||||
"docker0"
|
||||
];
|
||||
};
|
||||
|
||||
# This value determines the NixOS release from which the default
|
||||
# settings for stateful data, like file locations and database versions
|
||||
# on your system were taken. It‘s perfectly fine and recommended to leave
|
||||
# this value at the release version of the first install of this system.
|
||||
# Before changing this value read the documentation for this option
|
||||
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
||||
system.stateVersion = "23.05"; # Did you read the comment?
|
||||
}
|
@ -1,37 +0,0 @@
|
||||
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||
# and may be overwritten by future invocations. Please make changes
|
||||
# to /etc/nixos/configuration.nix instead.
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
modulesPath,
|
||||
...
|
||||
}: {
|
||||
imports = [
|
||||
(modulesPath + "/profiles/qemu-guest.nix")
|
||||
];
|
||||
|
||||
boot.initrd.availableKernelModules = ["ata_piix" "uhci_hcd" "virtio_pci" "virtio_scsi" "sd_mod" "sr_mod"];
|
||||
boot.initrd.kernelModules = [];
|
||||
boot.kernelModules = ["kvm-intel"];
|
||||
boot.extraModulePackages = [];
|
||||
|
||||
fileSystems = {
|
||||
"/" = {
|
||||
device = "/dev/disk/by-uuid/2d1b1f62-f008-4562-906e-5a63d854b18b";
|
||||
fsType = "ext4";
|
||||
};
|
||||
};
|
||||
|
||||
swapDevices = [];
|
||||
|
||||
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
||||
# (the default) this is the recommended approach. When using systemd-networkd it's
|
||||
# still possible to use this option, but it's recommended to use it in conjunction
|
||||
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
|
||||
networking.useDHCP = lib.mkDefault true;
|
||||
# networking.interfaces.ens18.useDHCP = lib.mkDefault true;
|
||||
|
||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
}
|
@ -1,95 +0,0 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
virtualisation.oci-containers.containers.pterodactyl-db = {
|
||||
image = "mariadb:10.5";
|
||||
autoStart = true;
|
||||
|
||||
dependsOn = [
|
||||
# "pihole"
|
||||
];
|
||||
|
||||
ports = [];
|
||||
|
||||
volumes = [
|
||||
"pterodactyl-db_data:/var/lib/mysql"
|
||||
];
|
||||
|
||||
environment = {
|
||||
MYSQL_DATABASE = "panel";
|
||||
MYSQL_USER = "pterodactyl";
|
||||
MYSQL_PASSWORD = "PterodactylDBPW";
|
||||
MYSQL_ROOT_PASSWORD = "PterodactylRootPW";
|
||||
};
|
||||
|
||||
cmd = [
|
||||
"--default-authentication-plugin=mysql_native_password"
|
||||
];
|
||||
|
||||
extraOptions = [
|
||||
"--network=pterodactyl"
|
||||
];
|
||||
};
|
||||
|
||||
virtualisation.oci-containers.containers.pterodactyl-cache = {
|
||||
image = "redis:alpine";
|
||||
autoStart = true;
|
||||
|
||||
dependsOn = [];
|
||||
ports = [];
|
||||
volumes = [];
|
||||
environment = {};
|
||||
cmd = [];
|
||||
extraOptions = [
|
||||
"--network=pterodactyl"
|
||||
];
|
||||
};
|
||||
|
||||
virtualisation.oci-containers.containers.pterodactyl-panel = {
|
||||
image = "ghcr.io/pterodactyl/panel:latest";
|
||||
autoStart = true;
|
||||
|
||||
dependsOn = [
|
||||
"pterodactyl-db"
|
||||
"pterodactyl-cache"
|
||||
];
|
||||
|
||||
ports = [
|
||||
"80:80"
|
||||
"443:443"
|
||||
];
|
||||
|
||||
volumes = [
|
||||
"pterodactyl_var:/app/var"
|
||||
"pterdactyl_nginx:/etc/nginx/http.d"
|
||||
"pterodactyl_certs:/etc/letsencrypt"
|
||||
"pterodactyl_logs:/app/storage/logs"
|
||||
];
|
||||
|
||||
environment = {
|
||||
# This URL should be the URL that your reverse proxy routes to the panel server
|
||||
APP_URL = "https://games.local.chriphost.de";
|
||||
APP_TIMEZONE = "Europe/Berlin";
|
||||
APP_SERVICE_AUTHOR = "christoph.urlacher@protonmail.com";
|
||||
TRUSTED_PROXIES = "192.168.86.25"; # Set this to your proxy IP
|
||||
DB_PASSWORD = "PterodactylDBPW";
|
||||
APP_ENV = "production";
|
||||
APP_ENVIRONMENT_ONLY = "false";
|
||||
CACHE_DRIVER = "redis";
|
||||
SESSION_DRIVER = "redis";
|
||||
QUEUE_DRIVER = "redis";
|
||||
REDIS_HOST = "pterodactyl-cache";
|
||||
DB_HOST = "pterodactyl-db";
|
||||
DB_PORT = "3306";
|
||||
};
|
||||
|
||||
cmd = [];
|
||||
|
||||
extraOptions = [
|
||||
"--network=pterodactyl"
|
||||
];
|
||||
};
|
||||
}
|
@ -1,42 +0,0 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
virtualisation.oci-containers.containers.wings = {
|
||||
image = "ghcr.io/pterodactyl/wings:latest";
|
||||
autoStart = true;
|
||||
|
||||
dependsOn = [];
|
||||
|
||||
ports = [
|
||||
"8080:8080"
|
||||
"2022:2022"
|
||||
"443:443"
|
||||
];
|
||||
|
||||
volumes = [
|
||||
"/var/run/docker.sock:/var/run/docker.sock"
|
||||
"/var/lib/docker/containers/:/var/lib/docker/containers/"
|
||||
"/etc/ssl/certs:/etc/ssl/certs:ro"
|
||||
|
||||
"wings_etc:/etc/pterodactyl/"
|
||||
"wings_var:/var/lib/pterodactyl/"
|
||||
"wings_logs:/var/log/pterodactyl/"
|
||||
"wings_tmp:/tmp/pterodactyl/"
|
||||
"wings_certs:/etc/letsencrypt/"
|
||||
];
|
||||
|
||||
environment = {
|
||||
TZ = "Europe/Berlin";
|
||||
WINGS_UID = "988";
|
||||
WINGS_GID = "988";
|
||||
WINGS_USERNAME = "pterodactyl";
|
||||
};
|
||||
|
||||
extraOptions = [
|
||||
"--network=wings"
|
||||
];
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user