Compare commits
5
Commits
57490387aa
...
krile
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1bf77e4eb6
|
||
|
|
4965e9ed1d | ||
|
|
b42f545195
|
||
|
|
b27fa2440e | ||
|
|
6ae398abdc |
No files matched your search
Generated
+110
-55
@@ -9,11 +9,11 @@
|
||||
"rust-overlay": "rust-overlay"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1789138122,
|
||||
"narHash": "sha256-mh+ZiGCtHAo0xIi1yaNjHsftfnlWz9JiYwHCyT16yIE=",
|
||||
"lastModified": 1792853286,
|
||||
"narHash": "sha256-l/Oh5k1NQqQuwh4gBF3VcmCF0WGiCT/LqfvY5huhOq4=",
|
||||
"owner": "ezKEa",
|
||||
"repo": "aagl-gtk-on-nix",
|
||||
"rev": "d82d6d6f66caf4b63fb154e62fad83c627874127",
|
||||
"rev": "e9a3b8fdb50a7d77a90c02c84e298c286310385b",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -32,11 +32,11 @@
|
||||
"rust-overlay": "rust-overlay_2"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1790492877,
|
||||
"narHash": "sha256-RK9eeRQv9l3pQ8qNCdJ8fpkFCp/+QpNn7lR7Kkfrv8w=",
|
||||
"lastModified": 1792911802,
|
||||
"narHash": "sha256-GdMiAfj8hRDCqrE2AvQJ3atf0y2XVGFx9/Ptr6qiju0=",
|
||||
"ref": "refs/heads/master",
|
||||
"rev": "d3216bbe660f8265f1393ecf263ab5f8662f5a58",
|
||||
"revCount": 26,
|
||||
"rev": "a355f99a17b9dc38fc626b80340646a94ae7f1c9",
|
||||
"revCount": 30,
|
||||
"type": "git",
|
||||
"url": "https://scm.wyattjmiller.com/wymiller/caitsith.git"
|
||||
},
|
||||
@@ -52,11 +52,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1783744694,
|
||||
"narHash": "sha256-2cp6N3rrwnGYLTx9l6N+NI+kwrCWxvJUbj5WJhvB29A=",
|
||||
"lastModified": 1792800221,
|
||||
"narHash": "sha256-53jIZEWNh96irEXhsMZFoNhLJgGSU3nYl1i4wFQHAsU=",
|
||||
"owner": "lnl7",
|
||||
"repo": "nix-darwin",
|
||||
"rev": "c3e90c89649b07d1a96e4b9dd6cd0d6e44b91a74",
|
||||
"rev": "d31953cf55f9027a56e9be938daf5db8c5655663",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -74,11 +74,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1786845137,
|
||||
"narHash": "sha256-oQFip+v0luP8NIxJzmiW4Wu8bILsbFWom5l0zonl8hQ=",
|
||||
"lastModified": 1792737899,
|
||||
"narHash": "sha256-P0/GhewcEQmAbzq3QunNWY2jLJaYH9F6c/5dEM/jQ4M=",
|
||||
"owner": "LnL7",
|
||||
"repo": "nix-darwin",
|
||||
"rev": "4cff07de74b50e64bdd68cd4e722ab5b6b35ee48",
|
||||
"rev": "bb0b90dbd54e207100de72b5dcbe3188c98a4b69",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -136,6 +136,22 @@
|
||||
}
|
||||
},
|
||||
"flake-compat_4": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1747046372,
|
||||
"narHash": "sha256-CIVLLkVgvHYbgI2UpXvIIBJ12HWgX+fjA8Xf8PUmqCY=",
|
||||
"owner": "edolstra",
|
||||
"repo": "flake-compat",
|
||||
"rev": "9100a0f413b0c601e0533d1d94ffd501ce2e7885",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "edolstra",
|
||||
"repo": "flake-compat",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-compat_5": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1777699697,
|
||||
@@ -267,11 +283,11 @@
|
||||
"nixpkgs": "nixpkgs"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1791626528,
|
||||
"narHash": "sha256-kWT9qwTKo6igVW+PweF2yZGlnfGRAcK4gsxpC/Yv7vA=",
|
||||
"lastModified": 1792644631,
|
||||
"narHash": "sha256-3aILZu5bQ+6khPvGCdIbC7wBFZOgPbpP0TBSL9tf89E=",
|
||||
"owner": "purpleclay",
|
||||
"repo": "go-overlay",
|
||||
"rev": "63bc96eab718f6f78c6d78f1309c3a58a8babfc6",
|
||||
"rev": "ff2b494b477eb4349dd40f0564cedab552f9804d",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -290,11 +306,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1790872110,
|
||||
"narHash": "sha256-dXrMwUGE/9pT0J7MeW1BuYxpnnPPc52/oLxfqQF/5q8=",
|
||||
"lastModified": 1792644631,
|
||||
"narHash": "sha256-3aILZu5bQ+6khPvGCdIbC7wBFZOgPbpP0TBSL9tf89E=",
|
||||
"owner": "purpleclay",
|
||||
"repo": "go-overlay",
|
||||
"rev": "8e136930a2a34c501d612f7b7b0ee8806531768f",
|
||||
"rev": "ff2b494b477eb4349dd40f0564cedab552f9804d",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -313,11 +329,11 @@
|
||||
"rust-overlay": "rust-overlay_3"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1790492923,
|
||||
"narHash": "sha256-pi8p2jRW9pprb0ZFH50/Z9Bxv0bKgddMXbLZ0D03L3w=",
|
||||
"lastModified": 1792911744,
|
||||
"narHash": "sha256-iXH6FL8HYaZg0+p9lUv5bEc4k1YpvwKFYtMYbY1phTA=",
|
||||
"ref": "refs/heads/master",
|
||||
"rev": "580082101efc0807637529e539886ee6c5f95672",
|
||||
"revCount": 15,
|
||||
"rev": "01ff244467f011033d98286e8f4171a890e9060a",
|
||||
"revCount": 19,
|
||||
"type": "git",
|
||||
"url": "https://scm.wyattjmiller.com/wymiller/hildibrand.git"
|
||||
},
|
||||
@@ -333,11 +349,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1790996401,
|
||||
"narHash": "sha256-f+kOxEmOUnQazVAmGg0i8hzwgd1kX/geY+k/Dpheye8=",
|
||||
"lastModified": 1792818383,
|
||||
"narHash": "sha256-199i7ubVSXTMl+0AAlL7cVCXSjcI+jWByMcimYjeMX0=",
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"rev": "db7d5e2332710f5abb088f6b5de927d7f9511b35",
|
||||
"rev": "24f2190587513b9c2f73db112a17844ae912d965",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -355,11 +371,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1790989254,
|
||||
"narHash": "sha256-ZN+riaeFuE+DZ5zfqJiXlM12jLwZzeIXiNkU1YeHMXI=",
|
||||
"lastModified": 1792896866,
|
||||
"narHash": "sha256-/0tELNnhdSnP+bHSdWiEe6KpfSwi6WrTnT9cm/jNkjA=",
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"rev": "acd21c5a3420a9d5fd0ed06299b10828267ef9ba",
|
||||
"rev": "c216bf5a1f173b0481bd5c8c489ebe5595ecc68c",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -399,6 +415,29 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nix-minecraft": {
|
||||
"inputs": {
|
||||
"flake-compat": "flake-compat_4",
|
||||
"nixpkgs": [
|
||||
"nur",
|
||||
"nixpkgs"
|
||||
],
|
||||
"systems": "systems_3"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1792988509,
|
||||
"narHash": "sha256-1Li/v57ePpV9t6E57w/XTu760H6hYHztwm1RSd6RA8k=",
|
||||
"owner": "Infinidoge",
|
||||
"repo": "nix-minecraft",
|
||||
"rev": "931d87d3811cabc0277be27b94392d19291bd344",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "Infinidoge",
|
||||
"repo": "nix-minecraft",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1789286504,
|
||||
@@ -417,11 +456,11 @@
|
||||
},
|
||||
"nixpkgs_2": {
|
||||
"locked": {
|
||||
"lastModified": 1791426274,
|
||||
"narHash": "sha256-MWhktfFtFE8Jl7bf9Pkp7TR5MSdYCjCswSo0Gkb4ywc=",
|
||||
"lastModified": 1792898606,
|
||||
"narHash": "sha256-Mg3rRjsbMqhSMxop5PYMXos8SwAjejrxSgVThTvP9eg=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "7c8764b7c7b09b34f632464276218ef9090eaa11",
|
||||
"rev": "1f607aa79b6356ed45d3cd3c8079c196e79efa2c",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -433,11 +472,11 @@
|
||||
},
|
||||
"nixpkgs_3": {
|
||||
"locked": {
|
||||
"lastModified": 1790920529,
|
||||
"narHash": "sha256-nQyFkMR78WP6PiXKkDW2SjqzLf/spQqjRuxRGSbcV8k=",
|
||||
"lastModified": 1792615934,
|
||||
"narHash": "sha256-MlvRfa1O5Cqc2/a+gG+l9TSuowEoCKCmrJ1d9oAVm0I=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "774debe7a0d1b496e35677ad955a1011c6ff74f3",
|
||||
"rev": "da6dc0e7b26060f2f71ce3ef7088fb56ee44fa36",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -483,15 +522,16 @@
|
||||
"go-overlay": "go-overlay_2",
|
||||
"hildibrand": "hildibrand",
|
||||
"home-manager": "home-manager_2",
|
||||
"nix-minecraft": "nix-minecraft",
|
||||
"nixpkgs": "nixpkgs_3",
|
||||
"rust-overlay": "rust-overlay_4"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1791097561,
|
||||
"narHash": "sha256-AmeVVy0WbW/y/sZv7ZGYn3dY6HuHPqvUgYorahAe4lM=",
|
||||
"lastModified": 1793051642,
|
||||
"narHash": "sha256-b+CbWZU8sYR9TNBg6KJur680E+5+Zm4S4IVzkzFnJEc=",
|
||||
"ref": "refs/heads/master",
|
||||
"rev": "55e8c40fbcd0c848c38002fdefb37de7084715be",
|
||||
"revCount": 107,
|
||||
"rev": "8ec05b20cea4865f9fd5dd797c6e090f41863db1",
|
||||
"revCount": 121,
|
||||
"type": "git",
|
||||
"url": "https://scm.wyattjmiller.com/wymiller/nur.git"
|
||||
},
|
||||
@@ -502,16 +542,16 @@
|
||||
},
|
||||
"nvf": {
|
||||
"inputs": {
|
||||
"flake-compat": "flake-compat_4",
|
||||
"flake-compat": "flake-compat_5",
|
||||
"mnw": "mnw",
|
||||
"nixpkgs": "nixpkgs_4"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1791651540,
|
||||
"narHash": "sha256-cxmegj6Tg0xYk8A2icSl3v1+SeVDj+bESU2BnCqERPE=",
|
||||
"lastModified": 1793047357,
|
||||
"narHash": "sha256-eY8aBTGSgtx+25254i22jyjbj+JQkEIfb+JyQ2Exnuk=",
|
||||
"owner": "notashelf",
|
||||
"repo": "nvf",
|
||||
"rev": "19992540d372466340ededda0c065a3a0a962fd6",
|
||||
"rev": "60b4593979c39e9a1227c9913bd835bb1a59054b",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -563,11 +603,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1790407471,
|
||||
"narHash": "sha256-M8elY2UShg4ZuLTiRLEHO+ae5xQFp3/ReQdxp/R+1UU=",
|
||||
"lastModified": 1792825530,
|
||||
"narHash": "sha256-aphXA2IFNd3q48++TKmfuuvDDjkrgGdJDnDIhij9684=",
|
||||
"owner": "oxalica",
|
||||
"repo": "rust-overlay",
|
||||
"rev": "4e9bb05a9ab6c37dc74c22974ebed6e36dc73eb2",
|
||||
"rev": "5b9f1198b59bcb31c5c3250b332e7d77590e6306",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -585,11 +625,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1790407471,
|
||||
"narHash": "sha256-M8elY2UShg4ZuLTiRLEHO+ae5xQFp3/ReQdxp/R+1UU=",
|
||||
"lastModified": 1792825530,
|
||||
"narHash": "sha256-aphXA2IFNd3q48++TKmfuuvDDjkrgGdJDnDIhij9684=",
|
||||
"owner": "oxalica",
|
||||
"repo": "rust-overlay",
|
||||
"rev": "4e9bb05a9ab6c37dc74c22974ebed6e36dc73eb2",
|
||||
"rev": "5b9f1198b59bcb31c5c3250b332e7d77590e6306",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -606,11 +646,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1791013993,
|
||||
"narHash": "sha256-BiFPwFsbFnZH5GfWbQFKYuQNg+67aNQCoRSRNTeJFQc=",
|
||||
"lastModified": 1792825530,
|
||||
"narHash": "sha256-aphXA2IFNd3q48++TKmfuuvDDjkrgGdJDnDIhij9684=",
|
||||
"owner": "oxalica",
|
||||
"repo": "rust-overlay",
|
||||
"rev": "7470661ba2b51156048af08464b82020223dc942",
|
||||
"rev": "5b9f1198b59bcb31c5c3250b332e7d77590e6306",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -624,11 +664,11 @@
|
||||
"nixpkgs": "nixpkgs_5"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1791620365,
|
||||
"narHash": "sha256-CVZXIDNw7HEwyD8X6q9Ln370Sc0ZqRlTzDRwOZ1hJMY=",
|
||||
"lastModified": 1793000331,
|
||||
"narHash": "sha256-6sLQgHX/V/yF8VrhmsJroujeRua1GY3nDTEpnY7tHF4=",
|
||||
"owner": "oxalica",
|
||||
"repo": "rust-overlay",
|
||||
"rev": "e90fafa71b440fabcd52dd7fb017ab2da81c781a",
|
||||
"rev": "0d0575988e4bb9ebc4cf1afb1cec1ceac0b5914e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -666,6 +706,21 @@
|
||||
"repo": "default",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"systems_3": {
|
||||
"locked": {
|
||||
"lastModified": 1681028828,
|
||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"type": "github"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
|
||||
@@ -271,6 +271,30 @@
|
||||
];
|
||||
};
|
||||
|
||||
# Homestead 2.0 Minecraft server
|
||||
nixosConfigurations."krile" = nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
specialArgs = {
|
||||
inherit userName userEmail nur;
|
||||
hostname = "krile";
|
||||
role = "server";
|
||||
};
|
||||
modules = [
|
||||
myOverlays
|
||||
./modules/common
|
||||
./modules/machine/krile
|
||||
|
||||
home-manager.nixosModules.home-manager
|
||||
{
|
||||
home-manager.useGlobalPkgs = true;
|
||||
home-manager.useUserPackages = true;
|
||||
home-manager.extraSpecialArgs = extraSpecialArgs // { isNixOS = true; role = "server"; };
|
||||
home-manager.backupFileExtension = "bak";
|
||||
home-manager.users.${userName}.imports = [./home];
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
# generic non-NixOS Linux machine
|
||||
homeConfigurations."generic" = let
|
||||
hostname = builtins.getEnv "HOSTNAME";
|
||||
|
||||
+1
-1
@@ -70,7 +70,7 @@
|
||||
"Yer a wizard, Wyatt" \
|
||||
"Yer a lizard, Wyatt" \
|
||||
"Po-Tay-To boil em mash em stick em in a stew" \
|
||||
"Oh look it's the cutie patootie potato!"
|
||||
"Oh look it's the cutie patootie potato!" \
|
||||
"What a charming young man" \
|
||||
"Wyatt, you are smart, kind, and resilient. I believe in you no matter what life throws at you! Kick this project's butt!! - Nico" \
|
||||
"Ganbatte!"
|
||||
|
||||
@@ -0,0 +1,105 @@
|
||||
# Homestead 2.0 on krile
|
||||
|
||||
This module uses the Minecraft NixOS module and Fabric overlay re-exported by
|
||||
the existing `nur` flake input. It pins Minecraft 1.20.1, Fabric 0.19.5, Java 17,
|
||||
and the [official Homestead 2.0 server pack](https://cozystudios.org/homestead/server-pack/).
|
||||
The archive and all eight additional mods listed in its `startserver.sh` are
|
||||
downloaded with fixed SHA-256 hashes during the Nix build. The upstream startup
|
||||
script is not run.
|
||||
|
||||
`modules/machine/krile/configuration.nix` enables the server, accepts the Minecraft
|
||||
EULA, and opens TCP 25565 and UDP 24454 (Simple Voice Chat). Forward those ports
|
||||
to krile on your router if players connect from outside your network. Players
|
||||
need the Homestead 2.0 client pack.
|
||||
|
||||
The default heap is 6 GiB initially and 10 GiB maximum. Give the VM additional
|
||||
RAM for the OS, native libraries, and filesystem cache; 16 GiB total is a
|
||||
reasonable starting point.
|
||||
|
||||
## Deploy
|
||||
|
||||
On krile, from the repository root:
|
||||
|
||||
```bash
|
||||
nix eval --raw path:.#nixosConfigurations.krile.config.system.build.toplevel.drvPath
|
||||
sudo nixos-rebuild switch --flake path:.#krile
|
||||
```
|
||||
|
||||
The `path:.` form includes new files before they have been added to Git. Once the
|
||||
new module and krile files are tracked, `--flake .#krile` works as usual.
|
||||
|
||||
The service starts on boot and restarts after an unexpected exit. Check it with:
|
||||
|
||||
```bash
|
||||
systemctl status minecraft-server-homestead
|
||||
journalctl -u minecraft-server-homestead -f
|
||||
```
|
||||
|
||||
The console uses nix-minecraft's systemd FIFO. For example, run a command with:
|
||||
|
||||
```bash
|
||||
sudo sh -c 'echo list > /run/minecraft/homestead.stdin'
|
||||
```
|
||||
|
||||
Stop the service with `sudo systemctl stop minecraft-server-homestead` so it can
|
||||
save the world cleanly.
|
||||
|
||||
## Configuration and state
|
||||
|
||||
Worlds, player progress, and other runtime state live in
|
||||
`/srv/minecraft/homestead`. Back up that directory, particularly `world/`, before
|
||||
changing pack versions. The module does not provide automatic backups.
|
||||
|
||||
The `mods` directory and server icon are store symlinks. `config`, `defaultconfigs`,
|
||||
`kubejs`, `scripts`, and `patchouli_books` are writable copies of the pinned pack,
|
||||
recreated on each start and removed on stop by nix-minecraft. Edits to those
|
||||
copies do not persist across restarts. World data is not part of those managed
|
||||
directories.
|
||||
|
||||
Change memory in the host configuration:
|
||||
|
||||
```nix
|
||||
services.homestead.jvmOpts = "-Xms6G -Xmx12G -XX:+UseG1GC";
|
||||
```
|
||||
|
||||
Other server settings use the underlying nix-minecraft options:
|
||||
|
||||
```nix
|
||||
services.minecraft-servers.servers.homestead = {
|
||||
serverProperties = {
|
||||
server-port = 25566;
|
||||
max-players = 10;
|
||||
white-list = true;
|
||||
};
|
||||
# Add real player UUIDs here, or manage the whitelist through the console.
|
||||
whitelist = { };
|
||||
};
|
||||
```
|
||||
|
||||
Changing `server-port` also changes the opened TCP port. Voice chat remains on
|
||||
UDP 24454, matching the pack's `config/voicechat/voicechat-server.properties`.
|
||||
|
||||
To use this module on another NixOS host, pass `nur` in `specialArgs`, import
|
||||
`modules/games/homestead`, set `services.homestead.enable = true`, and set
|
||||
`services.minecraft-servers.eula = true` after accepting the EULA. The host must
|
||||
allow unfree packages, as the common modules already do for krile.
|
||||
|
||||
## Pack updates
|
||||
|
||||
For a new release, inspect the official archive and startup script, update the
|
||||
archive URL/hash in `package.nix`, update `required-mods.json` with any separate
|
||||
downloads and their hashes, and match the Minecraft/Fabric versions in
|
||||
`default.nix`. Evaluate and build before switching, then check the startup log.
|
||||
The pack is kept fixed at 2.0 until these declarations change.
|
||||
|
||||
## Validation
|
||||
|
||||
The krile system derivation evaluates, and the pack, Fabric launcher, and
|
||||
nix-minecraft setup/cleanup scripts build successfully. A temporary local server
|
||||
reached `Done`, started Simple Voice Chat, and exited with status 0 after `stop`,
|
||||
saving every dimension. Setup/cleanup was also checked to preserve world data
|
||||
and reset managed configs. Multiplayer gameplay was not tested.
|
||||
|
||||
The upstream 2.0 pack emits some nonfatal mixin/recipe warnings and an optional
|
||||
Falling Trees/Jade integration error during startup; these did not prevent the
|
||||
startup and shutdown check from passing.
|
||||
@@ -0,0 +1,81 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
nur,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
cfg = config.services.homestead;
|
||||
modpack = pkgs.callPackage ./package.nix { };
|
||||
in
|
||||
{
|
||||
imports = [ nur.nixosModules.minecraft-servers ];
|
||||
|
||||
options.services.homestead = {
|
||||
enable = lib.mkEnableOption "the Homestead 2.0 Minecraft server";
|
||||
|
||||
openFirewall = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
description = "Open the Minecraft TCP port and Simple Voice Chat UDP port (24454).";
|
||||
};
|
||||
|
||||
jvmOpts = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "-Xms6G -Xmx10G -XX:+UseG1GC";
|
||||
description = "JVM options for Homestead. Leave additional RAM for the OS and native allocations.";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
nixpkgs.overlays = [ nur.overlays.minecraft ];
|
||||
|
||||
services.minecraft-servers = {
|
||||
enable = true;
|
||||
servers.homestead = {
|
||||
enable = true;
|
||||
inherit (cfg) openFirewall jvmOpts;
|
||||
|
||||
package = pkgs.fabricServers.fabric-1_20_1.override {
|
||||
loaderVersion = "0.19.5";
|
||||
jre_headless = pkgs.jdk17_headless;
|
||||
};
|
||||
|
||||
managementSystem = {
|
||||
tmux.enable = false;
|
||||
systemd-socket.enable = true;
|
||||
};
|
||||
|
||||
# Match the properties generated by the pack's startserver.sh.
|
||||
serverProperties = lib.mapAttrs (_: lib.mkDefault) {
|
||||
motd = "Homestead 2.0";
|
||||
allow-flight = true;
|
||||
max-tick-time = 180000;
|
||||
simulation-distance = 6;
|
||||
view-distance = 10;
|
||||
server-port = 25565;
|
||||
online-mode = true;
|
||||
# keep-inventory = true;
|
||||
};
|
||||
|
||||
symlinks = {
|
||||
mods = "${modpack}/mods";
|
||||
"server-icon.png" = "${modpack}/server-icon.png";
|
||||
};
|
||||
|
||||
# Mods may rewrite their configs or generate files here. nix-minecraft
|
||||
# supplies writable copies on each start and cleans them on stop.
|
||||
files = lib.genAttrs [
|
||||
"config"
|
||||
"defaultconfigs"
|
||||
"kubejs"
|
||||
"scripts"
|
||||
"patchouli_books"
|
||||
] (dir: "${modpack}/${dir}");
|
||||
};
|
||||
};
|
||||
|
||||
networking.firewall.allowedUDPPorts = lib.mkIf cfg.openFirewall [ 24454 ];
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
{
|
||||
lib,
|
||||
stdenvNoCC,
|
||||
fetchurl,
|
||||
unzip,
|
||||
}:
|
||||
let
|
||||
# These eight downloads come from startserver.sh in the official 2.0 pack.
|
||||
requiredMods = map fetchurl (lib.importJSON ./required-mods.json);
|
||||
in
|
||||
stdenvNoCC.mkDerivation {
|
||||
pname = "homestead-server-pack";
|
||||
version = "2.0";
|
||||
|
||||
src = fetchurl {
|
||||
name = "Homestead-2.0-Server.zip";
|
||||
url = "https://drive.usercontent.google.com/download?id=1SpJBa80o_Jx_yqLjQ49pz7HP1FY2PCJj&export=download&confirm=t";
|
||||
hash = "sha256-QVenE6dz+lZPHkC1hwL7Yy4lw6vg/Cr/8pnmK3iaK4o=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ unzip ];
|
||||
dontUnpack = true;
|
||||
dontConfigure = true;
|
||||
dontBuild = true;
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
mkdir -p "$out"
|
||||
unzip -q "$src" \
|
||||
'mods/*' 'config/*' 'defaultconfigs/*' 'kubejs/*' \
|
||||
'scripts/*' 'patchouli_books/*' 'server-icon.png' -d "$out"
|
||||
|
||||
${lib.concatMapStringsSep "\n" (mod: ''
|
||||
install -m644 ${mod} "$out/mods/${mod.name}"
|
||||
'') requiredMods}
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
meta = {
|
||||
description = "Homestead 2.0 server assets, including the eight separately downloaded mods";
|
||||
homepage = "https://cozystudios.org/homestead/server-pack/";
|
||||
# The pack contains mods with different licenses; do not redistribute it.
|
||||
license = lib.licenses.unfree;
|
||||
platforms = lib.platforms.linux;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
[
|
||||
{
|
||||
"name": "balm-fabric-1.20.1-7.3.44.jar",
|
||||
"url": "https://edge.forgecdn.net/files/8969/704/balm-fabric-1.20.1-7.3.44.jar",
|
||||
"hash": "sha256-hMoKTCjV9cxwjuEqKQ+U4ixMntDxXZNM0MDCMPClpMY="
|
||||
},
|
||||
{
|
||||
"name": "CraftTweaker-fabric-1.20.1-14.0.60.jar",
|
||||
"url": "https://edge.forgecdn.net/files/7772/872/CraftTweaker-fabric-1.20.1-14.0.60.jar",
|
||||
"hash": "sha256-y4Kl3wHCNr6oY8SxxZtgaS/ARGHWVIK/eW1EZizqiQA="
|
||||
},
|
||||
{
|
||||
"name": "libraryferret-fabric-1.20.1-4.0.0.jar",
|
||||
"url": "https://edge.forgecdn.net/files/4601/231/libraryferret-fabric-1.20.1-4.0.0.jar",
|
||||
"hash": "sha256-d/UX69gN5R+fh62cTZIrNMQNfF+2iu1tl0zu0NthuG0="
|
||||
},
|
||||
{
|
||||
"name": "sophisticatedbackpacks-1.20.1-3.23.4.5.110.jar",
|
||||
"url": "https://edge.forgecdn.net/files/7147/929/sophisticatedbackpacks-1.20.1-3.23.4.5.110.jar",
|
||||
"hash": "sha256-Fewy1BGnA4R0OldwrmoitxqEGK9/juu/+se/yKGDbA8="
|
||||
},
|
||||
{
|
||||
"name": "sophisticatedcore-1.20.1-1.2.7.15.166.jar",
|
||||
"url": "https://edge.forgecdn.net/files/7341/57/sophisticatedcore-1.20.1-1.2.7.15.166.jar",
|
||||
"hash": "sha256-Fzmsti4i+ZQk8yQkuZYr2S0p4HUvVJWqEW35p8Hdgxo="
|
||||
},
|
||||
{
|
||||
"name": "sophisticatedstorage-1.20.1-1.3.5.11.142.jar",
|
||||
"url": "https://edge.forgecdn.net/files/8032/765/sophisticatedstorage-1.20.1-1.3.5.11.142.jar",
|
||||
"hash": "sha256-VgjSIGpr0TJlhLUrTFp7Mpvpw/izOqOiQGAHiu0Lz4k="
|
||||
},
|
||||
{
|
||||
"name": "trashslot-fabric-1.20.1-15.1.5.jar",
|
||||
"url": "https://edge.forgecdn.net/files/8019/425/trashslot-fabric-1.20.1-15.1.5.jar",
|
||||
"hash": "sha256-u876a68TrhF8ShNtf/ZrYlx1QLncwNQHe08jcIXuRAg="
|
||||
},
|
||||
{
|
||||
"name": "wirelessredstone-fabric-1.20.1-1.1.2.jar",
|
||||
"url": "https://edge.forgecdn.net/files/5175/782/wirelessredstone-fabric-1.20.1-1.1.2.jar",
|
||||
"hash": "sha256-Kw8xy4ngmAgD9kEvwAjTS6KatJEnA6UPkI1X3xnWf48="
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,88 @@
|
||||
{
|
||||
pkgs,
|
||||
userName,
|
||||
nur,
|
||||
...
|
||||
}: {
|
||||
imports = [
|
||||
../../pwrMgmt
|
||||
../../networking/core.nix
|
||||
../../virtualization/podman.nix
|
||||
../../games/homestead
|
||||
];
|
||||
|
||||
# Enable flakes for NixOS
|
||||
nix.settings.experimental-features = ["nix-command" "flakes"];
|
||||
|
||||
# Custom kernel/boot stuff
|
||||
boot.kernelPackages = pkgs.linuxPackages_latest;
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
boot.loader.efi.canTouchEfiVariables = true;
|
||||
|
||||
# Set your timezone
|
||||
time.timeZone = "America/Detroit";
|
||||
|
||||
# Enable OpenSSH
|
||||
services.openssh.enable = true;
|
||||
|
||||
# Enable keyring
|
||||
services.gnome.gnome-keyring.enable = true;
|
||||
|
||||
# Enable GnuPG
|
||||
programs.gnupg.agent = {
|
||||
enable = true;
|
||||
enableSSHSupport = true;
|
||||
};
|
||||
|
||||
# Enable SUID wrappers (some programs need them)
|
||||
programs.mtr.enable = true;
|
||||
|
||||
# Enable Polkit
|
||||
security.polkit.enable = true;
|
||||
|
||||
# Power management (see ../../pwrMgmt/default.nix)
|
||||
pwrMgmt = {
|
||||
enable = true;
|
||||
cpuFreqGovernor = "performance";
|
||||
powertop.enable = false;
|
||||
};
|
||||
|
||||
network = {
|
||||
firewall = {
|
||||
enable = true;
|
||||
};
|
||||
networkManager.enable = true;
|
||||
};
|
||||
|
||||
# Add username to groups "wheel" and "video" - more may be added here later
|
||||
users = {
|
||||
users = {
|
||||
${userName} = {
|
||||
extraGroups = [ "wheel" "network" ];
|
||||
openssh.authorizedKeys.keys = [
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFV9eSc9L+aJLoKoexq2f/jb5rpyZnhuGiyhS8YQAbaS wyatt@wyattjmiller.com"
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO4WKvKnnYpTbzZHFEslOKyfiiMqWxhW3AfX6E7ACmYU wyatt@wyattjmiller.com"
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
services.fail2ban = {
|
||||
enable = true;
|
||||
package = pkgs.fail2ban;
|
||||
maxretry = 5;
|
||||
bantime = "3h";
|
||||
bantime-increment = {
|
||||
enable = true;
|
||||
rndtime = "10m";
|
||||
};
|
||||
};
|
||||
|
||||
services.homestead = {
|
||||
enable = true;
|
||||
openFirewall = true;
|
||||
};
|
||||
services.minecraft-servers.eula = true;
|
||||
|
||||
system.stateVersion = "26.05";
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{ ... }: {
|
||||
imports = [
|
||||
./configuration.nix
|
||||
./hardware-configuration.nix
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
# 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 = [ "ahci" "xhci_pci" "virtio_pci" "virtio_scsi" "sr_mod" "virtio_blk" ];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [ "kvm-intel" ];
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
fileSystems."/" =
|
||||
{ device = "/dev/disk/by-uuid/ec4c43ec-efcc-40ea-a4c8-411e60ee7c4e";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
fileSystems."/boot" =
|
||||
{ device = "/dev/disk/by-uuid/140E-FE19";
|
||||
fsType = "vfat";
|
||||
options = [ "fmask=0022" "dmask=0022" ];
|
||||
};
|
||||
|
||||
swapDevices =
|
||||
[ { device = "/dev/disk/by-uuid/547bbd78-85be-4d17-a519-c4a2a923bdab"; }
|
||||
];
|
||||
|
||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
}
|
||||
Reference in new issue
Block a user