forked from mirrors/nixpkgs
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;
|
||||
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
|
||||
xsession = wm: dm: pkgs.writeScript "xsession"
|
||||
''
|
||||
|
@ -80,6 +91,8 @@ let
|
|||
${xorg.xrdb}/bin/xrdb -merge ~/.Xdefaults
|
||||
fi
|
||||
|
||||
export LIBVA_DRIVERS_PATH=${vaapiDrivers}/lib/dri;
|
||||
|
||||
source /etc/profile
|
||||
|
||||
${cfg.displayManager.sessionCommands}
|
||||
|
|
|
@ -30,7 +30,6 @@ let
|
|||
(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);
|
||||
|
||||
|
||||
fontsForXServer =
|
||||
config.fonts.fonts ++
|
||||
# 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 {
|
||||
default = true;
|
||||
description = ''
|
||||
|
|
Loading…
Reference in a new issue