modules: share opengl only when graphics is enabled

This commit is contained in:
Dmitriy Pleshevskiy 2024-09-08 02:36:45 +03:00
parent be8de8cc58
commit 7784352dc8
Signed by: pleshevskiy
GPG key ID: 17041163DA10A9A2
3 changed files with 38 additions and 22 deletions

View file

@ -91,9 +91,13 @@ in
isReadOnly = false;
hostPath = "/home/jan/downloads/browser";
};
"/run/opengl-driver/lib" = { };
"/run/opengl-driver-32/lib" = { };
}
(lib.mkIf config.hardware.graphics.enable {
"/run/opengl-driver/lib" = { };
})
(lib.mkIf config.hardware.graphics.enable32Bit {
"/run/opengl-driver-32/lib" = { };
})
(lib.mkIf cfg.librewolf.enable {
"/home/kira/.librewolf" = {
isReadOnly = false;

View file

@ -62,15 +62,21 @@ in
privateNetwork = true;
inherit hostAddress localAddress;
bindMounts = {
bindMounts = lib.mkMerge [
{
"/tmp/.X11-unix" = { };
"/etc/ssh/keys" = {
isReadOnly = false;
hostPath = "/persistent/per-machine/skype/etc/ssh/keys";
};
}
(lib.mkIf config.hardware.graphics.enable {
"/run/opengl-driver/lib" = { };
})
(lib.mkIf config.hardware.graphics.enable32Bit {
"/run/opengl-driver-32/lib" = { };
};
})
];
config = { pkgs, ... }: {
system.stateVersion = "23.11";
@ -105,7 +111,7 @@ in
home = "/home/kira";
password = "hello";
extraGroups = [ "pulse-access" ];
packages = [cfg.package];
packages = [ cfg.package ];
};
environment.sessionVariables = {

View file

@ -62,15 +62,21 @@ in
privateNetwork = true;
inherit hostAddress localAddress;
bindMounts = {
bindMounts = lib.mkMerge [
{
"/tmp/.X11-unix" = { };
"/etc/ssh/keys" = {
isReadOnly = false;
hostPath = "/persistent/per-machine/telegram/etc/ssh/keys";
};
}
(lib.mkIf config.hardware.graphics.enable {
"/run/opengl-driver/lib" = { };
})
(lib.mkIf config.hardware.graphics.enable32Bit {
"/run/opengl-driver-32/lib" = { };
};
})
];
config = { pkgs, ... }: {
system.stateVersion = "23.11";
@ -104,7 +110,7 @@ in
home = "/home/kira";
password = "hello";
extraGroups = [ "pulse-access" ];
packages = [cfg.package];
packages = [ cfg.package ];
};
environment.sessionVariables = {