Add starbound server
This commit is contained in:
parent
e7102adec1
commit
cd92ec64c2
8 changed files with 253 additions and 6 deletions
pkgs/starbound
34
pkgs/starbound/default.nix
Normal file
34
pkgs/starbound/default.nix
Normal file
|
@ -0,0 +1,34 @@
|
|||
{
|
||||
stdenv,
|
||||
lib,
|
||||
makeWrapper,
|
||||
patchelf,
|
||||
steamPackages,
|
||||
replace-secret,
|
||||
}: let
|
||||
# Use the directory in which starbound is installed so steamcmd
|
||||
# doesn't have to be reinstalled constantly (we're using DynamicUser
|
||||
# with StateDirectory to persist this).
|
||||
steamcmd = steamPackages.steamcmd.override {
|
||||
steamRoot = "/var/lib/starbound/.steamcmd";
|
||||
};
|
||||
wrapperPath = lib.makeBinPath [patchelf steamcmd replace-secret];
|
||||
in
|
||||
stdenv.mkDerivation {
|
||||
name = "starbound-update-script";
|
||||
nativeBuildInputs = [makeWrapper];
|
||||
dontUnpack = true;
|
||||
patchPhase = ''
|
||||
interpreter="$(cat $NIX_CC/nix-support/dynamic-linker)"
|
||||
substitute ${./launch-starbound.sh} launch-starbound --subst-var interpreter
|
||||
'';
|
||||
installPhase = ''
|
||||
mkdir -p $out/bin
|
||||
cp launch-starbound $out/bin/launch-starbound
|
||||
chmod +x $out/bin/launch-starbound
|
||||
'';
|
||||
postFixup = ''
|
||||
wrapProgram $out/bin/launch-starbound \
|
||||
--prefix PATH : "${wrapperPath}"
|
||||
'';
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue