From 22088b4b25119083d8adfc055073f563b9cd8115 Mon Sep 17 00:00:00 2001 From: Gabriel Ebner Date: Sat, 6 Aug 2016 07:22:33 +0200 Subject: [PATCH] nixos/x11: make nvidia driver work again The nvidia driver module directly sets the services.xserver.drivers option, while still having nvidia/nvidiaBeta/... etc. in the videoDrivers option. --- nixos/modules/services/x11/xserver.nix | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/nixos/modules/services/x11/xserver.nix b/nixos/modules/services/x11/xserver.nix index 51f55322ca61..b03f70385b1f 100644 --- a/nixos/modules/services/x11/xserver.nix +++ b/nixos/modules/services/x11/xserver.nix @@ -438,14 +438,15 @@ in services.xserver.videoDrivers = mkIf (cfg.videoDriver != null) [ cfg.videoDriver ]; - services.xserver.drivers = flip map cfg.videoDrivers (name: + # FIXME: somehow check for unknown driver names. + services.xserver.drivers = flip concatMap cfg.videoDrivers (name: let driver = attrByPath [name] (if xorg ? ${"xf86video" + name} then { modules = [xorg.${"xf86video" + name}]; } - else throw "Unknown video driver: ${name}") + else null) knownVideoDrivers; - in { inherit name; modules = []; driverName = name; } // driver); + in optional (driver != null) ({ inherit name; modules = []; driverName = name; } // driver)); assertions = [ { assertion = config.security.polkit.enable;