summary refs log tree commit diff
path: root/nixos/modules/services/x11/xserver.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixos/modules/services/x11/xserver.nix')
-rw-r--r--nixos/modules/services/x11/xserver.nix24
1 files changed, 8 insertions, 16 deletions
diff --git a/nixos/modules/services/x11/xserver.nix b/nixos/modules/services/x11/xserver.nix
index f5ed5233818..8617a5fab03 100644
--- a/nixos/modules/services/x11/xserver.nix
+++ b/nixos/modules/services/x11/xserver.nix
@@ -465,23 +465,15 @@ in
         }
       ];
 
-    environment.etc =
-      (optionals cfg.exportConfiguration
-        [ { source = "${configFile}";
-            target = "X11/xorg.conf";
-          }
-          # -xkbdir command line option does not seems to be passed to xkbcomp.
-          { source = "${cfg.xkbDir}";
-            target = "X11/xkb";
-          }
-        ])
+    environment.etc = mkMerge [
+      (mkIf cfg.exportConfiguration {
+        "X11/xorg.conf".source = configFile;
+        "X11/xkb".source = cfg.xkbDir;
+      })
       # Needed since 1.18; see https://bugs.freedesktop.org/show_bug.cgi?id=89023#c5
-      ++ (let cfgPath = "/X11/xorg.conf.d/10-evdev.conf"; in
-        [{
-          source = xorg.xf86inputevdev.out + "/share" + cfgPath;
-          target = cfgPath;
-        }]
-      );
+      (let cfgPath = "X11/xorg.conf.d/10-evdev.conf"; in
+        { "${cfgPath}".source = xorg.xf86inputevdev.out + "/share" + cfgPath; })
+    ];
 
     environment.systemPackages =
       [ xorg.xorgserver.out