GodotNixDevelopmentEnviroment/nix/godot.nix

33 lines
771 B
Nix

{ pkgs, ... }:
let
binName = "GodotNixBuild";
dependencies = with pkgs; [
godot_4
];
in
pkgs.stdenv.mkDerivation {
name = binName;
src = ../.;
buildInputs = dependencies;
buildPhase = ''
# this line removes a bug where value of $HOME is set to a non-writable /homeless-shelter dir
export HOME=$TMPDIR
mkdir -p $HOME/.local/share/godot/export_templates/4.2.2.stable
cp ${pkgs.godot_4-export-templates}/linux_* $HOME/.local/share/godot/export_templates/4.2.2.stable/
mkdir -p $out/bin
godot4 --headless --export-release Linux/X11 game/project.godot $out/bin/${binName}
runHook postBuild
'';
dontInstall = true;
dontFixup = true;
dontStrip = true;
}