mirror of
https://github.com/harryssecret/homelab-nix.git
synced 2025-08-08 06:30:18 +02:00
refactored file
This commit is contained in:
parent
d3361be972
commit
8785aabac6
4 changed files with 43 additions and 17 deletions
43
features/containers/crafty-controller.nix
Normal file
43
features/containers/crafty-controller.nix
Normal file
|
@ -0,0 +1,43 @@
|
|||
{ config, lib, ... }:
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.docker;
|
||||
in
|
||||
{
|
||||
options = {
|
||||
docker.minecraft.path = mkOption {
|
||||
type = types.str;
|
||||
default = "/srv/Minecraft";
|
||||
};
|
||||
};
|
||||
config = {
|
||||
|
||||
# docker containers, for apps that aren't avaiable on Nix. (yet)
|
||||
virtualisation.oci-containers = {
|
||||
backend = "docker";
|
||||
containers = {
|
||||
#TODO: move to Nix crafty controller bundle
|
||||
crafty-controller = {
|
||||
image = "registry.gitlab.com/crafty-controller/crafty-4:latest";
|
||||
ports = [
|
||||
"8443:8443"
|
||||
"8123:8123"
|
||||
"19132:19132/udp"
|
||||
"25500-25600:25500-25600"
|
||||
];
|
||||
volumes = [
|
||||
"${cfg.minecraft.path}/docker/backups:/crafty/backups"
|
||||
"${cfg.minecraft.path}/docker/logs:/crafty/logs"
|
||||
"${cfg.minecraft.path}/docker/servers:/crafty/servers"
|
||||
"${cfg.minecraft.path}/docker/config:/crafty/app/config"
|
||||
"${cfg.minecraft.path}/docker/import:/crafty/import"
|
||||
];
|
||||
environment = {
|
||||
"TZ" = "Europe/Paris";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue