xrforge/nix/shell.nix

70 lines
2 KiB
Nix
Raw Permalink Normal View History

#let
# pkgs = import (builtins.fetchGit {
# name = "nixos-25.05";
# url = "https://github.com/nixos/nixpkgs/";
# ref = "refs/heads/nixos-unstable";
# rev = "ef99fa5c5ed624460217c31ac4271cfb5cb2502c";
# }) {};
{ pkgs ? import <nixos-unstable> {} } :
{
#pkgs = import (builtins.fetchGit {
# name = "nixos-25.05";
# url = "https://github.com/nixos/nixpkgs";
# rev = "11cb3517b3af6af300dd6c055aeda73c9bf52c48";
#}) {};
foo = pkgs.mkShell {
# nativeBuildInputs is usually what you want -- tools you need to run
nativeBuildInputs = with pkgs.buildPackages; [
monolith
nodejs_22
nixos-generators
#qemu
sqlite
];
shellHooks = ''
export NIX_SHELL_XRFORGE=1
echo "available commands:"
echo ""
echo " # build 'xrforge' docker image"
echo " nix-build nix/docker.nix"
echo ""
echo " # generate server-image for ~32 hyperscalers, see https://mynixos.com/nixos-generators"
echo " nixos-generate -f <type> -c nix/server.nix"
echo ""
echo " # use database of running container as default db for container"
echo " docker exec xrforge sqlite3 /config/manyfold.sqlite3 .dump > manyfold/manyfold.sql && nix-build nix/docker.nix"
echo ""
echo "examples:"
echo ""
echo " $ nixos-generate -f iso -c nix/server.nix"
echo " $ qemu-system-x86_64 -cdrom <isofile>" # test/run image
echo ""
echo " $ docker load < \$(nix-build nix/docker.nix)"
echo " $ docker run xrforge"
echo ""
2025-08-01 11:41:59 +02:00
echo " $ # copy image to other server
echo " $ docker save xrforge | bzip2 | ssh user@host docker load"
echo ""
2025-10-23 19:21:56 +02:00
echo "Development:"
echo ""
echo "" $ cd xrforge-webxr && bun run build && cp dist/xrforge.html ../manyfold/usr/src/app/public/view/index.html
echo "" $ manyfold/cli/manyfold.sh run -e DEV=1 -v ./manyfold/usr/src/app/public/view:/usr/src/app/public/view
echo ""
'';
};
}