some more minecraft server shenanigans, now with nix-minecraft

This commit is contained in:
jacekpoz 2024-07-28 01:14:06 +02:00
parent 519a2ea9f9
commit fcf020a8b8
Signed by: poz
SSH key fingerprint: SHA256:JyLeVWE4bF3tDnFeUpUaJsPsNlJyBldDGV/dIKSLyN8
3 changed files with 204 additions and 86 deletions

View file

@ -353,6 +353,22 @@
"type": "github" "type": "github"
} }
}, },
"flake-compat_10": {
"flake": false,
"locked": {
"lastModified": 1696426674,
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-compat_2": { "flake-compat_2": {
"flake": false, "flake": false,
"locked": { "locked": {
@ -417,21 +433,6 @@
} }
}, },
"flake-compat_6": { "flake-compat_6": {
"locked": {
"lastModified": 1717312683,
"narHash": "sha256-FrlieJH50AuvagamEvWMIE6D2OAnERuDboFDYAED/dE=",
"owner": "nix-community",
"repo": "flake-compat",
"rev": "38fd3954cf65ce6faf3d0d45cd26059e059f07ea",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "flake-compat",
"type": "github"
}
},
"flake-compat_7": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1673956053, "lastModified": 1673956053,
@ -447,14 +448,29 @@
"type": "github" "type": "github"
} }
}, },
"flake-compat_7": {
"locked": {
"lastModified": 1717312683,
"narHash": "sha256-FrlieJH50AuvagamEvWMIE6D2OAnERuDboFDYAED/dE=",
"owner": "nix-community",
"repo": "flake-compat",
"rev": "38fd3954cf65ce6faf3d0d45cd26059e059f07ea",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "flake-compat",
"type": "github"
}
},
"flake-compat_8": { "flake-compat_8": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1696426674, "lastModified": 1673956053,
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=",
"owner": "edolstra", "owner": "edolstra",
"repo": "flake-compat", "repo": "flake-compat",
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -716,11 +732,11 @@
"systems": "systems_10" "systems": "systems_10"
}, },
"locked": { "locked": {
"lastModified": 1710146030, "lastModified": 1681202837,
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", "narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=",
"owner": "numtide", "owner": "numtide",
"repo": "flake-utils", "repo": "flake-utils",
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", "rev": "cfacdce06f30d2b68473a46042957675eebb3401",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -748,6 +764,24 @@
} }
}, },
"flake-utils_7": { "flake-utils_7": {
"inputs": {
"systems": "systems_12"
},
"locked": {
"lastModified": 1710146030,
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_8": {
"locked": { "locked": {
"lastModified": 1659877975, "lastModified": 1659877975,
"narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=", "narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=",
@ -762,9 +796,9 @@
"type": "github" "type": "github"
} }
}, },
"flake-utils_8": { "flake-utils_9": {
"inputs": { "inputs": {
"systems": "systems_14" "systems": "systems_15"
}, },
"locked": { "locked": {
"lastModified": 1710146030, "lastModified": 1710146030,
@ -1363,7 +1397,7 @@
}, },
"lib-aggregate_2": { "lib-aggregate_2": {
"inputs": { "inputs": {
"flake-utils": "flake-utils_5", "flake-utils": "flake-utils_6",
"nixpkgs-lib": "nixpkgs-lib_2" "nixpkgs-lib": "nixpkgs-lib_2"
}, },
"locked": { "locked": {
@ -1543,7 +1577,7 @@
"inputs": { "inputs": {
"flake-parts": "flake-parts_5", "flake-parts": "flake-parts_5",
"nix-github-actions": "nix-github-actions", "nix-github-actions": "nix-github-actions",
"nixpkgs": "nixpkgs_10", "nixpkgs": "nixpkgs_11",
"treefmt-nix": "treefmt-nix" "treefmt-nix": "treefmt-nix"
}, },
"locked": { "locked": {
@ -1612,6 +1646,26 @@
"type": "github" "type": "github"
} }
}, },
"nix-minecraft": {
"inputs": {
"flake-compat": "flake-compat_6",
"flake-utils": "flake-utils_5",
"nixpkgs": "nixpkgs_9"
},
"locked": {
"lastModified": 1721870898,
"narHash": "sha256-K3U4emkszxLkPW9LOdkV49IB2hnMrGNcpVDbCclZ+as=",
"owner": "Infinidoge",
"repo": "nix-minecraft",
"rev": "7161fd4ca148b330c180714e40c7399afca3f97c",
"type": "github"
},
"original": {
"owner": "Infinidoge",
"repo": "nix-minecraft",
"type": "github"
}
},
"nixpak": { "nixpak": {
"inputs": { "inputs": {
"flake-parts": "flake-parts_4", "flake-parts": "flake-parts_4",
@ -1728,10 +1782,10 @@
}, },
"nixpkgs-wayland": { "nixpkgs-wayland": {
"inputs": { "inputs": {
"flake-compat": "flake-compat_6", "flake-compat": "flake-compat_7",
"lib-aggregate": "lib-aggregate_2", "lib-aggregate": "lib-aggregate_2",
"nix-eval-jobs": "nix-eval-jobs", "nix-eval-jobs": "nix-eval-jobs",
"nixpkgs": "nixpkgs_11" "nixpkgs": "nixpkgs_12"
}, },
"locked": { "locked": {
"lastModified": 1720471092, "lastModified": 1720471092,
@ -1748,6 +1802,22 @@
} }
}, },
"nixpkgs_10": { "nixpkgs_10": {
"locked": {
"lastModified": 1720768451,
"narHash": "sha256-EYekUHJE2gxeo2pM/zM9Wlqw1Uw2XTJXOSAO79ksc4Y=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "7e7c39ea35c5cdd002cd4588b03a3fb9ece6fad9",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_11": {
"locked": { "locked": {
"lastModified": 1719082008, "lastModified": 1719082008,
"narHash": "sha256-jHJSUH619zBQ6WdC21fFAlDxHErKVDJ5fpN0Hgx4sjs=", "narHash": "sha256-jHJSUH619zBQ6WdC21fFAlDxHErKVDJ5fpN0Hgx4sjs=",
@ -1763,7 +1833,7 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs_11": { "nixpkgs_12": {
"locked": { "locked": {
"lastModified": 1720418205, "lastModified": 1720418205,
"narHash": "sha256-cPJoFPXU44GlhWg4pUk9oUPqurPlCFZ11ZQPk21GTPU=", "narHash": "sha256-cPJoFPXU44GlhWg4pUk9oUPqurPlCFZ11ZQPk21GTPU=",
@ -1779,7 +1849,7 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs_12": { "nixpkgs_13": {
"locked": { "locked": {
"lastModified": 1656753965, "lastModified": 1656753965,
"narHash": "sha256-BCrB3l0qpJokOnIVc3g2lHiGhnjUi0MoXiw6t1o8H1E=", "narHash": "sha256-BCrB3l0qpJokOnIVc3g2lHiGhnjUi0MoXiw6t1o8H1E=",
@ -1795,7 +1865,7 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs_13": { "nixpkgs_14": {
"locked": { "locked": {
"lastModified": 1702350026, "lastModified": 1702350026,
"narHash": "sha256-A+GNZFZdfl4JdDphYKBJ5Ef1HOiFsP18vQe9mqjmUis=", "narHash": "sha256-A+GNZFZdfl4JdDphYKBJ5Ef1HOiFsP18vQe9mqjmUis=",
@ -1811,7 +1881,7 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs_14": { "nixpkgs_15": {
"locked": { "locked": {
"lastModified": 1682809678, "lastModified": 1682809678,
"narHash": "sha256-jqR8t82mWotOSgnWZvr6xXCO/tc3fCPTLMPvI7Jo5rA=", "narHash": "sha256-jqR8t82mWotOSgnWZvr6xXCO/tc3fCPTLMPvI7Jo5rA=",
@ -1827,7 +1897,7 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs_15": { "nixpkgs_16": {
"locked": { "locked": {
"lastModified": 1719506693, "lastModified": 1719506693,
"narHash": "sha256-C8e9S7RzshSdHB7L+v9I51af1gDM5unhJ2xO1ywxNH8=", "narHash": "sha256-C8e9S7RzshSdHB7L+v9I51af1gDM5unhJ2xO1ywxNH8=",
@ -1957,15 +2027,15 @@
}, },
"nixpkgs_9": { "nixpkgs_9": {
"locked": { "locked": {
"lastModified": 1720768451, "lastModified": 1715266358,
"narHash": "sha256-EYekUHJE2gxeo2pM/zM9Wlqw1Uw2XTJXOSAO79ksc4Y=", "narHash": "sha256-doPgfj+7FFe9rfzWo1siAV2mVCasW+Bh8I1cToAXEE4=",
"owner": "NixOS", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "7e7c39ea35c5cdd002cd4588b03a3fb9ece6fad9", "rev": "f1010e0469db743d14519a1efd37e23f8513d714",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "NixOS", "owner": "nixos",
"ref": "nixos-unstable", "ref": "nixos-unstable",
"repo": "nixpkgs", "repo": "nixpkgs",
"type": "github" "type": "github"
@ -2026,7 +2096,7 @@
"nvf": { "nvf": {
"inputs": { "inputs": {
"flake-parts": "flake-parts_6", "flake-parts": "flake-parts_6",
"flake-utils": "flake-utils_6", "flake-utils": "flake-utils_7",
"mnw": "mnw", "mnw": "mnw",
"nil": "nil", "nil": "nil",
"nixpkgs": [ "nixpkgs": [
@ -2133,7 +2203,7 @@
"plugin-vim-vsnip": "plugin-vim-vsnip", "plugin-vim-vsnip": "plugin-vim-vsnip",
"plugin-which-key": "plugin-which-key", "plugin-which-key": "plugin-which-key",
"rnix-lsp": "rnix-lsp", "rnix-lsp": "rnix-lsp",
"systems": "systems_12", "systems": "systems_13",
"zig": "zig" "zig": "zig"
}, },
"locked": { "locked": {
@ -3779,7 +3849,7 @@
"rnix-lsp": { "rnix-lsp": {
"inputs": { "inputs": {
"naersk": "naersk", "naersk": "naersk",
"nixpkgs": "nixpkgs_12", "nixpkgs": "nixpkgs_13",
"utils": "utils" "utils": "utils"
}, },
"locked": { "locked": {
@ -3813,8 +3883,9 @@
"iio-hyprland": "iio-hyprland", "iio-hyprland": "iio-hyprland",
"neovim-nightly-overlay": "neovim-nightly-overlay", "neovim-nightly-overlay": "neovim-nightly-overlay",
"nh": "nh", "nh": "nh",
"nix-minecraft": "nix-minecraft",
"nixpak": "nixpak", "nixpak": "nixpak",
"nixpkgs": "nixpkgs_9", "nixpkgs": "nixpkgs_10",
"nixpkgs-wayland": "nixpkgs-wayland", "nixpkgs-wayland": "nixpkgs-wayland",
"nur": "nur", "nur": "nur",
"nvf": "nvf", "nvf": "nvf",
@ -3915,7 +3986,7 @@
}, },
"schizofox": { "schizofox": {
"inputs": { "inputs": {
"flake-compat": "flake-compat_8", "flake-compat": "flake-compat_9",
"flake-parts": "flake-parts_7", "flake-parts": "flake-parts_7",
"home-manager": "home-manager_3", "home-manager": "home-manager_3",
"nixpak": [ "nixpak": [
@ -3925,7 +3996,7 @@
"nixpkgs" "nixpkgs"
], ],
"searx-randomizer": "searx-randomizer", "searx-randomizer": "searx-randomizer",
"systems": "systems_13" "systems": "systems_14"
}, },
"locked": { "locked": {
"lastModified": 1719058240, "lastModified": 1719058240,
@ -3967,7 +4038,7 @@
"shadower": { "shadower": {
"inputs": { "inputs": {
"naersk": "naersk_2", "naersk": "naersk_2",
"nixpkgs": "nixpkgs_14" "nixpkgs": "nixpkgs_15"
}, },
"locked": { "locked": {
"lastModified": 1721405001, "lastModified": 1721405001,
@ -4065,6 +4136,21 @@
} }
}, },
"systems_13": { "systems_13": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"systems_14": {
"locked": { "locked": {
"lastModified": 1689347949, "lastModified": 1689347949,
"narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=",
@ -4079,7 +4165,7 @@
"type": "github" "type": "github"
} }
}, },
"systems_14": { "systems_15": {
"locked": { "locked": {
"lastModified": 1681028828, "lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
@ -4253,8 +4339,8 @@
}, },
"waybar": { "waybar": {
"inputs": { "inputs": {
"flake-compat": "flake-compat_9", "flake-compat": "flake-compat_10",
"nixpkgs": "nixpkgs_15" "nixpkgs": "nixpkgs_16"
}, },
"locked": { "locked": {
"lastModified": 1720552096, "lastModified": 1720552096,
@ -4273,7 +4359,7 @@
"woomer": { "woomer": {
"inputs": { "inputs": {
"crane": "crane_5", "crane": "crane_5",
"flake-utils": "flake-utils_8", "flake-utils": "flake-utils_9",
"nixpkgs": [ "nixpkgs": [
"nixpkgs" "nixpkgs"
] ]
@ -4324,9 +4410,9 @@
}, },
"zig": { "zig": {
"inputs": { "inputs": {
"flake-compat": "flake-compat_7", "flake-compat": "flake-compat_8",
"flake-utils": "flake-utils_7", "flake-utils": "flake-utils_8",
"nixpkgs": "nixpkgs_13" "nixpkgs": "nixpkgs_14"
}, },
"locked": { "locked": {
"lastModified": 1716725305, "lastModified": 1716725305,

View file

@ -118,5 +118,7 @@
url = "git+ssh://jacekpoz/jacekpoz/pozsite.git"; url = "git+ssh://jacekpoz/jacekpoz/pozsite.git";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
nix-minecraft.url = "github:Infinidoge/nix-minecraft";
}; };
} }

View file

@ -1,44 +1,74 @@
{ {
config,
inputs,
pkgs, pkgs,
... ...
}: { }: let
services.minecraft-server = { inherit (config.myOptions.other.system) username;
in {
imports = [ inputs.nix-minecraft.nixosModules.minecraft-servers ];
nixpkgs.overlays = [ inputs.nix-minecraft.overlay ];
users.users.${username} = {
extraGroups = [ "minecraft" ];
};
services.minecraft-servers = {
enable = true; enable = true;
package = pkgs.purpur.overrideAttrs {
src = pkgs.fetchurl {
url = "https://api.purpurmc.org/v2/purpur/1.20.6/2233/download";
hash = "sha256-fVQQqXg2Ckb6p2ooix6rNTE12NsW5AMpoVRALsGxLZE=";
};
};
eula = true; eula = true;
declarative = true; dataDir = "/var/lib/minecraft";
jvmOpts = "";
serverProperties = { servers.celestynow = {
server-ip = "127.0.0.1"; enable = true;
server-port = 2137; autoStart = true;
difficulty = 3; openFirewall = true;
gamemode = 0; enableReload = true;
enable-command-block = true;
hide-online-players = true; serverProperties = {
level-name = "swiat"; server-ip = "127.0.0.1";
max-players = 4; server-port = 25565;
online-mode = true; difficulty = 3;
snooper-enabled = false; gamemode = 0;
spawn-protection = 0; enable-command-block = true;
view-distance = 12; hide-online-players = true;
white-list = true; level-name = "swiat";
enforce-whitelist = true; motd = "dupa";
}; max-players = 4;
whitelist = { online-mode = false;
jacekpoz = "8cc45dd9-0145-4068-be30-038a3844ebd0"; snooper-enabled = false;
emo_mruczek = "e62cfed1-4758-488e-ac91-b623a87e0ac9"; spawn-protection = 0;
view-distance = 12;
# white-list = true;
# enforce-whitelist = true;
};
# whitelist = {
# jacekpoz = "8cc45dd9-0145-4068-be30-038a3844ebd0";
# emo_mruczek = "e62cfed1-4758-488e-ac91-b623a87e0ac9";
# };
package = pkgs.vanillaServers.vanilla-1_21;
jvmOpts = "-Xms6144M -Xmx8192M";
# symlinks = {
# mods = pkgs.linkFarmFromDrvs "mods" (builtins.attrValues {
# Create-Fabric = pkgs.fetchurl {
# url = "https://cdn.modrinth.com/data/Xbc0uyRg/versions/h2HgGyvA/create-fabric-0.5.1-f-build.1417%2Bmc1.20.1.jar";
# sha512 = "bc8e3afc219ecf9d475f4b56f421024f76fc20bce941a2c956ecca1e8905b39d946a124aca48cb391a0a60314d68fd5413c8c12d0ad1f605159b10611595878f";
# };
# Fabric-Api = pkgs.fetchurl {
# url = "https://cdn.modrinth.com/data/P7dR8mSH/versions/YG53rBmj/fabric-api-0.92.0%2B1.20.1.jar";
# sha512 = "53ce4cb2bb5579cef37154c928837731f3ae0a3821dd2fb4c4401d22d411f8605855e8854a03e65ea4f949dfa0e500ac1661a2e69219883770c6099b0b28e4fa";
# };
# });
# };
}; };
}; };
services.caddy = { # services.caddy = {
enable = true; # enable = true;
virtualHosts."mc.jacekpoz.pl".extraConfig = '' # virtualHosts."mc.jacekpoz.pl:2137".extraConfig = ''
reverse_proxy * localhost:2137 # reverse_proxy * localhost:25565
''; # '';
}; # };
networking.firewall.allowedTCPPorts = [ 25565 ];
} }