From cf2a201c7a768cfa31722bcf972ae064d27ba0a3 Mon Sep 17 00:00:00 2001 From: Toast Date: Fri, 23 Aug 2024 16:40:26 +0200 Subject: [PATCH 1/4] Flake: add nix-minecraft module to Everest --- flake.lock | 76 ++++++++++++++++++++++++++++++++++++++++++++++++++++-- flake.nix | 7 +++++ 2 files changed, 81 insertions(+), 2 deletions(-) diff --git a/flake.lock b/flake.lock index 69b6ffa..b8eecd2 100644 --- a/flake.lock +++ b/flake.lock @@ -58,6 +58,22 @@ } }, "flake-compat": { + "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_2": { "flake": false, "locked": { "lastModified": 1696426674, @@ -113,6 +129,24 @@ "inputs": { "systems": "systems_4" }, + "locked": { + "lastModified": 1681202837, + "narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "cfacdce06f30d2b68473a46042957675eebb3401", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_4": { + "inputs": { + "systems": "systems_5" + }, "locked": { "lastModified": 1710146030, "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", @@ -393,6 +427,28 @@ "type": "github" } }, + "nix-minecraft": { + "inputs": { + "flake-compat": "flake-compat", + "flake-utils": "flake-utils_3", + "nixpkgs": [ + "nixpkgs-raw" + ] + }, + "locked": { + "lastModified": 1724377000, + "narHash": "sha256-TITxaXuhO8vDScZoE7i7E2BTXoJzZmKTk6qRkmI2d+o=", + "owner": "Infinidoge", + "repo": "nix-minecraft", + "rev": "b464de49b4d6ea8faf1988e02fc59c4908a7ff91", + "type": "github" + }, + "original": { + "owner": "Infinidoge", + "repo": "nix-minecraft", + "type": "github" + } + }, "nixos-hardware": { "locked": { "lastModified": 1723310128, @@ -509,6 +565,7 @@ "nix-impermanence": "nix-impermanence", "nix-index-db": "nix-index-db", "nix-index-db-unstable": "nix-index-db-unstable", + "nix-minecraft": "nix-minecraft", "nixos-hardware": "nixos-hardware", "nixpkgs-raw": "nixpkgs-raw", "nixpkgs-unstable-raw": "nixpkgs-unstable-raw", @@ -594,10 +651,25 @@ "type": "github" } }, + "systems_5": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, "vscode-extensions": { "inputs": { - "flake-compat": "flake-compat", - "flake-utils": "flake-utils_3", + "flake-compat": "flake-compat_2", + "flake-utils": "flake-utils_4", "nixpkgs": [ "nixpkgs-unstable-raw" ] diff --git a/flake.nix b/flake.nix index 6877338..3522f18 100644 --- a/flake.nix +++ b/flake.nix @@ -83,6 +83,11 @@ inputs.nixpkgs.follows = "nixpkgs-unstable-raw"; inputs.lix.follows = "lix"; }; + + nix-minecraft = { + url = "github:Infinidoge/nix-minecraft"; + inputs.nixpkgs.follows = "nixpkgs-raw"; + }; }; outputs = {...} @ inputs: @@ -234,6 +239,8 @@ nix-index-db.nixosModules.nix-index catppuccin.nixosModules.catppuccin lix-module.nixosModules.default + nix-minecraft.nixosModules.minecraft-servers + {nixpkgs.overlays = [nix-minecraft.overlay];} ./roles/common ./roles/server ./machines/Everest From 5bf5c9f737aa10f564e2c09878c0a731e0cd1efe Mon Sep 17 00:00:00 2001 From: Toast Date: Fri, 23 Aug 2024 18:06:12 +0200 Subject: [PATCH 2/4] Machines/Everest: mount root subvolume of ssd --- machines/Everest/hardware-configuration.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/machines/Everest/hardware-configuration.nix b/machines/Everest/hardware-configuration.nix index b4727f0..8689a77 100755 --- a/machines/Everest/hardware-configuration.nix +++ b/machines/Everest/hardware-configuration.nix @@ -37,6 +37,11 @@ fsType = "btrfs"; options = ["compress=zstd" "subvol=/" "ro"]; }; + "/mnt/ssd" = { + device = "/dev/disk/by-uuid/5322c217-b87b-4150-8b4c-a8fa17a899bf"; + fsType = "btrfs"; + options = ["subvol=/" "ro"]; + }; "/persist" = { device = "/dev/disk/by-label/Everest"; fsType = "btrfs"; From 100f7ec33e9de414003519772a21c9e3ef9984a0 Mon Sep 17 00:00:00 2001 From: Toast Date: Fri, 23 Aug 2024 20:36:58 +0200 Subject: [PATCH 3/4] Server/minecraft: make vr locals server --- roles/server/default.nix | 1 + roles/server/minecraft.nix | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 roles/server/minecraft.nix diff --git a/roles/server/default.nix b/roles/server/default.nix index 5e32379..d1e29aa 100755 --- a/roles/server/default.nix +++ b/roles/server/default.nix @@ -14,5 +14,6 @@ ./caddy.nix ./dns.nix ./rust_motd.nix + ./minecraft.nix ]; } diff --git a/roles/server/minecraft.nix b/roles/server/minecraft.nix new file mode 100644 index 0000000..94ce9e1 --- /dev/null +++ b/roles/server/minecraft.nix @@ -0,0 +1,23 @@ +{pkgs, lib, ...}: { + nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ + "minecraft-server" + ]; + + services.minecraft-servers = { + enable = true; + eula = true; + openFirewall = true; + servers = { + vrlocals = { + enable = true; + package = pkgs.fabricServers.fabric-1_20_1; + serverProperties = { + motd = "Test server. Don't build anything important!"; + server-port = 25565; + enable-command-block = true; + sync-chunk-writes = false; + }; + }; + }; + }; +} From 2626ac99c3ab39052092aeaf268492ba10f0f3e9 Mon Sep 17 00:00:00 2001 From: Toast Date: Sat, 24 Aug 2024 03:05:19 +0200 Subject: [PATCH 4/4] Server/minecraft: change vr locals server settings --- roles/server/minecraft.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/roles/server/minecraft.nix b/roles/server/minecraft.nix index 94ce9e1..72c49c5 100644 --- a/roles/server/minecraft.nix +++ b/roles/server/minecraft.nix @@ -12,11 +12,16 @@ enable = true; package = pkgs.fabricServers.fabric-1_20_1; serverProperties = { - motd = "Test server. Don't build anything important!"; + motd = "\\u00A7aBigChadGuys \\u00A7lPlus \\u00A7a(w/Cobblemon!) v2.6.1\\u00A7r\\n\\u00A76Have fun!"; server-port = 25565; + level-seed = "-1450714289616987871"; + white-list = true; enable-command-block = true; sync-chunk-writes = false; }; + whitelist = { + Toast_003 = "b3ca4afb-a3da-4a78-85c3-2292fd0787e2"; + }; }; }; };