mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-10-21 20:58:41 +03:00
Adding vaapi drivers to nixos
Enabling nvidia and intel drivers by default. I tried both, and they work fine with "vlc --ffmpeg-hw".
This commit is contained in:
parent
37985ad66b
commit
d50b22e882
@ -16,6 +16,17 @@ let
|
|||||||
cfg = config.services.xserver;
|
cfg = config.services.xserver;
|
||||||
xorg = pkgs.xorg;
|
xorg = pkgs.xorg;
|
||||||
|
|
||||||
|
vaapiDrivers = pkgs.buildEnv {
|
||||||
|
name = "vaapi-drivers";
|
||||||
|
paths = cfg.vaapiDrivers;
|
||||||
|
pathsToLink = "/lib/dri";
|
||||||
|
|
||||||
|
# To admit zero-length 'paths'
|
||||||
|
postBuild = "
|
||||||
|
ensureDir $out/lib/dri
|
||||||
|
";
|
||||||
|
};
|
||||||
|
|
||||||
# file provided by services.xserver.displayManager.session.script
|
# file provided by services.xserver.displayManager.session.script
|
||||||
xsession = wm: dm: pkgs.writeScript "xsession"
|
xsession = wm: dm: pkgs.writeScript "xsession"
|
||||||
''
|
''
|
||||||
@ -80,6 +91,8 @@ let
|
|||||||
${xorg.xrdb}/bin/xrdb -merge ~/.Xdefaults
|
${xorg.xrdb}/bin/xrdb -merge ~/.Xdefaults
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
export LIBVA_DRIVERS_PATH=${vaapiDrivers}/lib/dri;
|
||||||
|
|
||||||
source /etc/profile
|
source /etc/profile
|
||||||
|
|
||||||
${cfg.displayManager.sessionCommands}
|
${cfg.displayManager.sessionCommands}
|
||||||
|
@ -30,7 +30,6 @@ let
|
|||||||
(name: { inherit name; driverName = name; } //
|
(name: { inherit name; driverName = name; } //
|
||||||
attrByPath [name] (if (hasAttr ("xf86video" + name) xorg) then { modules = [(getAttr ("xf86video" + name) xorg) ]; } else throw "unknown video driver `${name}'") knownVideoDrivers);
|
attrByPath [name] (if (hasAttr ("xf86video" + name) xorg) then { modules = [(getAttr ("xf86video" + name) xorg) ]; } else throw "unknown video driver `${name}'") knownVideoDrivers);
|
||||||
|
|
||||||
|
|
||||||
fontsForXServer =
|
fontsForXServer =
|
||||||
config.fonts.fonts ++
|
config.fonts.fonts ++
|
||||||
# We don't want these fonts in fonts.conf, because then modern,
|
# We don't want these fonts in fonts.conf, because then modern,
|
||||||
@ -204,6 +203,15 @@ in
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
vaapiDrivers = mkOption {
|
||||||
|
default = [ pkgs.vaapiIntel pkgs.vaapiVdpau ];
|
||||||
|
defaultText = "[ pkgs.vaapiIntel pkgs.vaapiVdpau ]";
|
||||||
|
example = "[ pkgs.vaapiIntel pkgs.vaapiVdpau ]";
|
||||||
|
description = ''
|
||||||
|
Names of the packages providing libva acceleration drivers.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
driSupport = mkOption {
|
driSupport = mkOption {
|
||||||
default = true;
|
default = true;
|
||||||
description = ''
|
description = ''
|
||||||
|
Loading…
Reference in New Issue
Block a user