Add fallback to our mesa package for non-NixOS hosts
This commit is contained in:
parent
c164db06c1
commit
59137223a9
3 changed files with 12 additions and 2 deletions
|
|
@ -70,6 +70,7 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
munix = pkgs.callPackage ./packages/munix {
|
munix = pkgs.callPackage ./packages/munix {
|
||||||
|
mesa = self.packages.${system}.mesa;
|
||||||
muvm = self.packages.${system}.muvm;
|
muvm = self.packages.${system}.muvm;
|
||||||
sidebus-broker = sidebus.packages.${system}.sidebus-broker;
|
sidebus-broker = sidebus.packages.${system}.sidebus-broker;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
9
munix
9
munix
|
|
@ -15,6 +15,10 @@ PIPEWIRE=1
|
||||||
X11=0
|
X11=0
|
||||||
export TMP=/tmp TMPDIR=/tmp TEMP=/tmp TEMPDIR=/tmp LC_ALL=C
|
export TMP=/tmp TMPDIR=/tmp TEMP=/tmp TEMPDIR=/tmp LC_ALL=C
|
||||||
|
|
||||||
|
if [ ! -e "$HOST_OPENGL_DRIVER" ]; then
|
||||||
|
HOST_OPENGL_DRIVER="$FALLBACK_OPENGL_DRIVER"
|
||||||
|
fi
|
||||||
|
|
||||||
while [ "$#" -gt 0 ]; do
|
while [ "$#" -gt 0 ]; do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
-u|--uid) MICROVM_UID="$2"; shift 2;;
|
-u|--uid) MICROVM_UID="$2"; shift 2;;
|
||||||
|
|
@ -58,6 +62,11 @@ if [ "$PASST_PATH" = "" ]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ ! -e "$HOST_OPENGL_DRIVER" ]; then
|
||||||
|
echo "munix: host graphics driver not found, provide a --host-opengl-driver" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
# Resolve symlinks automatically
|
# Resolve symlinks automatically
|
||||||
MICROVM_CLOSURE=$(realpath "$MICROVM_CLOSURE")
|
MICROVM_CLOSURE=$(realpath "$MICROVM_CLOSURE")
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
{ writeScriptBin, symlinkJoin, makeWrapper, muvm, passt, bubblewrap, sidebus-broker }:
|
{ writeScriptBin, symlinkJoin, makeWrapper, muvm, passt, bubblewrap, sidebus-broker, mesa }:
|
||||||
|
|
||||||
let
|
let
|
||||||
munixScript = (writeScriptBin "munix" (builtins.readFile ../../munix)).overrideAttrs(old: {
|
munixScript = (writeScriptBin "munix" (builtins.readFile ../../munix)).overrideAttrs(old: {
|
||||||
|
|
@ -9,6 +9,6 @@ in symlinkJoin {
|
||||||
paths = [ munixScript muvm passt bubblewrap sidebus-broker ];
|
paths = [ munixScript muvm passt bubblewrap sidebus-broker ];
|
||||||
buildInputs = [ makeWrapper ];
|
buildInputs = [ makeWrapper ];
|
||||||
postBuild = ''
|
postBuild = ''
|
||||||
wrapProgram $out/bin/munix --prefix PATH : $out/bin
|
wrapProgram $out/bin/munix --prefix PATH : $out/bin --set FALLBACK_OPENGL_DRIVER ${mesa}
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue