Puppet Class: archlinux_macbookretina::videodriver

Defined in:
manifests/videodriver.pp

Overview

Install driver for the MacBook Retina's NVidia graphics; either the proprietary nvidia driver, or the open source noveau driver. Remove whichever one isn't selected.

Parameters:



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'manifests/videodriver.pp', line 10

class archlinux_macbookretina::videodriver (
  String $driver = 'nvidia'
) {

  validate_re($driver, '^(nvidia|nouveau)$')

  $nouveau_packages = ['xf86-video-nouveau',  'nouveau-dri' ]
  # nvidia-bl is a backlight driver - https://aur.archlinux.org/packages/nvidia-bl/
  #  https://wiki.archlinux.org/index.php/MacBookPro11,x#Screen_backlight seems to
  #  indicate that this weird driver may not be needed anymore
  $nvidia_packages = [ 'nvidia' ]

  if $driver == 'nvidia' {
    $add_packages = $nvidia_packages
    $remove_packages = $nouveau_packages
  } else {
    $add_packages = $nouveau_packages
    $remove_packages = $nvidia_packages
  }

  package {$remove_packages :
    ensure          => absent,
    install_options => '-dds',
  }
  -> package {$add_packages :
    ensure  => present,
  }

}