From e9964e864b50e36bdc7b30064f9c930bddde21fc Mon Sep 17 00:00:00 2001 From: Gabriel Fontes Date: Thu, 26 Dec 2024 16:45:47 -0300 Subject: [PATCH] add allowedSymlinks option --- modules/minecraft-servers.nix | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/modules/minecraft-servers.nix b/modules/minecraft-servers.nix index 7ea3c6dd..87e78ebe 100644 --- a/modules/minecraft-servers.nix +++ b/modules/minecraft-servers.nix @@ -457,6 +457,24 @@ in ''; }; + allowedSymlinks = { + default = ["/nix/store"]; + type = with types; listOf str; + example = literalExpression '' + [ + "/mnt/worlds" + ] + ''; + description = '' + Minecraft 1.20+ disallows symlinks inside world directories, unless + its destinations are allow-listed. /nix/store is allowed by default, + but you may add more destinations through this option. See + + for more information. + ''; + + }; + package = mkOption { description = "The Minecraft server package to use."; type = types.package; @@ -606,6 +624,7 @@ in "whitelist.json".value = mapAttrsToList (n: v: { name = n; uuid = v; }) conf.whitelist; "ops.json".value = mapAttrsToList (n: v: { name = n; uuid = v.uuid; level = v.level; bypassesPlayerLimit = v.bypassesPlayerLimit; }) conf.operators; "server.properties".value = conf.serverProperties; + "allowed_symlinks.txt".value = conf.allowedSymlinks; } // conf.files); msConfig = managementSystemConfig name conf;