Skip to content

Commit

Permalink
add allowedSymlinks option
Browse files Browse the repository at this point in the history
  • Loading branch information
Misterio77 committed Dec 26, 2024
1 parent 8454a44 commit 074a188
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions modules/minecraft-servers.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
<link xlink:href="https://help.minecraft.net/hc/en-us/articles/16165590199181"/>
for more information.
'';

};

package = mkOption {
description = "The Minecraft server package to use.";
type = types.package;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 074a188

Please sign in to comment.