feat: adding the minecraft server configuration
This commit is contained in:
parent
f4628c0b47
commit
f19eca3df6
7 changed files with 116 additions and 3 deletions
|
|
@ -7,10 +7,11 @@
|
|||
url = "github:nix-community/home-manager";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
minecraft.url = "github:Infinidoge/nix-minecraft";
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, flake-utils, home-manager,... }@inputs:
|
||||
outputs = { self, nixpkgs, flake-utils, ... }@inputs:
|
||||
let
|
||||
pkgs = import nixpkgs {
|
||||
config.allowUnfree = true;
|
||||
|
|
@ -21,6 +22,9 @@
|
|||
modules = [
|
||||
./hosts/fix/configuration.nix
|
||||
];
|
||||
specialArgs = {
|
||||
inherit inputs;
|
||||
};
|
||||
};
|
||||
nixosConfigurations."nixos-asahi" = nixpkgs.lib.nixosSystem {
|
||||
system = "aarch64-linux";
|
||||
|
|
|
|||
|
|
@ -1,13 +1,21 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
{ inputs, config, pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
../global.nix
|
||||
./hardware-configuration.nix
|
||||
../../modules/games/global.nix
|
||||
../../services/discord.nix
|
||||
../../services/games.nix
|
||||
];
|
||||
|
||||
games = {
|
||||
lutris = true;
|
||||
};
|
||||
service = {
|
||||
minecraft = {
|
||||
enium-pv = true;
|
||||
};
|
||||
bot_discord = {
|
||||
master = true;
|
||||
music = true;
|
||||
|
|
@ -24,6 +32,13 @@
|
|||
efi.canTouchEfiVariables = true;
|
||||
};
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
wine-staging
|
||||
lutris
|
||||
dxvk
|
||||
vkd3d
|
||||
];
|
||||
|
||||
networking = {
|
||||
hostName = "nixos-fix";
|
||||
firewall.enable = false;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
{ config, pkgs, ... }:
|
||||
{ config, pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
documentation = {
|
||||
|
|
|
|||
21
modules/games/global.nix
Normal file
21
modules/games/global.nix
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
|
||||
let
|
||||
lutris = import ./lutris.nix {
|
||||
inherit config pkgs lib;
|
||||
};
|
||||
cfg = config.games;
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
lutris
|
||||
];
|
||||
|
||||
options.games = {
|
||||
lutris = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
description = "Enable lutris";
|
||||
};
|
||||
};
|
||||
}
|
||||
15
modules/games/lutris.nix
Normal file
15
modules/games/lutris.nix
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
|
||||
let
|
||||
cfg = config.games.lutris;
|
||||
in
|
||||
{
|
||||
config = lib.mkIf cfg {
|
||||
environment.systemPackages = with pkgs; [
|
||||
wine-staging
|
||||
lutris
|
||||
dxvk
|
||||
vkd3d
|
||||
];
|
||||
};
|
||||
}
|
||||
21
services/games.nix
Normal file
21
services/games.nix
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
{ inputs, config, pkgs, lib, ... }:
|
||||
|
||||
let
|
||||
enium-pv = import ./games/minecraft.nix {
|
||||
inherit inputs config pkgs lib;
|
||||
};
|
||||
cfg = config.service.minecraft;
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
enium-pv
|
||||
];
|
||||
|
||||
options.service.minecraft = {
|
||||
enium-pv = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
description = "Enable enium private minecraft server";
|
||||
};
|
||||
};
|
||||
}
|
||||
37
services/games/minecraft.nix
Normal file
37
services/games/minecraft.nix
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
{ inputs, config, pkgs, lib, ... }:
|
||||
|
||||
let
|
||||
cfg = config.service.minecraft.enium-pv;
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
inputs.minecraft.nixosModules.minecraft-servers
|
||||
];
|
||||
|
||||
|
||||
config = lib.mkIf cfg {
|
||||
nixpkgs.overlays = [
|
||||
inputs.minecraft.overlay
|
||||
];
|
||||
services.minecraft-servers = {
|
||||
enable = true;
|
||||
eula = true;
|
||||
|
||||
servers.enium-pv = {
|
||||
enable = true;
|
||||
package = pkgs.fabricServers.fabric-1_20_1;
|
||||
jvmOpts = "-Xms4092M -Xmx4092M";
|
||||
serverProperties = {
|
||||
difficulty = 3;
|
||||
gamemode = 0;
|
||||
max-players = 42;
|
||||
motd = "§l §3 Enium Survival§r\n§l §b Whitelisted Server";
|
||||
server-port = 64421;
|
||||
spawn-protection=16;
|
||||
white-list = true;
|
||||
};
|
||||
restart = "no";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue