chore: add web-files package to flake
This commit is contained in:
30
flake.nix
30
flake.nix
@@ -75,6 +75,36 @@
|
|||||||
ln -s $out/libexec/slopvivors $out/bin/slopvivors
|
ln -s $out/libexec/slopvivors $out/bin/slopvivors
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
slopvivors_web_files = pkgs.stdenv.mkDerivation {
|
||||||
|
pname = "slopvivors-web-files";
|
||||||
|
version = "0.1.0";
|
||||||
|
src = ./.;
|
||||||
|
|
||||||
|
strictDeps = true;
|
||||||
|
|
||||||
|
nativeBuildInputs = with pkgs; [
|
||||||
|
godot
|
||||||
|
godot-export-templates-bin
|
||||||
|
];
|
||||||
|
|
||||||
|
buildPhase = ''
|
||||||
|
runHook preBuild
|
||||||
|
|
||||||
|
export HOME=$(mktemp -d)
|
||||||
|
mkdir -p $HOME/.local/share/godot/
|
||||||
|
ln -s ${pkgs.godot-export-templates-bin}/share/godot/export_templates "$HOME/.local/share/godot/"
|
||||||
|
mkdir -p build
|
||||||
|
|
||||||
|
godot --headless --export-release Web ./build/slopvivors
|
||||||
|
|
||||||
|
runHook postBuild
|
||||||
|
'';
|
||||||
|
installPhase = ''
|
||||||
|
mkdir -p "$out"
|
||||||
|
cp ./build/* "$out"
|
||||||
|
mv ./build/slopvivors "$out"/index.html
|
||||||
|
'';
|
||||||
|
};
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user