summary refs log tree commit diff
path: root/nixos/modules/services/x11
diff options
context:
space:
mode:
authorNaïm Favier <n@monade.li>2021-10-03 18:06:03 +0200
committerNaïm Favier <n@monade.li>2021-10-04 12:47:20 +0200
commit2ddc335e6f32b875e14ad9610101325b306a0add (patch)
tree2a4591c137cb363a6ec09f529d587a10aa7a0bc7 /nixos/modules/services/x11
parent330b1e08b8df4e1f0100a0a7810ec3157749e5ee (diff)
downloadnixpkgs-2ddc335e6f32b875e14ad9610101325b306a0add.tar
nixpkgs-2ddc335e6f32b875e14ad9610101325b306a0add.tar.gz
nixpkgs-2ddc335e6f32b875e14ad9610101325b306a0add.tar.bz2
nixpkgs-2ddc335e6f32b875e14ad9610101325b306a0add.tar.lz
nixpkgs-2ddc335e6f32b875e14ad9610101325b306a0add.tar.xz
nixpkgs-2ddc335e6f32b875e14ad9610101325b306a0add.tar.zst
nixpkgs-2ddc335e6f32b875e14ad9610101325b306a0add.zip
nixos/doc: clean up defaults and examples
Diffstat (limited to 'nixos/modules/services/x11')
-rw-r--r--nixos/modules/services/x11/desktop-managers/cde.nix2
-rw-r--r--nixos/modules/services/x11/desktop-managers/cinnamon.nix4
-rw-r--r--nixos/modules/services/x11/desktop-managers/gnome.nix18
-rw-r--r--nixos/modules/services/x11/desktop-managers/kodi.nix4
-rw-r--r--nixos/modules/services/x11/desktop-managers/lxqt.nix2
-rw-r--r--nixos/modules/services/x11/desktop-managers/mate.nix2
-rw-r--r--nixos/modules/services/x11/desktop-managers/pantheon.nix4
-rw-r--r--nixos/modules/services/x11/desktop-managers/surf-display.nix3
-rw-r--r--nixos/modules/services/x11/desktop-managers/xfce.nix2
-rw-r--r--nixos/modules/services/x11/desktop-managers/xterm.nix4
-rw-r--r--nixos/modules/services/x11/display-managers/default.nix6
-rw-r--r--nixos/modules/services/x11/display-managers/lightdm-greeters/enso-os.nix6
-rw-r--r--nixos/modules/services/x11/display-managers/lightdm-greeters/gtk.nix6
-rw-r--r--nixos/modules/services/x11/display-managers/lightdm.nix2
-rw-r--r--nixos/modules/services/x11/display-managers/sddm.nix14
-rw-r--r--nixos/modules/services/x11/extra-layouts.nix2
-rw-r--r--nixos/modules/services/x11/imwheel.nix20
-rw-r--r--nixos/modules/services/x11/picom.nix2
-rw-r--r--nixos/modules/services/x11/redshift.nix2
-rw-r--r--nixos/modules/services/x11/touchegg.nix2
-rw-r--r--nixos/modules/services/x11/unclutter-xfixes.nix2
-rw-r--r--nixos/modules/services/x11/unclutter.nix2
-rw-r--r--nixos/modules/services/x11/urxvtd.nix2
-rw-r--r--nixos/modules/services/x11/window-managers/awesome.nix2
-rw-r--r--nixos/modules/services/x11/window-managers/bspwm.nix12
-rw-r--r--nixos/modules/services/x11/window-managers/clfswm.nix2
-rw-r--r--nixos/modules/services/x11/window-managers/exwm.nix7
-rw-r--r--nixos/modules/services/x11/window-managers/herbstluftwm.nix2
-rw-r--r--nixos/modules/services/x11/window-managers/i3.nix6
-rw-r--r--nixos/modules/services/x11/window-managers/wmderland.nix2
-rw-r--r--nixos/modules/services/x11/window-managers/xmonad.nix10
-rw-r--r--nixos/modules/services/x11/xautolock.nix7
-rw-r--r--nixos/modules/services/x11/xserver.nix5
33 files changed, 86 insertions, 82 deletions
diff --git a/nixos/modules/services/x11/desktop-managers/cde.nix b/nixos/modules/services/x11/desktop-managers/cde.nix
index 24ca82fca79..7eb4d1bf729 100644
--- a/nixos/modules/services/x11/desktop-managers/cde.nix
+++ b/nixos/modules/services/x11/desktop-managers/cde.nix
@@ -14,7 +14,7 @@ in {
       default = with pkgs.xorg; [
         xclock bitmap xlsfonts xfd xrefresh xload xwininfo xdpyinfo xwd xwud
       ];
-      example = literalExample ''
+      defaultText = literalExpression ''
         with pkgs.xorg; [
           xclock bitmap xlsfonts xfd xrefresh xload xwininfo xdpyinfo xwd xwud
         ]
diff --git a/nixos/modules/services/x11/desktop-managers/cinnamon.nix b/nixos/modules/services/x11/desktop-managers/cinnamon.nix
index d201c1a5334..a0a5873f72f 100644
--- a/nixos/modules/services/x11/desktop-managers/cinnamon.nix
+++ b/nixos/modules/services/x11/desktop-managers/cinnamon.nix
@@ -26,7 +26,7 @@ in
       sessionPath = mkOption {
         default = [];
         type = types.listOf types.package;
-        example = literalExample "[ pkgs.gnome.gpaste ]";
+        example = literalExpression "[ pkgs.gnome.gpaste ]";
         description = ''
           Additional list of packages to be added to the session search path.
           Useful for GSettings-conditional autostart.
@@ -50,7 +50,7 @@ in
 
     environment.cinnamon.excludePackages = mkOption {
       default = [];
-      example = literalExample "[ pkgs.cinnamon.blueberry ]";
+      example = literalExpression "[ pkgs.cinnamon.blueberry ]";
       type = types.listOf types.package;
       description = "Which packages cinnamon should exclude from the default environment";
     };
diff --git a/nixos/modules/services/x11/desktop-managers/gnome.nix b/nixos/modules/services/x11/desktop-managers/gnome.nix
index 9bb671adbec..e65e0164667 100644
--- a/nixos/modules/services/x11/desktop-managers/gnome.nix
+++ b/nixos/modules/services/x11/desktop-managers/gnome.nix
@@ -186,7 +186,7 @@ in
       sessionPath = mkOption {
         default = [];
         type = types.listOf types.package;
-        example = literalExample "[ pkgs.gnome.gpaste ]";
+        example = literalExpression "[ pkgs.gnome.gpaste ]";
         description = ''
           Additional list of packages to be added to the session search path.
           Useful for GNOME Shell extensions or GSettings-conditional autostart.
@@ -200,9 +200,11 @@ in
         internal = true; # this is messy
         default = defaultFavoriteAppsOverride;
         type = types.lines;
-        example = literalExample ''
-          [org.gnome.shell]
-          favorite-apps=[ 'firefox.desktop', 'org.gnome.Calendar.desktop' ]
+        example = literalExpression ''
+          '''
+            [org.gnome.shell]
+            favorite-apps=[ 'firefox.desktop', 'org.gnome.Calendar.desktop' ]
+          '''
         '';
         description = "List of desktop files to put as favorite apps into gnome-shell. These need to be installed somehow globally.";
       };
@@ -242,13 +244,13 @@ in
               wmCommand = mkOption {
                 type = types.str;
                 description = "The executable of the window manager to use.";
-                example = "\${pkgs.haskellPackages.xmonad}/bin/xmonad";
+                example = literalExpression ''"''${pkgs.haskellPackages.xmonad}/bin/xmonad"'';
               };
 
               enableGnomePanel = mkOption {
                 type = types.bool;
                 default = true;
-                example = "false";
+                example = false;
                 description = "Whether to enable the GNOME panel in this session.";
               };
             };
@@ -259,20 +261,20 @@ in
 
         panelModulePackages = mkOption {
           default = [ pkgs.gnome.gnome-applets ];
+          defaultText = literalExpression "[ pkgs.gnome.gnome-applets ]";
           type = types.listOf types.path;
           description = ''
             Packages containing modules that should be made available to <literal>gnome-panel</literal> (usually for applets).
 
             If you're packaging something to use here, please install the modules in <literal>$out/lib/gnome-panel/modules</literal>.
           '';
-          example = literalExample "[ pkgs.gnome.gnome-applets ]";
         };
       };
     };
 
     environment.gnome.excludePackages = mkOption {
       default = [];
-      example = literalExample "[ pkgs.gnome.totem ]";
+      example = literalExpression "[ pkgs.gnome.totem ]";
       type = types.listOf types.package;
       description = "Which packages gnome should exclude from the default environment";
     };
diff --git a/nixos/modules/services/x11/desktop-managers/kodi.nix b/nixos/modules/services/x11/desktop-managers/kodi.nix
index af303d6fb27..b853c94d6fd 100644
--- a/nixos/modules/services/x11/desktop-managers/kodi.nix
+++ b/nixos/modules/services/x11/desktop-managers/kodi.nix
@@ -18,8 +18,8 @@ in
       package = mkOption {
         type = types.package;
         default = pkgs.kodi;
-        defaultText = "pkgs.kodi";
-        example = "pkgs.kodi.withPackages (p: with p; [ jellyfin pvr-iptvsimple vfs-sftp ])";
+        defaultText = literalExpression "pkgs.kodi";
+        example = literalExpression "pkgs.kodi.withPackages (p: with p; [ jellyfin pvr-iptvsimple vfs-sftp ])";
         description = ''
           Package that should be used for Kodi.
         '';
diff --git a/nixos/modules/services/x11/desktop-managers/lxqt.nix b/nixos/modules/services/x11/desktop-managers/lxqt.nix
index 71dfad5c7ca..720985ba0d9 100644
--- a/nixos/modules/services/x11/desktop-managers/lxqt.nix
+++ b/nixos/modules/services/x11/desktop-managers/lxqt.nix
@@ -19,7 +19,7 @@ in
 
     environment.lxqt.excludePackages = mkOption {
       default = [];
-      example = literalExample "[ pkgs.lxqt.qterminal ]";
+      example = literalExpression "[ pkgs.lxqt.qterminal ]";
       type = types.listOf types.package;
       description = "Which LXQt packages to exclude from the default environment";
     };
diff --git a/nixos/modules/services/x11/desktop-managers/mate.nix b/nixos/modules/services/x11/desktop-managers/mate.nix
index 19ab9edb732..f8f47a06145 100644
--- a/nixos/modules/services/x11/desktop-managers/mate.nix
+++ b/nixos/modules/services/x11/desktop-managers/mate.nix
@@ -35,7 +35,7 @@ in
 
     environment.mate.excludePackages = mkOption {
       default = [];
-      example = literalExample "[ pkgs.mate.mate-terminal pkgs.mate.pluma ]";
+      example = literalExpression "[ pkgs.mate.mate-terminal pkgs.mate.pluma ]";
       type = types.listOf types.package;
       description = "Which MATE packages to exclude from the default environment";
     };
diff --git a/nixos/modules/services/x11/desktop-managers/pantheon.nix b/nixos/modules/services/x11/desktop-managers/pantheon.nix
index 887d6c91e83..10969a373bb 100644
--- a/nixos/modules/services/x11/desktop-managers/pantheon.nix
+++ b/nixos/modules/services/x11/desktop-managers/pantheon.nix
@@ -43,7 +43,7 @@ in
       sessionPath = mkOption {
         default = [];
         type = types.listOf types.package;
-        example = literalExample "[ pkgs.gnome.gpaste ]";
+        example = literalExpression "[ pkgs.gnome.gpaste ]";
         description = ''
           Additional list of packages to be added to the session search path.
           Useful for GSettings-conditional autostart.
@@ -86,7 +86,7 @@ in
 
     environment.pantheon.excludePackages = mkOption {
       default = [];
-      example = literalExample "[ pkgs.pantheon.elementary-camera ]";
+      example = literalExpression "[ pkgs.pantheon.elementary-camera ]";
       type = types.listOf types.package;
       description = "Which packages pantheon should exclude from the default environment";
     };
diff --git a/nixos/modules/services/x11/desktop-managers/surf-display.nix b/nixos/modules/services/x11/desktop-managers/surf-display.nix
index 9aeb0bbd2a8..4b5a04f988b 100644
--- a/nixos/modules/services/x11/desktop-managers/surf-display.nix
+++ b/nixos/modules/services/x11/desktop-managers/surf-display.nix
@@ -50,6 +50,7 @@ in {
       defaultWwwUri = mkOption {
         type = types.str;
         default = "${pkgs.surf-display}/share/surf-display/empty-page.html";
+        defaultText = literalExpression ''"''${pkgs.surf-display}/share/surf-display/empty-page.html"'';
         example = "https://www.example.com/";
         description = "Default URI to display.";
       };
@@ -57,7 +58,7 @@ in {
       inactivityInterval = mkOption {
         type = types.int;
         default = 300;
-        example = "0";
+        example = 0;
         description = ''
           Setting for internal inactivity timer to restart surf-display if the
           user goes inactive/idle to get a fresh session for the next user of
diff --git a/nixos/modules/services/x11/desktop-managers/xfce.nix b/nixos/modules/services/x11/desktop-managers/xfce.nix
index bbfdea2225b..25276e1d649 100644
--- a/nixos/modules/services/x11/desktop-managers/xfce.nix
+++ b/nixos/modules/services/x11/desktop-managers/xfce.nix
@@ -49,7 +49,7 @@ in
       thunarPlugins = mkOption {
         default = [];
         type = types.listOf types.package;
-        example = literalExample "[ pkgs.xfce.thunar-archive-plugin ]";
+        example = literalExpression "[ pkgs.xfce.thunar-archive-plugin ]";
         description = ''
           A list of plugin that should be installed with Thunar.
         '';
diff --git a/nixos/modules/services/x11/desktop-managers/xterm.nix b/nixos/modules/services/x11/desktop-managers/xterm.nix
index f76db278a92..3424ee1b0e1 100644
--- a/nixos/modules/services/x11/desktop-managers/xterm.nix
+++ b/nixos/modules/services/x11/desktop-managers/xterm.nix
@@ -14,8 +14,8 @@ in
 
     services.xserver.desktopManager.xterm.enable = mkOption {
       type = types.bool;
-      default = (versionOlder config.system.stateVersion "19.09") && xSessionEnabled;
-      defaultText = if versionOlder config.system.stateVersion "19.09" then "config.services.xserver.enable" else "false";
+      default = versionOlder config.system.stateVersion "19.09" && xSessionEnabled;
+      defaultText = literalExpression ''versionOlder config.system.stateVersion "19.09" && config.services.xserver.enable;'';
       description = "Enable a xterm terminal as a desktop manager.";
     };
 
diff --git a/nixos/modules/services/x11/display-managers/default.nix b/nixos/modules/services/x11/display-managers/default.nix
index 584dfb63c4d..7fc8db95a48 100644
--- a/nixos/modules/services/x11/display-managers/default.nix
+++ b/nixos/modules/services/x11/display-managers/default.nix
@@ -217,7 +217,7 @@ in
 
       session = mkOption {
         default = [];
-        example = literalExample
+        example = literalExpression
           ''
             [ { manage = "desktop";
                 name = "xterm";
@@ -305,9 +305,7 @@ in
 
         execCmd = mkOption {
           type = types.str;
-          example = literalExample ''
-            "''${pkgs.lightdm}/bin/lightdm"
-          '';
+          example = literalExpression ''"''${pkgs.lightdm}/bin/lightdm"'';
           description = "Command to start the display manager.";
         };
 
diff --git a/nixos/modules/services/x11/display-managers/lightdm-greeters/enso-os.nix b/nixos/modules/services/x11/display-managers/lightdm-greeters/enso-os.nix
index ecd46a9ee6d..930ee96b384 100644
--- a/nixos/modules/services/x11/display-managers/lightdm-greeters/enso-os.nix
+++ b/nixos/modules/services/x11/display-managers/lightdm-greeters/enso-os.nix
@@ -35,7 +35,7 @@ in {
         package = mkOption {
           type = types.package;
           default = pkgs.gnome.gnome-themes-extra;
-          defaultText = "pkgs.gnome.gnome-themes-extra";
+          defaultText = literalExpression "pkgs.gnome.gnome-themes-extra";
           description = ''
             The package path that contains the theme given in the name option.
           '';
@@ -54,7 +54,7 @@ in {
         package = mkOption {
           type = types.package;
           default = pkgs.papirus-icon-theme;
-          defaultText = "pkgs.papirus-icon-theme";
+          defaultText = literalExpression "pkgs.papirus-icon-theme";
           description = ''
             The package path that contains the icon theme given in the name option.
           '';
@@ -73,7 +73,7 @@ in {
         package = mkOption {
           type = types.package;
           default = pkgs.capitaine-cursors;
-          defaultText = "pkgs.capitaine-cursors";
+          defaultText = literalExpression "pkgs.capitaine-cursors";
           description = ''
             The package path that contains the cursor theme given in the name option.
           '';
diff --git a/nixos/modules/services/x11/display-managers/lightdm-greeters/gtk.nix b/nixos/modules/services/x11/display-managers/lightdm-greeters/gtk.nix
index fe5a16bc60f..debd4b568bf 100644
--- a/nixos/modules/services/x11/display-managers/lightdm-greeters/gtk.nix
+++ b/nixos/modules/services/x11/display-managers/lightdm-greeters/gtk.nix
@@ -48,7 +48,7 @@ in
         package = mkOption {
           type = types.package;
           default = pkgs.gnome.gnome-themes-extra;
-          defaultText = "pkgs.gnome.gnome-themes-extra";
+          defaultText = literalExpression "pkgs.gnome.gnome-themes-extra";
           description = ''
             The package path that contains the theme given in the name option.
           '';
@@ -69,7 +69,7 @@ in
         package = mkOption {
           type = types.package;
           default = pkgs.gnome.adwaita-icon-theme;
-          defaultText = "pkgs.gnome.adwaita-icon-theme";
+          defaultText = literalExpression "pkgs.gnome.adwaita-icon-theme";
           description = ''
             The package path that contains the icon theme given in the name option.
           '';
@@ -90,7 +90,7 @@ in
         package = mkOption {
           type = types.package;
           default = pkgs.gnome.adwaita-icon-theme;
-          defaultText = "pkgs.gnome.adwaita-icon-theme";
+          defaultText = literalExpression "pkgs.gnome.adwaita-icon-theme";
           description = ''
             The package path that contains the cursor theme given in the name option.
           '';
diff --git a/nixos/modules/services/x11/display-managers/lightdm.nix b/nixos/modules/services/x11/display-managers/lightdm.nix
index 41c1b635f5d..1c9a5f978c5 100644
--- a/nixos/modules/services/x11/display-managers/lightdm.nix
+++ b/nixos/modules/services/x11/display-managers/lightdm.nix
@@ -148,7 +148,7 @@ in
       background = mkOption {
         type = types.path;
         # Manual cannot depend on packages, we are actually setting the default in config below.
-        defaultText = "pkgs.nixos-artwork.wallpapers.simple-dark-gray-bottom.gnomeFilePath";
+        defaultText = literalExpression "pkgs.nixos-artwork.wallpapers.simple-dark-gray-bottom.gnomeFilePath";
         description = ''
           The background image or color to use.
         '';
diff --git a/nixos/modules/services/x11/display-managers/sddm.nix b/nixos/modules/services/x11/display-managers/sddm.nix
index d79b3cda2fc..5a4fad9c4cb 100644
--- a/nixos/modules/services/x11/display-managers/sddm.nix
+++ b/nixos/modules/services/x11/display-managers/sddm.nix
@@ -113,14 +113,12 @@ in
       settings = mkOption {
         type = iniFmt.type;
         default = { };
-        example = ''
-          {
-            Autologin = {
-              User = "john";
-              Session = "plasma.desktop";
-            };
-          }
-        '';
+        example = {
+          Autologin = {
+            User = "john";
+            Session = "plasma.desktop";
+          };
+        };
         description = ''
           Extra settings merged in and overwritting defaults in sddm.conf.
         '';
diff --git a/nixos/modules/services/x11/extra-layouts.nix b/nixos/modules/services/x11/extra-layouts.nix
index b1c4e04975f..159bed63e13 100644
--- a/nixos/modules/services/x11/extra-layouts.nix
+++ b/nixos/modules/services/x11/extra-layouts.nix
@@ -93,7 +93,7 @@ in
     extraLayouts = mkOption {
       type = types.attrsOf (types.submodule layoutOpts);
       default = {};
-      example = literalExample
+      example = literalExpression
       ''
         {
           mine = {
diff --git a/nixos/modules/services/x11/imwheel.nix b/nixos/modules/services/x11/imwheel.nix
index 51f72dadbd4..ae990141a50 100644
--- a/nixos/modules/services/x11/imwheel.nix
+++ b/nixos/modules/services/x11/imwheel.nix
@@ -21,15 +21,17 @@ in
         rules = mkOption {
           type = types.attrsOf types.str;
           default = {};
-          example = literalExample ''
-            ".*" = '''
-              None,      Up,   Button4, 8
-              None,      Down, Button5, 8
-              Shift_L,   Up,   Shift_L|Button4, 4
-              Shift_L,   Down, Shift_L|Button5, 4
-              Control_L, Up,   Control_L|Button4
-              Control_L, Down, Control_L|Button5
-            ''';
+          example = literalExpression ''
+            {
+              ".*" = '''
+                None,      Up,   Button4, 8
+                None,      Down, Button5, 8
+                Shift_L,   Up,   Shift_L|Button4, 4
+                Shift_L,   Down, Shift_L|Button5, 4
+                Control_L, Up,   Control_L|Button4
+                Control_L, Down, Control_L|Button5
+              ''';
+            }
           '';
           description = ''
             Window class translation rules.
diff --git a/nixos/modules/services/x11/picom.nix b/nixos/modules/services/x11/picom.nix
index 977d0fea219..dbd4b1cefef 100644
--- a/nixos/modules/services/x11/picom.nix
+++ b/nixos/modules/services/x11/picom.nix
@@ -254,7 +254,7 @@ in {
     in mkOption {
       type = topLevel;
       default = { };
-      example = literalExample ''
+      example = literalExpression ''
         blur =
           { method = "gaussian";
             size = 10;
diff --git a/nixos/modules/services/x11/redshift.nix b/nixos/modules/services/x11/redshift.nix
index 60d80a28762..cc9f964754f 100644
--- a/nixos/modules/services/x11/redshift.nix
+++ b/nixos/modules/services/x11/redshift.nix
@@ -76,7 +76,7 @@ in {
     package = mkOption {
       type = types.package;
       default = pkgs.redshift;
-      defaultText = "pkgs.redshift";
+      defaultText = literalExpression "pkgs.redshift";
       description = ''
         redshift derivation to use.
       '';
diff --git a/nixos/modules/services/x11/touchegg.nix b/nixos/modules/services/x11/touchegg.nix
index fab7fac3f01..9d3678e7696 100644
--- a/nixos/modules/services/x11/touchegg.nix
+++ b/nixos/modules/services/x11/touchegg.nix
@@ -16,7 +16,7 @@ in {
     package = mkOption {
       type = types.package;
       default = pkgs.touchegg;
-      defaultText = "pkgs.touchegg";
+      defaultText = literalExpression "pkgs.touchegg";
       description = "touchegg derivation to use.";
     };
   };
diff --git a/nixos/modules/services/x11/unclutter-xfixes.nix b/nixos/modules/services/x11/unclutter-xfixes.nix
index 71262431b68..0b4d06f640d 100644
--- a/nixos/modules/services/x11/unclutter-xfixes.nix
+++ b/nixos/modules/services/x11/unclutter-xfixes.nix
@@ -17,7 +17,7 @@ in {
       description = "unclutter-xfixes derivation to use.";
       type = types.package;
       default = pkgs.unclutter-xfixes;
-      defaultText = "pkgs.unclutter-xfixes";
+      defaultText = literalExpression "pkgs.unclutter-xfixes";
     };
 
     timeout = mkOption {
diff --git a/nixos/modules/services/x11/unclutter.nix b/nixos/modules/services/x11/unclutter.nix
index 56e30c79d1f..bdb5fa7b50c 100644
--- a/nixos/modules/services/x11/unclutter.nix
+++ b/nixos/modules/services/x11/unclutter.nix
@@ -16,7 +16,7 @@ in {
     package = mkOption {
       type = types.package;
       default = pkgs.unclutter;
-      defaultText = "pkgs.unclutter";
+      defaultText = literalExpression "pkgs.unclutter";
       description = "unclutter derivation to use.";
     };
 
diff --git a/nixos/modules/services/x11/urxvtd.nix b/nixos/modules/services/x11/urxvtd.nix
index 867ac38a944..0a0df447f4e 100644
--- a/nixos/modules/services/x11/urxvtd.nix
+++ b/nixos/modules/services/x11/urxvtd.nix
@@ -19,7 +19,7 @@ in {
 
     package = mkOption {
       default = pkgs.rxvt-unicode;
-      defaultText = "pkgs.rxvt-unicode";
+      defaultText = literalExpression "pkgs.rxvt-unicode";
       description = ''
         Package to install. Usually pkgs.rxvt-unicode.
       '';
diff --git a/nixos/modules/services/x11/window-managers/awesome.nix b/nixos/modules/services/x11/window-managers/awesome.nix
index 37a14e34f57..c6c0c934f9a 100644
--- a/nixos/modules/services/x11/window-managers/awesome.nix
+++ b/nixos/modules/services/x11/window-managers/awesome.nix
@@ -27,7 +27,7 @@ in
         default = [];
         type = types.listOf types.package;
         description = "List of lua packages available for being used in the Awesome configuration.";
-        example = literalExample "[ pkgs.luaPackages.vicious ]";
+        example = literalExpression "[ pkgs.luaPackages.vicious ]";
       };
 
       package = mkOption {
diff --git a/nixos/modules/services/x11/window-managers/bspwm.nix b/nixos/modules/services/x11/window-managers/bspwm.nix
index 23cd4f6529a..ade24061a06 100644
--- a/nixos/modules/services/x11/window-managers/bspwm.nix
+++ b/nixos/modules/services/x11/window-managers/bspwm.nix
@@ -14,15 +14,15 @@ in
       package = mkOption {
         type        = types.package;
         default     = pkgs.bspwm;
-        defaultText = "pkgs.bspwm";
-        example     = "pkgs.bspwm-unstable";
+        defaultText = literalExpression "pkgs.bspwm";
+        example     = literalExpression "pkgs.bspwm-unstable";
         description = ''
           bspwm package to use.
         '';
       };
       configFile = mkOption {
         type        = with types; nullOr path;
-        example     = "${pkgs.bspwm}/share/doc/bspwm/examples/bspwmrc";
+        example     = literalExpression ''"''${pkgs.bspwm}/share/doc/bspwm/examples/bspwmrc"'';
         default     = null;
         description = ''
           Path to the bspwm configuration file.
@@ -34,15 +34,15 @@ in
         package = mkOption {
           type        = types.package;
           default     = pkgs.sxhkd;
-          defaultText = "pkgs.sxhkd";
-          example     = "pkgs.sxhkd-unstable";
+          defaultText = literalExpression "pkgs.sxhkd";
+          example     = literalExpression "pkgs.sxhkd-unstable";
           description = ''
             sxhkd package to use.
           '';
         };
         configFile = mkOption {
           type        = with types; nullOr path;
-          example     = "${pkgs.bspwm}/share/doc/bspwm/examples/sxhkdrc";
+          example     = literalExpression ''"''${pkgs.bspwm}/share/doc/bspwm/examples/sxhkdrc"'';
           default     = null;
           description = ''
             Path to the sxhkd configuration file.
diff --git a/nixos/modules/services/x11/window-managers/clfswm.nix b/nixos/modules/services/x11/window-managers/clfswm.nix
index 5015852db69..78772c79974 100644
--- a/nixos/modules/services/x11/window-managers/clfswm.nix
+++ b/nixos/modules/services/x11/window-managers/clfswm.nix
@@ -13,7 +13,7 @@ in
       package = mkOption {
         type        = types.package;
         default     = pkgs.lispPackages.clfswm;
-        defaultText = "pkgs.lispPackages.clfswm";
+        defaultText = literalExpression "pkgs.lispPackages.clfswm";
         description = ''
           clfswm package to use.
         '';
diff --git a/nixos/modules/services/x11/window-managers/exwm.nix b/nixos/modules/services/x11/window-managers/exwm.nix
index 4b707d39849..b505f720f04 100644
--- a/nixos/modules/services/x11/window-managers/exwm.nix
+++ b/nixos/modules/services/x11/window-managers/exwm.nix
@@ -22,7 +22,7 @@ in
       loadScript = mkOption {
         default = "(require 'exwm)";
         type = types.lines;
-        example = literalExample ''
+        example = ''
           (require 'exwm)
           (exwm-enable)
         '';
@@ -39,8 +39,9 @@ in
       };
       extraPackages = mkOption {
         type = types.functionTo (types.listOf types.package);
-        default = self: [];
-        example = literalExample ''
+        default = epkgs: [];
+        defaultText = literalExpression "epkgs: []";
+        example = literalExpression ''
           epkgs: [
             epkgs.emms
             epkgs.magit
diff --git a/nixos/modules/services/x11/window-managers/herbstluftwm.nix b/nixos/modules/services/x11/window-managers/herbstluftwm.nix
index 548097a412d..354d70c695c 100644
--- a/nixos/modules/services/x11/window-managers/herbstluftwm.nix
+++ b/nixos/modules/services/x11/window-managers/herbstluftwm.nix
@@ -14,7 +14,7 @@ in
       package = mkOption {
         type = types.package;
         default = pkgs.herbstluftwm;
-        defaultText = "pkgs.herbstluftwm";
+        defaultText = literalExpression "pkgs.herbstluftwm";
         description = ''
           Herbstluftwm package to use.
         '';
diff --git a/nixos/modules/services/x11/window-managers/i3.nix b/nixos/modules/services/x11/window-managers/i3.nix
index 0ef55d5f2c0..99f9997024f 100644
--- a/nixos/modules/services/x11/window-managers/i3.nix
+++ b/nixos/modules/services/x11/window-managers/i3.nix
@@ -30,8 +30,8 @@ in
     package = mkOption {
       type        = types.package;
       default     = pkgs.i3;
-      defaultText = "pkgs.i3";
-      example     = "pkgs.i3-gaps";
+      defaultText = literalExpression "pkgs.i3";
+      example     = literalExpression "pkgs.i3-gaps";
       description = ''
         i3 package to use.
       '';
@@ -40,7 +40,7 @@ in
     extraPackages = mkOption {
       type = with types; listOf package;
       default = with pkgs; [ dmenu i3status i3lock ];
-      example = literalExample ''
+      defaultText = literalExpression ''
         with pkgs; [
           dmenu
           i3status
diff --git a/nixos/modules/services/x11/window-managers/wmderland.nix b/nixos/modules/services/x11/window-managers/wmderland.nix
index a6864a82771..56b69220965 100644
--- a/nixos/modules/services/x11/window-managers/wmderland.nix
+++ b/nixos/modules/services/x11/window-managers/wmderland.nix
@@ -28,7 +28,7 @@ in
         feh
         rxvt-unicode
       ];
-      example = literalExample ''
+      defaultText = literalExpression ''
         with pkgs; [
           rofi
           dunst
diff --git a/nixos/modules/services/x11/window-managers/xmonad.nix b/nixos/modules/services/x11/window-managers/xmonad.nix
index fe8ed381251..6aa0d5f76f2 100644
--- a/nixos/modules/services/x11/window-managers/xmonad.nix
+++ b/nixos/modules/services/x11/window-managers/xmonad.nix
@@ -2,7 +2,7 @@
 
 with lib;
 let
-  inherit (lib) mkOption mkIf optionals literalExample;
+  inherit (lib) mkOption mkIf optionals literalExpression;
   cfg = config.services.xserver.windowManager.xmonad;
 
   ghcWithPackages = cfg.haskellPackages.ghcWithPackages;
@@ -42,8 +42,8 @@ in {
       enable = mkEnableOption "xmonad";
       haskellPackages = mkOption {
         default = pkgs.haskellPackages;
-        defaultText = "pkgs.haskellPackages";
-        example = literalExample "pkgs.haskell.packages.ghc784";
+        defaultText = literalExpression "pkgs.haskellPackages";
+        example = literalExpression "pkgs.haskell.packages.ghc784";
         description = ''
           haskellPackages used to build Xmonad and other packages.
           This can be used to change the GHC version used to build
@@ -55,8 +55,8 @@ in {
       extraPackages = mkOption {
         type = types.functionTo (types.listOf types.package);
         default = self: [];
-        defaultText = "self: []";
-        example = literalExample ''
+        defaultText = literalExpression "self: []";
+        example = literalExpression ''
           haskellPackages: [
             haskellPackages.xmonad-contrib
             haskellPackages.monad-logger
diff --git a/nixos/modules/services/x11/xautolock.nix b/nixos/modules/services/x11/xautolock.nix
index 5ce08fce7c4..947d8f4edfb 100644
--- a/nixos/modules/services/x11/xautolock.nix
+++ b/nixos/modules/services/x11/xautolock.nix
@@ -27,7 +27,8 @@ in
 
         locker = mkOption {
           default = "${pkgs.xlockmore}/bin/xlock"; # default according to `man xautolock`
-          example = "${pkgs.i3lock}/bin/i3lock -i /path/to/img";
+          defaultText = literalExpression ''"''${pkgs.xlockmore}/bin/xlock"'';
+          example = literalExpression ''"''${pkgs.i3lock}/bin/i3lock -i /path/to/img"'';
           type = types.str;
 
           description = ''
@@ -37,7 +38,7 @@ in
 
         nowlocker = mkOption {
           default = null;
-          example = "${pkgs.i3lock}/bin/i3lock -i /path/to/img";
+          example = literalExpression ''"''${pkgs.i3lock}/bin/i3lock -i /path/to/img"'';
           type = types.nullOr types.str;
 
           description = ''
@@ -56,7 +57,7 @@ in
 
         notifier = mkOption {
           default = null;
-          example = "${pkgs.libnotify}/bin/notify-send \"Locking in 10 seconds\"";
+          example = literalExpression ''"''${pkgs.libnotify}/bin/notify-send 'Locking in 10 seconds'"'';
           type = types.nullOr types.str;
 
           description = ''
diff --git a/nixos/modules/services/x11/xserver.nix b/nixos/modules/services/x11/xserver.nix
index ee190ac3cc4..cb620f10b13 100644
--- a/nixos/modules/services/x11/xserver.nix
+++ b/nixos/modules/services/x11/xserver.nix
@@ -217,7 +217,7 @@ in
       inputClassSections = mkOption {
         type = types.listOf types.lines;
         default = [];
-        example = literalExample ''
+        example = literalExpression ''
           [ '''
               Identifier      "Trackpoint Wheel Emulation"
               MatchProduct    "ThinkPad USB Keyboard with TrackPoint"
@@ -233,7 +233,7 @@ in
       modules = mkOption {
         type = types.listOf types.path;
         default = [];
-        example = literalExample "[ pkgs.xf86_input_wacom ]";
+        example = literalExpression "[ pkgs.xf86_input_wacom ]";
         description = "Packages to be added to the module search path of the X server.";
       };
 
@@ -351,6 +351,7 @@ in
       xkbDir = mkOption {
         type = types.path;
         default = "${pkgs.xkeyboard_config}/etc/X11/xkb";
+        defaultText = literalExpression ''"''${pkgs.xkeyboard_config}/etc/X11/xkb"'';
         description = ''
           Path used for -xkbdir xserver parameter.
         '';