release: yet another Nix Minecraft Module
This commit is contained in:
parent
9fdb947c2a
commit
839bb7de43
13 changed files with 1621 additions and 1 deletions
58
example/small/configuration.nix
Normal file
58
example/small/configuration.nix
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
imports = [
|
||||
|
||||
# ... your imports
|
||||
inputs.nyx-minecraft.nixosModules.minecraft-servers
|
||||
];
|
||||
|
||||
nyx-minecraft.service = {
|
||||
enable = true;
|
||||
eula = true;
|
||||
# user # don't change this
|
||||
# group # don't change this
|
||||
dataDir = "srv/minecraft";
|
||||
|
||||
servers = {
|
||||
testingServer = {
|
||||
enable = true;
|
||||
|
||||
memory = {
|
||||
min = "2G";
|
||||
max = "4G";
|
||||
};
|
||||
|
||||
package = pkgs.minecraftServers.vanilla-1_20_4;
|
||||
|
||||
# leaving whitelis out just deactivates whitelist
|
||||
# leaving Operators out will just not set any operator
|
||||
|
||||
# Leaving out a property will just set the default
|
||||
properties = {
|
||||
serverPort = 25565;
|
||||
# note you don't need to set query or rcon port
|
||||
# since they will be set 200 and 100 above the Serverport
|
||||
};
|
||||
# you can leave them out than but here a simple example
|
||||
schedules = {
|
||||
# Hourly world-only, pure rsync, no restart
|
||||
greeting-hourly = {
|
||||
enable = true;
|
||||
# note schedule can be enabled without the server being enabled
|
||||
timer = "hourly";
|
||||
code = ''
|
||||
minecraft-testingServer-say "yellow" "hello"
|
||||
# now once an hour it will greet everyone in the server
|
||||
'';
|
||||
};
|
||||
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
34
example/small/flake.nix
Normal file
34
example/small/flake.nix
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
{
|
||||
description = "EXAMPLE - Flake";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
|
||||
# your own imports
|
||||
nyx-minecraft.url = "github:Peritia-System/Nyx-Minecraft";
|
||||
nyx-minecraft.inputs.nixpkgs.follows = "nixpkgs";
|
||||
|
||||
};
|
||||
|
||||
outputs = inputs @ {
|
||||
self,
|
||||
nixpkgs,
|
||||
nix-minecraft,
|
||||
...
|
||||
}: {
|
||||
nixosConfigurations = {
|
||||
yourSystem = nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
|
||||
specialArgs = {
|
||||
inherit inputs self;
|
||||
host = "yourSystem";
|
||||
};
|
||||
|
||||
modules = [
|
||||
nixos95.nixosModules.default
|
||||
|
||||
./configuration.nix
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue