feat(minecraft-servers): add symlinks option
This commit is contained in:
parent
3e35403c47
commit
7ee0261030
1 changed files with 7 additions and 0 deletions
|
@ -40,6 +40,8 @@ in
|
||||||
package = mkOpt types.package pkgs.minecraft-server;
|
package = mkOpt types.package pkgs.minecraft-server;
|
||||||
|
|
||||||
jvmOpts = mkOpt (types.separatedString " ") "-Xmx2G -Xms1G";
|
jvmOpts = mkOpt (types.separatedString " ") "-Xmx2G -Xms1G";
|
||||||
|
|
||||||
|
symlinks = mkOpt (types.attrsOf types.package) { };
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
@ -157,6 +159,10 @@ in
|
||||||
'' + concatStringsSep "\n" (mapAttrsToList
|
'' + concatStringsSep "\n" (mapAttrsToList
|
||||||
(n: v: "${n}=${cfgToString v}")
|
(n: v: "${n}=${cfgToString v}")
|
||||||
conf.serverProperties));
|
conf.serverProperties));
|
||||||
|
|
||||||
|
mkSymlinks = pkgs.writeShellScript "minecraft-server-${name}-symlinks"
|
||||||
|
(concatStringsSep "\n"
|
||||||
|
(mapAttrsToList (n: v: "ln -sf ${v} ${n}") conf.symlinks));
|
||||||
in
|
in
|
||||||
''
|
''
|
||||||
mkdir -p ${serverDir}
|
mkdir -p ${serverDir}
|
||||||
|
@ -165,6 +171,7 @@ in
|
||||||
ln -sf ${eula} eula.txt
|
ln -sf ${eula} eula.txt
|
||||||
ln -sf ${whitelist} whitelist.json
|
ln -sf ${whitelist} whitelist.json
|
||||||
cp -f ${serverProperties} server.properties
|
cp -f ${serverProperties} server.properties
|
||||||
|
${mkSymlinks}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
postStart = ''
|
postStart = ''
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue