feat: got minecraft servers sorted

This commit is contained in:
Nick 2025-11-27 01:17:38 -06:00
parent 4c3ab7728c
commit 1f43844e90
8 changed files with 20 additions and 21 deletions

View file

@ -8,7 +8,6 @@ let
label = "Minecraft"; label = "Minecraft";
name = "minecraft"; name = "minecraft";
world = "world0"; world = "world0";
secrets = "${secretPath}/${name}";
in in
{ {
label = label; label = label;
@ -29,9 +28,9 @@ in
path0 = "${varPath}/${name}"; path0 = "${varPath}/${name}";
}; };
mntPaths = { mntPaths = {
path0 = "${mntPath}/${name}-${world}"; path0 = "${mntPath}/${name}/${world}";
}; };
secretPaths = { secretPaths = {
path0 = secrets; path0 = "${secretPath}/${name}";
}; };
} }

View file

@ -8,7 +8,6 @@ let
label = "Minecraft"; label = "Minecraft";
name = "minecraft"; name = "minecraft";
world = "world1"; world = "world1";
secrets = "${secretPath}/${name}";
in in
{ {
label = label; label = label;
@ -29,9 +28,9 @@ in
path0 = "${varPath}/${name}"; path0 = "${varPath}/${name}";
}; };
mntPaths = { mntPaths = {
path0 = "${mntPath}/${name}-${world}"; path0 = "${mntPath}/${name}/${world}";
}; };
secretPaths = { secretPaths = {
path0 = secrets; path0 = "${secretPath}/${name}";
}; };
} }

View file

@ -7,5 +7,12 @@ let
map (name: ./. + "/${name}") dirContent; map (name: ./. + "/${name}") dirContent;
in in
{ {
systemd = {
tmpfiles.rules = [
"d /mnt/storage/minecraft 0751 microvm wheel - -"
];
};
imports = importList; imports = importList;
} }

View file

@ -154,15 +154,15 @@ in
tag = "read_only_nix_store"; tag = "read_only_nix_store";
} }
{ {
mountPoint = "/var/lib/${serviceCfg.name}"; mountPoint = serviceCfg.varPaths.path0;
proto = "virtiofs"; proto = "virtiofs";
source = serviceCfg.mntPaths.path0; source = serviceCfg.mntPaths.path0;
tag = "${serviceCfg.name}_data"; tag = "${serviceCfg.name}-${world}_data";
} }
{ {
mountPoint = "/run/secrets"; mountPoint = "/run/secrets";
proto = "virtiofs"; proto = "virtiofs";
source = "/run/secrets/${serviceCfg.name}"; source = serviceCfg.secretPaths.path0;
tag = "host_secrets"; tag = "host_secrets";
} }
]; ];

View file

@ -152,15 +152,15 @@ in
tag = "read_only_nix_store"; tag = "read_only_nix_store";
} }
{ {
mountPoint = "/var/lib/${serviceCfg.name}"; mountPoint = serviceCfg.varPaths.path0;
proto = "virtiofs"; proto = "virtiofs";
source = serviceCfg.mntPaths.path0; source = serviceCfg.mntPaths.path0;
tag = "${serviceCfg.name}_data"; tag = "${serviceCfg.name}-${world}_data";
} }
{ {
mountPoint = "/run/secrets"; mountPoint = "/run/secrets";
proto = "virtiofs"; proto = "virtiofs";
source = "/run/secrets/${serviceCfg.name}"; source = serviceCfg.secretPaths.path0;
tag = "host_secrets"; tag = "host_secrets";
} }
]; ];

View file

@ -77,6 +77,9 @@ in
MaxConnectionsPerTorrent = -1; MaxConnectionsPerTorrent = -1;
MaxUploads = -1; MaxUploads = -1;
MaxUploadsPerTorrent = -1; MaxUploadsPerTorrent = -1;
MaxActiveDownloads = -1;
MaxActiveUploads = -1;
MaxActiveTorrents = -1;
}; };
}; };

View file

@ -77,7 +77,4 @@ in
dnsProvider = instances.web.dns.provider0; dnsProvider = instances.web.dns.provider0;
environmentFile = config.sops.secrets."dns/${instances.web.dns.provider0}".path; environmentFile = config.sops.secrets."dns/${instances.web.dns.provider0}".path;
}; };
systemd.tmpfiles.rules = [
"d ${serviceCfg.mntPaths.path0} 0755 microvm wheel - -"
];
} }

View file

@ -106,12 +106,6 @@ in
}; };
}; };
systemd = {
tmpfiles.rules = [
"d ${serviceCfg.mntPaths.path0} 0751 microvm wheel - -"
];
};
sops.secrets = { sops.secrets = {
"${serviceCfg.name}/env" = { "${serviceCfg.name}/env" = {
owner = "root"; owner = "root";