3
0
Fork 0
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:
Lluís Batlle i Rossell 2013-01-30 20:22:40 +01:00
parent 37985ad66b
commit d50b22e882
2 changed files with 22 additions and 1 deletions

View file

@ -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}

View file

@ -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 = ''