HASH 20c8e8512e43
DATE 2025-02-05
SUBJECT nix-minecraft: initial config
FILES 7 CHANGED
HASH 20c8e8512e43
DATE 2025-02-05
SUBJECT nix-minecraft: initial config
FILES 7 CHANGED
┌─ flake.lock ───────────────────────────────────────────────────────────────┐
│ diff --git a/flake.lock b/flake.lock │
│ index 95c32e0..f083fad 100644 │
│ --- a/flake.lock │
│ +++ b/flake.lock │
│ @@ -182,6 +182,22 @@ │
│ } │
│ }, │
│ "flake-compat_2": { │
│ + "flake": false, │
│ + "locked": { │
│ + "lastModified": 1673956053, │
│ + "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", │
│ + "owner": "edolstra", │
│ + "repo": "flake-compat", │
│ + "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", │
│ + "type": "github" │
│ + }, │
│ + "original": { │
│ + "owner": "edolstra", │
│ + "repo": "flake-compat", │
│ + "type": "github" │
│ + } │
│ + }, │
│ + "flake-compat_3": { │
│ "flake": false, │
│ "locked": { │
│ "lastModified": 1696426674, │
│ @@ -1013,6 +1029,30 @@ │
│ "type": "github" │
│ } │
│ }, │
│ + "nix-minecraft": { │
│ + "inputs": { │
│ + "flake-compat": "flake-compat_2", │
│ + "flake-utils": [ │
│ + "flake-utils" │
│ + ], │
│ + "nixpkgs": [ │
│ + "nixpkgs" │
│ + ] │
│ + }, │
│ + "locked": { │
│ + "lastModified": 1738547119, │
│ + "narHash": "sha256-cc6AfR7W0AavgqA5nHUXRUus4Rr7oPWQNku5nhR4SYs=", │
│ + "owner": "Infinidoge", │
│ + "repo": "nix-minecraft", │
│ + "rev": "5b93268c80c3300dbec0fbbb2b50f674f84a474a", │
│ + "type": "github" │
│ + }, │
│ + "original": { │
│ + "owner": "Infinidoge", │
│ + "repo": "nix-minecraft", │
│ + "type": "github" │
│ + } │
│ + }, │
│ "nixpkgs": { │
│ "locked": { │
│ "lastModified": 1737885589, │
│ @@ -3954,7 +3994,7 @@ │
│ }, │
│ "pre-commit-hooks_2": { │
│ "inputs": { │
│ - "flake-compat": "flake-compat_2", │
│ + "flake-compat": "flake-compat_3", │
│ "gitignore": "gitignore_2", │
│ "nixpkgs": [ │
│ "secrets", │
│ @@ -3989,6 +4029,7 @@ │
│ "hyprlock": "hyprlock", │
│ "hyprpaper": "hyprpaper", │
│ "nix-index-db": "nix-index-db", │
│ + "nix-minecraft": "nix-minecraft", │
│ "nixpkgs": "nixpkgs_2", │
│ "nvf": "nvf", │
│ "secrets": "secrets", │
└────────────────────────────────────────────────────────────────────────────────────┘
┌─ flake.lock ─────────────────────────┐
│ diff --git a/flake.lock b/flake.lock │
│ index 95c32e0..f083fad 100644 │
│ --- a/flake.lock │
│ +++ b/flake.lock │
│ @@ -182,6 +182,22 @@ │
│ } │
│ }, │
│ "flake-compat_2": { │
│ + "flake": false, │
│ + "locked": { │
│ + "lastModified": 1673956053, │
│ + "narHash": "sha256-4gtG9iQuiKITOjNQ │
│ QeQIpoIB6b16fm+504Ch3sNKLd8=", │
│ + "owner": "edolstra", │
│ + "repo": "flake-compat", │
│ + "rev": "35bb57c0c8d8b62bbfd284272c9 │
│ 28ceb64ddbde9", │
│ + "type": "github" │
│ + }, │
│ + "original": { │
│ + "owner": "edolstra", │
│ + "repo": "flake-compat", │
│ + "type": "github" │
│ + } │
│ + }, │
│ + "flake-compat_3": { │
│ "flake": false, │
│ "locked": { │
│ "lastModified": 1696426674, │
│ @@ -1013,6 +1029,30 @@ │
│ "type": "github" │
│ } │
│ }, │
│ + "nix-minecraft": { │
│ + "inputs": { │
│ + "flake-compat": "flake-compat_2", │
│ + "flake-utils": [ │
│ + "flake-utils" │
│ + ], │
│ + "nixpkgs": [ │
│ + "nixpkgs" │
│ + ] │
│ + }, │
│ + "locked": { │
│ + "lastModified": 1738547119, │
│ + "narHash": "sha256-cc6AfR7W0AavgqA5 │
│ nHUXRUus4Rr7oPWQNku5nhR4SYs=", │
│ + "owner": "Infinidoge", │
│ + "repo": "nix-minecraft", │
│ + "rev": "5b93268c80c3300dbec0fbbb2b5 │
│ 0f674f84a474a", │
│ + "type": "github" │
│ + }, │
│ + "original": { │
│ + "owner": "Infinidoge", │
│ + "repo": "nix-minecraft", │
│ + "type": "github" │
│ + } │
│ + }, │
│ "nixpkgs": { │
│ "locked": { │
│ "lastModified": 1737885589, │
│ @@ -3954,7 +3994,7 @@ │
│ }, │
│ "pre-commit-hooks_2": { │
│ "inputs": { │
│ - "flake-compat": "flake-compat_2", │
│ + "flake-compat": "flake-compat_3", │
│ "gitignore": "gitignore_2", │
│ "nixpkgs": [ │
│ "secrets", │
│ @@ -3989,6 +4029,7 @@ │
│ "hyprlock": "hyprlock", │
│ "hyprpaper": "hyprpaper", │
│ "nix-index-db": "nix-index-db", │
│ + "nix-minecraft": "nix-minecraft", │
│ "nixpkgs": "nixpkgs_2", │
│ "nvf": "nvf", │
│ "secrets": "secrets", │
└──────────────────────────────────────────────┘
┌─ flake.nix ────────────────────────────────────────────────────────────────┐
│ diff --git a/flake.nix b/flake.nix │
│ index 176273c..3a39dca 100644 │
│ --- a/flake.nix │
│ +++ b/flake.nix │
│ @@ -106,5 +106,13 @@ │
│ systems.follows = "hyprland/systems"; │
│ }; │
│ }; │
│ + nix-minecraft = { │
│ + url = "github:Infinidoge/nix-minecraft"; │
│ + inputs = { │
│ + nixpkgs.follows = "nixpkgs"; │
│ + │
│ + flake-utils.follows = "flake-utils"; │
│ + }; │
│ + }; │
│ }; │
│ } │
└────────────────────────────────────────────────────────────────────────────────────┘
┌─ flake.nix ──────────────────────────┐
│ diff --git a/flake.nix b/flake.nix │
│ index 176273c..3a39dca 100644 │
│ --- a/flake.nix │
│ +++ b/flake.nix │
│ @@ -106,5 +106,13 @@ │
│ systems.follows = "hyprland/systems │
│ "; │
│ }; │
│ }; │
│ + nix-minecraft = { │
│ + url = "github:Infinidoge/nix-minecraf │
│ t"; │
│ + inputs = { │
│ + nixpkgs.follows = "nixpkgs"; │
│ + │
│ + flake-utils.follows = "flake-utils" │
│ ; │
│ + }; │
│ + }; │
│ }; │
│ } │
└──────────────────────────────────────────────┘
┌─ modules/home/workstation/gaming/default.nix ──────────────────────────────┐
│ diff --git a/modules/home/workstation/gaming/default.nix b/modules/home/workstatio │
│ n/gaming/default.nix │
│ index 4412448..72d6030 100644 │
│ --- a/modules/home/workstation/gaming/default.nix │
│ +++ b/modules/home/workstation/gaming/default.nix │
│ @@ -12,6 +12,7 @@ in { │
│ ./bottles.nix │
│ ./emulation.nix │
│ ./project-plus │
│ + ./minecraft.nix │
│ ]; │
│ config = mkIf (elem "gaming" profiles) { │
│ ooknet.binds = { │
└────────────────────────────────────────────────────────────────────────────────────┘
┌─ ...orkstation/gaming/default.nix ───┐
│ diff --git a/modules/home/workstation/gaming │
│ /default.nix b/modules/home/workstation/gami │
│ ng/default.nix │
│ index 4412448..72d6030 100644 │
│ --- a/modules/home/workstation/gaming/defaul │
│ t.nix │
│ +++ b/modules/home/workstation/gaming/defaul │
│ t.nix │
│ @@ -12,6 +12,7 @@ in { │
│ ./bottles.nix │
│ ./emulation.nix │
│ ./project-plus │
│ + ./minecraft.nix │
│ ]; │
│ config = mkIf (elem "gaming" profiles) { │
│ ooknet.binds = { │
└──────────────────────────────────────────────┘
┌─ modules/home/workstation/gaming/minecraft.nix ────────────────────────────┐
│ diff --git a/modules/home/workstation/gaming/minecraft.nix b/modules/home/workstat │
│ ion/gaming/minecraft.nix │
│ new file mode 100644 │
│ index 0000000..aafcd09 │
│ --- /dev/null │
│ +++ b/modules/home/workstation/gaming/minecraft.nix │
│ @@ -0,0 +1,19 @@ │
│ +{ │
│ + lib, │
│ + osConfig, │
│ + pkgs, │
│ + ... │
│ +}: let │
│ + inherit (lib) mkIf elem; │
│ + inherit (builtins) attrValues; │
│ + inherit (osConfig.ooknet.workstation) profiles; │
│ +in { │
│ + config = mkIf (elem "gaming" profiles) { │
│ + home.packages = attrValues { │
│ + inherit │
│ + (pkgs) │
│ + lunar-client │
│ + ; │
│ + }; │
│ + }; │
│ +} │
└────────────────────────────────────────────────────────────────────────────────────┘
┌─ ...kstation/gaming/minecraft.nix ───┐
│ diff --git a/modules/home/workstation/gaming │
│ /minecraft.nix b/modules/home/workstation/ga │
│ ming/minecraft.nix │
│ new file mode 100644 │
│ index 0000000..aafcd09 │
│ --- /dev/null │
│ +++ b/modules/home/workstation/gaming/minecr │
│ aft.nix │
│ @@ -0,0 +1,19 @@ │
│ +{ │
│ + lib, │
│ + osConfig, │
│ + pkgs, │
│ + ... │
│ +}: let │
│ + inherit (lib) mkIf elem; │
│ + inherit (builtins) attrValues; │
│ + inherit (osConfig.ooknet.workstation) pro │
│ files; │
│ +in { │
│ + config = mkIf (elem "gaming" profiles) { │
│ + home.packages = attrValues { │
│ + inherit │
│ + (pkgs) │
│ + lunar-client │
│ + ; │
│ + }; │
│ + }; │
│ +} │
└──────────────────────────────────────────────┘
┌─ modules/nixos/server/services/default.nix ────────────────────────────────┐
│ diff --git a/modules/nixos/server/services/default.nix b/modules/nixos/server/serv │
│ ices/default.nix │
│ index 5bad467..c509cbf 100644 │
│ --- a/modules/nixos/server/services/default.nix │
│ +++ b/modules/nixos/server/services/default.nix │
│ @@ -3,5 +3,6 @@ │
│ ./website │
│ ./forgejo │
│ ./ookflix │
│ + ./minecraft │
│ ]; │
│ } │
└────────────────────────────────────────────────────────────────────────────────────┘
┌─ ...s/server/services/default.nix ───┐
│ diff --git a/modules/nixos/server/services/d │
│ efault.nix b/modules/nixos/server/services/d │
│ efault.nix │
│ index 5bad467..c509cbf 100644 │
│ --- a/modules/nixos/server/services/default. │
│ nix │
│ +++ b/modules/nixos/server/services/default. │
│ nix │
│ @@ -3,5 +3,6 @@ │
│ ./website │
│ ./forgejo │
│ ./ookflix │
│ + ./minecraft │
│ ]; │
│ } │
└──────────────────────────────────────────────┘
┌─ modules/nixos/server/services/minecraft/default.nix ──────────────────────┐
│ diff --git a/modules/nixos/server/services/minecraft/default.nix b/modules/nixos/s │
│ erver/services/minecraft/default.nix │
│ new file mode 100644 │
│ index 0000000..2a5833a │
│ --- /dev/null │
│ +++ b/modules/nixos/server/services/minecraft/default.nix │
│ @@ -0,0 +1,39 @@ │
│ +{ │
│ + lib, │
│ + config, │
│ + inputs, │
│ + ... │
│ +}: let │
│ + inherit (lib) elem mkIf; │
│ + inherit (config.ooknet.server) services; │
│ +in { │
│ + imports = [ │
│ + inputs.nix-minecraft.nixosModules.minecraft-servers │
│ + ./reverse-proxy.nix │
│ + ]; │
│ + config = mkIf (elem "minecraft" services) { │
│ + services.minecraft-servers = { │
│ + enable = true; │
│ + eula = true; │
│ + servers.ookscraft = { │
│ + enable = true; │
│ + openFirewall = true; │
│ + autoStart = true; │
│ + │
│ + serverProperties = { │
│ + openFirewall = true; │
│ + motd = "ook ook"; │
│ + server-port = 25565; │
│ + difficulty = "hard"; │
│ + gamemode = "survival"; │
│ + online-mode = true; │
│ + enable-rcon = true; │
│ + "rcon.password" = "ooksmoneymoves"; │
│ + view-distance = 8; │
│ + simulation-distance = 8; │
│ + allow-flight = true; │
│ + }; │
│ + }; │
│ + }; │
│ + }; │
│ +} │
└────────────────────────────────────────────────────────────────────────────────────┘
┌─ ...ervices/minecraft/default.nix ───┐
│ diff --git a/modules/nixos/server/services/m │
│ inecraft/default.nix b/modules/nixos/server/ │
│ services/minecraft/default.nix │
│ new file mode 100644 │
│ index 0000000..2a5833a │
│ --- /dev/null │
│ +++ b/modules/nixos/server/services/minecraf │
│ t/default.nix │
│ @@ -0,0 +1,39 @@ │
│ +{ │
│ + lib, │
│ + config, │
│ + inputs, │
│ + ... │
│ +}: let │
│ + inherit (lib) elem mkIf; │
│ + inherit (config.ooknet.server) services; │
│ +in { │
│ + imports = [ │
│ + inputs.nix-minecraft.nixosModules.minec │
│ raft-servers │
│ + ./reverse-proxy.nix │
│ + ]; │
│ + config = mkIf (elem "minecraft" services) │
│ { │
│ + services.minecraft-servers = { │
│ + enable = true; │
│ + eula = true; │
│ + servers.ookscraft = { │
│ + enable = true; │
│ + openFirewall = true; │
│ + autoStart = true; │
│ + │
│ + serverProperties = { │
│ + openFirewall = true; │
│ + motd = "ook ook"; │
│ + server-port = 25565; │
│ + difficulty = "hard"; │
│ + gamemode = "survival"; │
│ + online-mode = true; │
│ + enable-rcon = true; │
│ + "rcon.password" = "ooksmoneymoves │
│ "; │
│ + view-distance = 8; │
│ + simulation-distance = 8; │
│ + allow-flight = true; │
│ + }; │
│ + }; │
│ + }; │
│ + }; │
│ +} │
└──────────────────────────────────────────────┘
┌─ modules/nixos/server/services/minecraft/reverse-proxy.nix ────────────────┐
│ diff --git a/modules/nixos/server/services/minecraft/reverse-proxy.nix b/modules/n │
│ ixos/server/services/minecraft/reverse-proxy.nix │
│ new file mode 100644 │
│ index 0000000..06e59f9 │
│ --- /dev/null │
│ +++ b/modules/nixos/server/services/minecraft/reverse-proxy.nix │
│ @@ -0,0 +1,40 @@ │
│ +{ │
│ + lib, │
│ + config, │
│ + ... │
│ +}: let │
│ + inherit (lib) mkIf elem; │
│ + inherit (config.ooknet.server) services; │
│ +in { │
│ + config = mkIf (elem "minecraft-proxy" services) { │
│ + services.haproxy = { │
│ + enable = true; │
│ + config = '' │
│ + global │
│ + maxconn 32768 │
│ + log stdout format raw local0 info │
│ + │
│ + defaults │
│ + mode tcp │
│ + log global │
│ + option tcplog │
│ + option dontlognull │
│ + timeout connect 5s │
│ + timeout client 30s │
│ + timeout server 30s │
│ + │
│ + frontend minecraft_frontend │
│ + bind :25565 │
│ + default_backend minecraft_backend │
│ + │
│ + backend minecraft_backend │
│ + server minecraft ooksmedia.taila3ca6.ts.net:25565 check │
│ + ''; │
│ + }; │
│ + │
│ + networking.firewall = { │
│ + allowedTCPPorts = [25565]; │
│ + allowedUDPPorts = [25565]; │
│ + }; │
│ + }; │
│ +} │
└────────────────────────────────────────────────────────────────────────────────────┘
┌─ ...s/minecraft/reverse-proxy.nix ───┐
│ diff --git a/modules/nixos/server/services/m │
│ inecraft/reverse-proxy.nix b/modules/nixos/s │
│ erver/services/minecraft/reverse-proxy.nix │
│ new file mode 100644 │
│ index 0000000..06e59f9 │
│ --- /dev/null │
│ +++ b/modules/nixos/server/services/minecraf │
│ t/reverse-proxy.nix │
│ @@ -0,0 +1,40 @@ │
│ +{ │
│ + lib, │
│ + config, │
│ + ... │
│ +}: let │
│ + inherit (lib) mkIf elem; │
│ + inherit (config.ooknet.server) services; │
│ +in { │
│ + config = mkIf (elem "minecraft-proxy" ser │
│ vices) { │
│ + services.haproxy = { │
│ + enable = true; │
│ + config = '' │
│ + global │
│ + maxconn 32768 │
│ + log stdout format raw local0 info │
│ + │
│ + defaults │
│ + mode tcp │
│ + log global │
│ + option tcplog │
│ + option dontlognull │
│ + timeout connect 5s │
│ + timeout client 30s │
│ + timeout server 30s │
│ + │
│ + frontend minecraft_frontend │
│ + bind :25565 │
│ + default_backend minecraft_backend │
│ + │
│ + backend minecraft_backend │
│ + server minecraft ooksmedia.taila3 │
│ ca6.ts.net:25565 check │
│ + ''; │
│ + }; │
│ + │
│ + networking.firewall = { │
│ + allowedTCPPorts = [25565]; │
│ + allowedUDPPorts = [25565]; │
│ + }; │
│ + }; │
│ +} │
└──────────────────────────────────────────────┘
[ BACK TO LOG ]
──────────────────────────────────────────────────────────────────────────────────────
OOKNET
────────────────────────────────────────────────
OOKNET