summary refs log tree commit diff
path: root/nixos/modules/services/x11/xserver.nix
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2014-10-05 00:03:52 +0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2014-10-05 01:11:06 +0200
commit97220c973fdc6d3cfa02fe597c4301e87177603c (patch)
treec208a98c5a45a9700b8c56775e69542ef7fba44f /nixos/modules/services/x11/xserver.nix
parent0e120dc68f7de02ccb22df27fd15835fc6d082a4 (diff)
downloadnixlib-97220c973fdc6d3cfa02fe597c4301e87177603c.tar
nixlib-97220c973fdc6d3cfa02fe597c4301e87177603c.tar.gz
nixlib-97220c973fdc6d3cfa02fe597c4301e87177603c.tar.bz2
nixlib-97220c973fdc6d3cfa02fe597c4301e87177603c.tar.lz
nixlib-97220c973fdc6d3cfa02fe597c4301e87177603c.tar.xz
nixlib-97220c973fdc6d3cfa02fe597c4301e87177603c.tar.zst
nixlib-97220c973fdc6d3cfa02fe597c4301e87177603c.zip
Replace hasAttr/getAttr calls with the ? and . operators
For NixOS evaluation, this gives a ~21% reduction in the number of
values allocated and a ~4% speedup. It's also more readable.
Diffstat (limited to 'nixos/modules/services/x11/xserver.nix')
-rw-r--r--nixos/modules/services/x11/xserver.nix4
1 files changed, 2 insertions, 2 deletions
diff --git a/nixos/modules/services/x11/xserver.nix b/nixos/modules/services/x11/xserver.nix
index c08afe2041f4..1ce8de23c16d 100644
--- a/nixos/modules/services/x11/xserver.nix
+++ b/nixos/modules/services/x11/xserver.nix
@@ -399,8 +399,8 @@ in
     services.xserver.drivers = flip concatMap cfg.videoDrivers (name:
       let driver =
         attrByPath [name]
-          (if (hasAttr ("xf86video" + name) xorg)
-           then { modules = [(getAttr ("xf86video" + name) xorg) ]; }
+          (if xorg ? ${"xf86video" + name}
+           then { modules = [xorg.${"xf86video" + name}]; }
            else null)
           knownVideoDrivers;
       in optional (driver != null) ({ inherit name; driverName = name; } // driver));