nix: mount nvidia devices
These non-standard paths are required in the sandbox for nvidia drivers to work. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
parent
21735a8abe
commit
8d04dd72f1
60
nixos.nix
60
nixos.nix
@ -124,42 +124,40 @@ in
|
|||||||
map_real_uid = app.mapRealUid;
|
map_real_uid = app.mapRealUid;
|
||||||
no_new_session = app.tty;
|
no_new_session = app.tty;
|
||||||
filesystem =
|
filesystem =
|
||||||
|
let
|
||||||
|
bind = src: { inherit src; };
|
||||||
|
mustBind = src: {
|
||||||
|
inherit src;
|
||||||
|
require = true;
|
||||||
|
};
|
||||||
|
devBind = src: {
|
||||||
|
inherit src;
|
||||||
|
dev = true;
|
||||||
|
};
|
||||||
|
in
|
||||||
[
|
[
|
||||||
{ src = "/bin"; }
|
(mustBind "/bin")
|
||||||
{ src = "/usr/bin"; }
|
(mustBind "/usr/bin")
|
||||||
{ src = "/nix/store"; }
|
(mustBind "/nix/store")
|
||||||
{ src = "/run/current-system"; }
|
(mustBind "/run/current-system")
|
||||||
{
|
(bind "/sys/block")
|
||||||
src = "/sys/block";
|
(bind "/sys/bus")
|
||||||
require = false;
|
(bind "/sys/class")
|
||||||
}
|
(bind "/sys/dev")
|
||||||
{
|
(bind "/sys/devices")
|
||||||
src = "/sys/bus";
|
|
||||||
require = false;
|
|
||||||
}
|
|
||||||
{
|
|
||||||
src = "/sys/class";
|
|
||||||
require = false;
|
|
||||||
}
|
|
||||||
{
|
|
||||||
src = "/sys/dev";
|
|
||||||
require = false;
|
|
||||||
}
|
|
||||||
{
|
|
||||||
src = "/sys/devices";
|
|
||||||
require = false;
|
|
||||||
}
|
|
||||||
]
|
]
|
||||||
++ optionals app.nix [
|
++ optionals app.nix [
|
||||||
{ src = "/nix/var"; }
|
(mustBind "/nix/var")
|
||||||
{ src = "/var/db/nix-channels"; }
|
(bind "/var/db/nix-channels")
|
||||||
]
|
]
|
||||||
++ optionals (if app.gpu != null then app.gpu else app.capability.wayland || app.capability.x11) [
|
++ optionals (if app.gpu != null then app.gpu else app.capability.wayland || app.capability.x11) [
|
||||||
{ src = "/run/opengl-driver"; }
|
(bind "/run/opengl-driver")
|
||||||
{
|
(devBind "/dev/dri")
|
||||||
src = "/dev/dri";
|
(devBind "/dev/nvidiactl")
|
||||||
dev = true;
|
(devBind "/dev/nvidia-modeset")
|
||||||
}
|
(devBind "/dev/nvidia-uvm")
|
||||||
|
(devBind "/dev/nvidia-uvm-tools")
|
||||||
|
(devBind "/dev/nvidia0")
|
||||||
]
|
]
|
||||||
++ app.extraPaths;
|
++ app.extraPaths;
|
||||||
auto_etc = true;
|
auto_etc = true;
|
||||||
|
Loading…
Reference in New Issue
Block a user