update nix files

This commit is contained in:
Leon van Kammen 2026-01-19 19:56:29 +01:00
parent 53ccca3c48
commit 258df4621f
2 changed files with 39 additions and 30 deletions

View file

@ -41,13 +41,15 @@ let
#### JANUSXR Stack #### JANUSXR Stack
janusweb = builtins.fetchTarball { janusweb = builtins.fetchTarball {
url = "https://github.com/coderofsalvation/janusweb/releases/download/1.5.56-xrf/janusweb-1.5.56.tar.gz"; name = "janusweb";
url = "https://github.com/coderofsalvation/janusweb/releases/download/1.5.56-peertube/janusweb-1.5.56.tar.gz";
# Get the SHA256 hash by running: nix-prefetch-url --unpack <URL> # Get the SHA256 hash by running: nix-prefetch-url --unpack <URL>
sha256 = "0zkmfv07zxdf1nkhgr4g959fj86p2yp9f7n1ll1zyhlm186sfh31"; sha256 = "11mlbhmi3vs1xpxjp4dlxb8yi60dmdrh0bfkl0j0hlfhr9y2px4d";
}; };
# Fetch the source from the GitHub tag # Fetch the source from the GitHub tag
corsanywhere = pkgs.fetchzip { corsanywhere = pkgs.fetchzip {
name = "corsanywhere";
url = "https://github.com/Rob--W/cors-anywhere/archive/0.4.4.tar.gz"; url = "https://github.com/Rob--W/cors-anywhere/archive/0.4.4.tar.gz";
# You need to calculate the correct SHA256 hash for version 0.4.4 # You need to calculate the correct SHA256 hash for version 0.4.4
# You can get this by running 'nix-prefetch-url --unpack https://github.com/Rob--W/cors-anywhere/archive/0.4.4.tar.gz' # You can get this by running 'nix-prefetch-url --unpack https://github.com/Rob--W/cors-anywhere/archive/0.4.4.tar.gz'
@ -62,28 +64,26 @@ let
}; };
## 2. Create a minimal derivation to make the file executable ## 2. Create a minimal derivation to make the file executable
#janusServerBin = pkgs.stdenv.mkDerivation { janusServerBin = pkgs.stdenv.mkDerivation {
# pname = "janus-server"; pname = "janus-server";
# version = "1.0"; version = "1.0";
# src = janusServer; src = janusServer;
# dontUnpack = true; dontUnpack = true;
# dontBuild = true; dontBuild = true;
# installPhase = '' installPhase = ''
# mkdir -p $out/bin mkdir -p $out/bin
# cp $src $out/bin/janus_server-linux cp $src $out/bin/janus_server-linux
# chmod +x $out/bin/janus_server-linux chmod +x $out/bin/janus_server-linux
# ''; '';
#}; };
janus = pkgs.runCommand "janusweb-content" {} '' janus = pkgs.runCommand "janus" {} ''
mkdir -p $out/mnt/janusweb $out/root/corsanywhere $out/root mkdir -p $out/janusweb $out/root/corsanywhere
cp -rT ${janusweb} $out/mnt/janusweb cp -rT ${janusweb} $out/janusweb
cp -rT ${corsanywhere} $out/root/corsanywhere/. cp -rT ${corsanywhere} $out/root/corsanywhere/.
cp -rT ${janusServer} $out/root/janus_server-linux cp -rT ${janusServer} $out/root/janus_server-linux
''; '';
#### XR FRAGMENTS
## $ nix-shell -p nix-prefetch-git --command 'nix-prefetch-git https://codeberg.org/coderofsalvation/xrfragment.git <commit>' ## $ nix-shell -p nix-prefetch-git --command 'nix-prefetch-git https://codeberg.org/coderofsalvation/xrfragment.git <commit>'
xrfragmentsRepo = pkgs.fetchFromGitea { xrfragmentsRepo = pkgs.fetchFromGitea {
"domain" = "codeberg.org"; "domain" = "codeberg.org";
@ -93,10 +93,10 @@ let
"hash" = "sha256-P/RVwoDu0EYfwc0n2h1f4j0JZshtE4AtQsTU9iEkAcA="; "hash" = "sha256-P/RVwoDu0EYfwc0n2h1f4j0JZshtE4AtQsTU9iEkAcA=";
}; };
xrfragments = pkgs.runCommand "xrfragments-content" {} '' xrfragments = pkgs.runCommand "xrfragments" {} ''
mkdir -p $out/mnt/asset/xrfragments $out/mnt/templates/xrfragments mkdir -p $out/xrf/templates/xrfragments $out/xrf/assets/xrfragments
cp -r ${xrfragmentsRepo}/assets/library $out/mnt/asset/xrfragments/\#1 cp -rT ${xrfragmentsRepo}/assets/library $out/xrf/assets/xrfragments/\#1
find ${xrfragmentsRepo}//assets/template -maxdepth 1 -mindepth 1 -type d | awk '{ system("cp -r "$0" '$out'/mnt/templates/xrfragments/#"(NR+1)) }' find ${xrfragmentsRepo}/assets/template -maxdepth 1 -mindepth 1 -type d | awk '{ system("cp -rT "$0" '$out'/xrf/templates/xrfragments/#"(NR+1)) }'
''; '';
@ -118,7 +118,7 @@ in
rec rec
{ {
xrforgeImage = pkgs.dockerTools.buildImage { xrforgeImage = pkgs.dockerTools.buildLayeredImage {
name = "xrforge"; name = "xrforge";
tag = "latest"; tag = "latest";
@ -126,16 +126,16 @@ rec
fromImage = manyfoldImage; fromImage = manyfoldImage;
# add nix pkgs + local files # add nix pkgs + local files
copyToRoot = pkgs.buildEnv { contents = pkgs.buildEnv {
name = "image-root"; name = "image-root";
pathsToLink = ["/manyfold" "/bin" "/mnt" "/root"]; pathsToLink = ["/manyfold" "/bin" "/root" "/xrf" "/janusweb"];
paths = [ paths = [
#pkgs.pkgsStatic.rsync #pkgs.pkgsStatic.rsync
pkgs.rsync pkgs.rsync
pkgs.sqlite pkgs.sqlite
pkgs.rclone pkgs.rclone
pkgs.fuse3 pkgs.fuse3
pkgs.janus-gateway # webrtc voip for JanusXR #pkgs.janus-gateway # webrtc voip for JanusXR
pkgs.nodejs_20 # for corsanywhere pkgs.nodejs_20 # for corsanywhere
#pkgs.acl # getfacl e.g. #pkgs.acl # getfacl e.g.
#pkgs.inotify-tools # inotifywait e.g. #pkgs.inotify-tools # inotifywait e.g.
@ -145,10 +145,20 @@ rec
#myAssimp # updated build of assimp #myAssimp # updated build of assimp
janus janus
xrfragments xrfragments
../. ../manyfold
]; ];
}; };
# we do this here (instead of creating a derivation which copies/links them)
# because the derivation will duplicate the content (even when linking )
# causing the image to balloon in size :/
enableFakechroot = true;
fakeRootCommands = ''
for dir in /nix/store/*-manyfold/*; do
ln -s $dir /manyfold/.
done
'';
config = { config = {
Cmd = ["/init"]; Cmd = ["/init"];
# We substitute the /init entrypoing with our own wrapper # We substitute the /init entrypoing with our own wrapper

View file

@ -22,11 +22,10 @@
# nativeBuildInputs is usually what you want -- tools you need to run # nativeBuildInputs is usually what you want -- tools you need to run
nativeBuildInputs = with pkgs.buildPackages; [ nativeBuildInputs = with pkgs.buildPackages; [
monolith
nodejs_22
nixos-generators nixos-generators
#qemu #qemu
sqlite sqlite
pv
]; ];