diff options
| -rw-r--r-- | configuration.nix | 8 | ||||
| -rw-r--r-- | modules/minecraft-server.nix | 27 |
2 files changed, 33 insertions, 2 deletions
diff --git a/configuration.nix b/configuration.nix index fd96328..361aff7 100644 --- a/configuration.nix +++ b/configuration.nix @@ -4,6 +4,7 @@ imports = [ # Include the results of the hardware scan. ./hardware-configuration.nix + ./modules/minecraft-server.nix ]; boot.loader.grub.enable = true; @@ -15,13 +16,16 @@ users.users.admin = { isNormalUser = true; - extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user. + extraGroups = [ "wheel" ]; openssh.authorizedKeys.keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJZxiAIsF13XqqxG0QzGFhT3iLDMsu2snb0wJOPUUq8e chris@deskpin" ]; }; environment.systemPackages = with pkgs; [ - neovim git + git + neovim openssh + htop + lazygit ]; services.openssh.enable = true; diff --git a/modules/minecraft-server.nix b/modules/minecraft-server.nix new file mode 100644 index 0000000..08c47b4 --- /dev/null +++ b/modules/minecraft-server.nix @@ -0,0 +1,27 @@ +{ config, libs, pkgs, ... }: +let + unstable = import <nixos-unstable> {}; +in +{ + + services.minecraft-server = { + package = unstable.papermc; + enable = true; + eula = true; + openFirewall = true; + + declarative = true; + whitelist = { + Elenal = "65bad3ad-e8af-43b2-8d77-5cd6bcc56c43"; + Karuzo03 = "88ec7147-1bf5-455d-b6b5-c5771796caef"; + }; + serverProperties = { + max-players = 2; + motd = "<3"; + white-list = true; + }; + + dataDir = "/var/lib/minecraft"; + }; + +} |