From 099630074048522d22fcbf3ef1e32122be7a1d92 Mon Sep 17 00:00:00 2001 From: Clayton Hickey Date: Sun, 8 Feb 2026 19:27:12 -0500 Subject: [PATCH 1/5] cloudflared for nixnas --- cloudflared.nix | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 cloudflared.nix diff --git a/cloudflared.nix b/cloudflared.nix new file mode 100644 index 0000000..6a3b6c3 --- /dev/null +++ b/cloudflared.nix @@ -0,0 +1,15 @@ +{ config, lib, ... }: +{ + config = lib.mkMerge [ + (lib.mkIf (config.networking.hostName == "nixnas") { + services.cloudflared = { + enable = true; + certificateFile = "/Block/cloudflare/cert.pem"; + tunnels.mine = { + credentialsFile = "/Block/cloudflare/2d530440-2db8-491a-bb61-7941315d4cb9.json"; + default = "http_status:404"; + }; + }; + }) + ]; +} From 3f477a3fde15b9920185b04c63f7a0bce8b475cd Mon Sep 17 00:00:00 2001 From: Clayton Hickey Date: Sun, 8 Feb 2026 19:27:29 -0500 Subject: [PATCH 2/5] finish umami --- cos.nix | 2 ++ umami.nix | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/cos.nix b/cos.nix index 6fac4f9..04c9387 100644 --- a/cos.nix +++ b/cos.nix @@ -11,6 +11,8 @@ ./emacs.nix ./minecraft/minecraft-servers.nix ./mastodon.nix + ./cloudflared.nix + ./umami.nix "${inputs.home-manager}/nixos" inputs.nix-minecraft.nixosModules.minecraft-servers ]; diff --git a/umami.nix b/umami.nix index 430b4dd..15e45be 100644 --- a/umami.nix +++ b/umami.nix @@ -9,10 +9,11 @@ in enable = true; settings = { APP_SECRET_FILE = "/Block/umami/app_secret.txt"; - HOSTNAME = config.cos.wireguard.clientInternalIP; + HOSTNAME = "127.0.0.1"; PORT = umamiPort; }; }; + services.cloudflared.tunnels.mine.ingress."umami.claytonhickey.me" = "http://127.0.0.1:${builtins.toString umamiPort}"; }) ]; } From 31576bbfa05ee5493a50debfa34ccb09606d8697 Mon Sep 17 00:00:00 2001 From: Clayton Hickey Date: Sat, 7 Mar 2026 18:22:02 -0500 Subject: [PATCH 3/5] bikeability2 --- bikeability2.nix | 34 ++++++++++++++++++++++++++++++++++ cos.nix | 1 + 2 files changed, 35 insertions(+) create mode 100644 bikeability2.nix diff --git a/bikeability2.nix b/bikeability2.nix new file mode 100644 index 0000000..7898800 --- /dev/null +++ b/bikeability2.nix @@ -0,0 +1,34 @@ +{ pkgs, config, lib, ... }: +let + wordpressPort = 5781; +in +{ + config = lib.mkMerge [ + (lib.mkIf (config.networking.hostName == "nixnas") { + services.wordpress.sites."bikeability.net" = { + virtualHost.listen = [{ + port = wordpressPort; + ip = "127.0.0.1"; + }]; + settings = { + FORCE_SSL_ADMIN = true; + }; + extraConfig = '' + $_SERVER['HTTPS']='on'; + ''; + plugins = { + wpcode = pkgs.stdenv.mkDerivation rec { + name = "wpcode"; + version = "2.3.3"; + src = pkgs.fetchzip { + url = "https://downloads.wordpress.org/plugins/insert-headers-and-footers.${version}.zip"; + hash = "sha256-BjQ62ZvWck/e0kcP6Ny1pOGAfsPVUDQLrvGnvkeq6FY="; + }; + installPhase = "mkdir -p $out; cp -R * $out/"; + }; + }; + }; + services.cloudflared.tunnels.mine.ingress."bikeability.net" = "http://127.0.0.1:${builtins.toString wordpressPort}"; + }) + ]; +} diff --git a/cos.nix b/cos.nix index 04c9387..e45d359 100644 --- a/cos.nix +++ b/cos.nix @@ -13,6 +13,7 @@ ./mastodon.nix ./cloudflared.nix ./umami.nix + ./bikeability2.nix "${inputs.home-manager}/nixos" inputs.nix-minecraft.nixosModules.minecraft-servers ]; From 5e8cb90b83fa106952fa40cda28588b4209a0770 Mon Sep 17 00:00:00 2001 From: Clayton Hickey Date: Sat, 7 Mar 2026 18:22:15 -0500 Subject: [PATCH 4/5] cobblemon server init --- cos.nix | 1 - minecraft/minecraft-servers.nix | 41 ++++++++++++++++++++++++++++++--- 2 files changed, 38 insertions(+), 4 deletions(-) diff --git a/cos.nix b/cos.nix index e45d359..5a37efa 100644 --- a/cos.nix +++ b/cos.nix @@ -15,7 +15,6 @@ ./umami.nix ./bikeability2.nix "${inputs.home-manager}/nixos" - inputs.nix-minecraft.nixosModules.minecraft-servers ]; options.cos = { diff --git a/minecraft/minecraft-servers.nix b/minecraft/minecraft-servers.nix index 923fac9..a3eb097 100644 --- a/minecraft/minecraft-servers.nix +++ b/minecraft/minecraft-servers.nix @@ -1,7 +1,8 @@ -{ config, lib, pkgs, ... }: +{ config, lib, pkgs, inputs, ... }: let survivalPort = 25565; creativePort = 25566; + cobblemonPort = 25567; users = { clay53_clayton = "bc2653cd-6cb1-4d15-9d24-cce0d1e8811c"; fire_chase = "c2b1a7ff-abff-41cb-af2a-4a89e942d288"; @@ -23,8 +24,15 @@ let maxRam = "1G"; in { + imports = [ + inputs.nix-minecraft.nixosModules.minecraft-servers + ]; config = lib.mkMerge [ (lib.mkIf (config.networking.hostName == "nixnas") { + nixpkgs.overlays = [ + inputs.nix-minecraft.overlay + ]; + services.minecraft-servers = { enable = true; eula = true; @@ -46,7 +54,7 @@ in motd = "Clayton Hickey's Survival"; white-list = true; }; - package = pkgs.minecraftServers.vanilla-1_21_11; + package = pkgs.vanillaServers.vanilla-1_21_11; jvmOpts = "-Xms${minRam} -Xmx${maxRam}"; }; @@ -64,13 +72,40 @@ in motd = "Clayton Hickey's Creative"; white-list = true; }; - package = pkgs.minecraftServers.vanilla-1_21_11; + package = pkgs.vanillaServers.vanilla-1_21_11; jvmOpts = "-Xms${minRam} -Xmx${maxRam}"; }; + services.minecraft-servers.servers.cobblemon = + let + inherit (inputs.nix-minecraft.lib) collectFilesAt; + modpack = pkgs.fetchPackwizModpack { + url = "https://forgejo.claytonhickey.me/clay53/cobblemon-modpack/raw/branch/master/pack.toml"; + packHash = "sha256-rz51hV1kgju7+6OyeEzSwO4+fmoS4/bi0Fo9iCYBOnI="; + }; + in + { + enable = true; + autoStart = true; + restart = "always"; + enableReload = false; + whitelist = defaultWhitelist; + operators = defaultOperators; + serverProperties = { + server-port = cobblemonPort; + difficulty = 3; + gamemode = 0; + motd = "Clayton Hickey's Cobblemon"; + white-list = true; + }; + package = pkgs.fabricServers.fabric-1_21_1; + symlinks = collectFilesAt modpack "mods"; + }; + networking.firewall.interfaces.${config.cos.wireguard.interface}.allowedTCPPorts = [ survivalPort creativePort + cobblemonPort ]; }) ]; From ff604fa02d70a733e254dc1571b49f657ca46cd7 Mon Sep 17 00:00:00 2001 From: Clayton Hickey Date: Sat, 7 Mar 2026 18:26:19 -0500 Subject: [PATCH 5/5] cobblemon public --- loadedskypotato/configuration.nix | 15 --------------- minecraft/minecraft-servers.nix | 23 +++++++++++++++++++++++ 2 files changed, 23 insertions(+), 15 deletions(-) diff --git a/loadedskypotato/configuration.nix b/loadedskypotato/configuration.nix index 82b97a1..99c7f75 100644 --- a/loadedskypotato/configuration.nix +++ b/loadedskypotato/configuration.nix @@ -123,17 +123,6 @@ in }; }; - services.nginx.streamConfig = '' - server { - listen 25565 reuseport; - proxy_pass 10.100.0.2:25565; - } - server { - listen 25566 reuseport; - proxy_pass 10.100.0.2:25566; - } - ''; - services.dnsmasq = { enable = true; settings = { @@ -158,10 +147,6 @@ in usePredictableInterfaceNames = false; useDHCP = false; firewall = { - allowedTCPPorts = [ - 25565 # minecraft survival - 25566 # minecraft creative - ]; allowedUDPPorts = [ 51820 # wireguard ]; diff --git a/minecraft/minecraft-servers.nix b/minecraft/minecraft-servers.nix index a3eb097..f55e538 100644 --- a/minecraft/minecraft-servers.nix +++ b/minecraft/minecraft-servers.nix @@ -108,5 +108,28 @@ in cobblemonPort ]; }) + + (lib.mkIf (config.networking.hostName == "loadedskypotato") { + services.nginx.streamConfig = '' + server { + listen ${survivalPort} reuseport; + proxy_pass 10.100.0.2:${survivalPort}; + } + server { + listen ${creativePort} reuseport; + proxy_pass 10.100.0.2:${creativePort}; + } + server { + listen ${cobblemonPort} reuseport; + proxy_pass 10.100.0.2:${cobblemonPort}; + } + ''; + + networking.firewall.allowedTCPPorts = [ + survivalPort + creativePort + cobblemonPort + ]; + }) ]; }