add minecraft
This commit is contained in:
parent
6fcb438f67
commit
6291633247
4 changed files with 231 additions and 4 deletions
2
cos.nix
2
cos.nix
|
|
@ -9,7 +9,9 @@
|
||||||
./gnupg.nix
|
./gnupg.nix
|
||||||
./bikeability.nix
|
./bikeability.nix
|
||||||
./emacs.nix
|
./emacs.nix
|
||||||
|
./minecraft/minecraft-servers.nix
|
||||||
"${inputs.home-manager}/nixos"
|
"${inputs.home-manager}/nixos"
|
||||||
|
inputs.nix-minecraft.nixosModules.minecraft-servers
|
||||||
];
|
];
|
||||||
|
|
||||||
options.cos = {
|
options.cos = {
|
||||||
|
|
|
||||||
151
flake.lock
generated
151
flake.lock
generated
|
|
@ -21,6 +21,22 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"flake-compat": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1747046372,
|
||||||
|
"narHash": "sha256-CIVLLkVgvHYbgI2UpXvIIBJ12HWgX+fjA8Xf8PUmqCY=",
|
||||||
|
"owner": "edolstra",
|
||||||
|
"repo": "flake-compat",
|
||||||
|
"rev": "9100a0f413b0c601e0533d1d94ffd501ce2e7885",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "edolstra",
|
||||||
|
"repo": "flake-compat",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"flake-parts": {
|
"flake-parts": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs-lib": [
|
"nixpkgs-lib": [
|
||||||
|
|
@ -79,6 +95,24 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"flake-utils_3": {
|
||||||
|
"inputs": {
|
||||||
|
"systems": "systems_4"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1731533236,
|
||||||
|
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"home-manager": {
|
"home-manager": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
|
|
@ -129,6 +163,25 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"languini": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": "nixpkgs",
|
||||||
|
"rust-overlay": "rust-overlay"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1767569345,
|
||||||
|
"narHash": "sha256-ixEb89DxtqHDFlMZ/35UVd/1fqgPbhQmMor0MKepzk0=",
|
||||||
|
"ref": "refs/heads/master",
|
||||||
|
"rev": "614b49910876415d29a86eceb09831bb15c12246",
|
||||||
|
"revCount": 81,
|
||||||
|
"type": "git",
|
||||||
|
"url": "ssh://forgejo@10.100.0.1/TutorEngine/leptos_client.git"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "ssh://forgejo@10.100.0.1/TutorEngine/leptos_client.git"
|
||||||
|
}
|
||||||
|
},
|
||||||
"mapnix": {
|
"mapnix": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"oldNixpkgs": "oldNixpkgs"
|
"oldNixpkgs": "oldNixpkgs"
|
||||||
|
|
@ -147,7 +200,59 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"nix-minecraft": {
|
||||||
|
"inputs": {
|
||||||
|
"flake-compat": "flake-compat",
|
||||||
|
"flake-utils": "flake-utils_2",
|
||||||
|
"nixpkgs": "nixpkgs_2"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1766628630,
|
||||||
|
"narHash": "sha256-ULKQFi7/TohrfOsLP/ESfwvd1DjAuwwshLkgj5lqijM=",
|
||||||
|
"owner": "Infinidoge",
|
||||||
|
"repo": "nix-minecraft",
|
||||||
|
"rev": "649604ce765f36edee9abbb44f65d88575811c41",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "Infinidoge",
|
||||||
|
"repo": "nix-minecraft",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1763464769,
|
||||||
|
"narHash": "sha256-AJHrsT7VoeQzErpBRlLJM1SODcaayp0joAoEA35yiwM=",
|
||||||
|
"owner": "nixos",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "6f374686605df381de8541c072038472a5ea2e2d",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nixos",
|
||||||
|
"ref": "nixpkgs-unstable",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nixpkgs_2": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1748929857,
|
||||||
|
"narHash": "sha256-lcZQ8RhsmhsK8u7LIFsJhsLh/pzR9yZ8yqpTzyGdj+Q=",
|
||||||
|
"owner": "nixos",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "c2a03962b8e24e669fb37b7df10e7c79531ff1a4",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nixos",
|
||||||
|
"ref": "nixos-unstable",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nixpkgs_3": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1764950072,
|
"lastModified": 1764950072,
|
||||||
"narHash": "sha256-BmPWzogsG2GsXZtlT+MTcAWeDK5hkbGRZTeZNW42fwA=",
|
"narHash": "sha256-BmPWzogsG2GsXZtlT+MTcAWeDK5hkbGRZTeZNW42fwA=",
|
||||||
|
|
@ -163,7 +268,7 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs_2": {
|
"nixpkgs_4": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1742422364,
|
"lastModified": 1742422364,
|
||||||
"narHash": "sha256-mNqIplmEohk5jRkqYqG19GA8MbQ/D4gQSK0Mu4LvfRQ=",
|
"narHash": "sha256-mNqIplmEohk5jRkqYqG19GA8MbQ/D4gQSK0Mu4LvfRQ=",
|
||||||
|
|
@ -261,8 +366,8 @@
|
||||||
},
|
},
|
||||||
"penn-nix": {
|
"penn-nix": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-utils": "flake-utils_2",
|
"flake-utils": "flake-utils_3",
|
||||||
"nixpkgs": "nixpkgs_2"
|
"nixpkgs": "nixpkgs_4"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1742609439,
|
"lastModified": 1742609439,
|
||||||
|
|
@ -282,12 +387,35 @@
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"cnvim": "cnvim",
|
"cnvim": "cnvim",
|
||||||
"home-manager": "home-manager",
|
"home-manager": "home-manager",
|
||||||
|
"languini": "languini",
|
||||||
"mapnix": "mapnix",
|
"mapnix": "mapnix",
|
||||||
"nixpkgs": "nixpkgs",
|
"nix-minecraft": "nix-minecraft",
|
||||||
|
"nixpkgs": "nixpkgs_3",
|
||||||
"osm-bikeability": "osm-bikeability",
|
"osm-bikeability": "osm-bikeability",
|
||||||
"penn-nix": "penn-nix"
|
"penn-nix": "penn-nix"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"rust-overlay": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"languini",
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1763606317,
|
||||||
|
"narHash": "sha256-lsq4Urmb9Iyg2zyg2yG6oMQk9yuaoIgy+jgvYM4guxA=",
|
||||||
|
"owner": "oxalica",
|
||||||
|
"repo": "rust-overlay",
|
||||||
|
"rev": "a5615abaf30cfaef2e32f1ff9bd5ca94e2911371",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "oxalica",
|
||||||
|
"repo": "rust-overlay",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"systems": {
|
"systems": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1681028828,
|
"lastModified": 1681028828,
|
||||||
|
|
@ -332,6 +460,21 @@
|
||||||
"repo": "default",
|
"repo": "default",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"systems_4": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1681028828,
|
||||||
|
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"root": "root",
|
"root": "root",
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,10 @@
|
||||||
url = "github:clay53/osm-bikeability";
|
url = "github:clay53/osm-bikeability";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
languini = {
|
||||||
|
url = "git+ssh://forgejo@10.100.0.1/TutorEngine/leptos_client.git";
|
||||||
|
};
|
||||||
|
nix-minecraft.url = "github:Infinidoge/nix-minecraft";
|
||||||
};
|
};
|
||||||
outputs = { self, nixpkgs, ... }@inputs: {
|
outputs = { self, nixpkgs, ... }@inputs: {
|
||||||
nixosConfigurations.clhickey-nixos = nixpkgs.lib.nixosSystem {
|
nixosConfigurations.clhickey-nixos = nixpkgs.lib.nixosSystem {
|
||||||
|
|
@ -29,6 +33,7 @@
|
||||||
specialArgs = { inherit inputs; };
|
specialArgs = { inherit inputs; };
|
||||||
modules = [
|
modules = [
|
||||||
./nixnas/nixnas.nix
|
./nixnas/nixnas.nix
|
||||||
|
inputs.languini.nixosModules.default
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
77
minecraft/minecraft-servers.nix
Normal file
77
minecraft/minecraft-servers.nix
Normal file
|
|
@ -0,0 +1,77 @@
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
let
|
||||||
|
survivalPort = 25565;
|
||||||
|
creativePort = 25566;
|
||||||
|
users = {
|
||||||
|
clay53_clayton = "bc2653cd-6cb1-4d15-9d24-cce0d1e8811c";
|
||||||
|
fire_chase = "c2b1a7ff-abff-41cb-af2a-4a89e942d288";
|
||||||
|
piggywhipster = "6b4419bf-2a5f-4932-b779-33dcdbbf4c06";
|
||||||
|
};
|
||||||
|
defaultWhitelist = {
|
||||||
|
inherit (users)
|
||||||
|
clay53_clayton
|
||||||
|
fire_chase
|
||||||
|
piggywhipster
|
||||||
|
;
|
||||||
|
};
|
||||||
|
defaultOperators = {
|
||||||
|
inherit (users)
|
||||||
|
clay53_clayton
|
||||||
|
fire_chase;
|
||||||
|
};
|
||||||
|
minRam = "512M";
|
||||||
|
maxRam = "1G";
|
||||||
|
in
|
||||||
|
{
|
||||||
|
config = lib.mkMerge [
|
||||||
|
(lib.mkIf (config.networking.hostName == "nixnas") {
|
||||||
|
services.minecraft-servers = {
|
||||||
|
enable = true;
|
||||||
|
eula = true;
|
||||||
|
openFirewall = false;
|
||||||
|
dataDir = "/Block/minecraft-servers";
|
||||||
|
};
|
||||||
|
|
||||||
|
services.minecraft-servers.servers.survival = {
|
||||||
|
enable = true;
|
||||||
|
autoStart = true;
|
||||||
|
restart = "always";
|
||||||
|
enableReload = false;
|
||||||
|
whitelist = defaultWhitelist;
|
||||||
|
operators = defaultOperators;
|
||||||
|
serverProperties = {
|
||||||
|
server-port = survivalPort;
|
||||||
|
difficulty = 3;
|
||||||
|
gamemode = 0;
|
||||||
|
motd = "Clayton Hickey's Survival";
|
||||||
|
white-list = true;
|
||||||
|
};
|
||||||
|
package = pkgs.minecraftServers.vanilla-1_21_11;
|
||||||
|
jvmOpts = "-Xms${minRam} -Xmx${maxRam}";
|
||||||
|
};
|
||||||
|
|
||||||
|
services.minecraft-servers.servers.creative = {
|
||||||
|
enable = true;
|
||||||
|
autoStart = true;
|
||||||
|
restart = "always";
|
||||||
|
enableReload = false;
|
||||||
|
whitelist = defaultWhitelist;
|
||||||
|
operators = defaultOperators;
|
||||||
|
serverProperties = {
|
||||||
|
server-port = creativePort;
|
||||||
|
difficulty = 3;
|
||||||
|
gamemode = 1;
|
||||||
|
motd = "Clayton Hickey's Creative";
|
||||||
|
white-list = true;
|
||||||
|
};
|
||||||
|
package = pkgs.minecraftServers.vanilla-1_21_11;
|
||||||
|
jvmOpts = "-Xms${minRam} -Xmx${maxRam}";
|
||||||
|
};
|
||||||
|
|
||||||
|
networking.firewall.interfaces.${config.cos.wireguard.interface}.allowedTCPPorts = [
|
||||||
|
survivalPort
|
||||||
|
creativePort
|
||||||
|
];
|
||||||
|
})
|
||||||
|
];
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue