{ pkgs, lib, config, inputs, ... }: {
  options.mods.unfree.minecraft = {
    enable = lib.mkEnableOption {
      default = false;
      description = "enables minecraft";
    };
    packages = lib.mkOption {
      default = [
        "minecraft-server"
      ];
      description = "unfree packages";
    };
  };

  imports = [
    inputs.nix-minecraft.nixosModules.minecraft-servers
  ];

  config = lib.mkIf config.mods.unfree.minecraft.enable {
    nixpkgs.overlays = [
      inputs.nix-minecraft.overlay
    ];

    environment.systemPackages = with pkgs; 
      if config.mods.xorg.enable then
        [ prismlauncher ]
      else
        [];

    services.minecraft-servers = {
      enable = true;
      eula = true;
    };
  };
}
