Revert "treewide/nixos: remove `with lib;` part 12"

authored by philiptaron.tngl.sh and committed by GitHub b6b551fe 64688082

+807 -674
+5 -2
nixos/modules/services/x11/colord.nix
··· 4 4 pkgs, 5 5 ... 6 6 }: 7 + 8 + with lib; 9 + 7 10 let 8 11 9 12 cfg = config.services.colord; ··· 14 17 options = { 15 18 16 19 services.colord = { 17 - enable = lib.mkEnableOption "colord, the color management daemon"; 20 + enable = mkEnableOption "colord, the color management daemon"; 18 21 }; 19 22 20 23 }; 21 24 22 - config = lib.mkIf cfg.enable { 25 + config = mkIf cfg.enable { 23 26 24 27 environment.systemPackages = [ pkgs.colord ]; 25 28
+8 -5
nixos/modules/services/x11/desktop-managers/cde.nix
··· 4 4 pkgs, 5 5 ... 6 6 }: 7 + 8 + with lib; 9 + 7 10 let 8 11 xcfg = config.services.xserver; 9 12 cfg = xcfg.desktopManager.cde; 10 13 in 11 14 { 12 15 options.services.xserver.desktopManager.cde = { 13 - enable = lib.mkEnableOption "Common Desktop Environment"; 16 + enable = mkEnableOption "Common Desktop Environment"; 14 17 15 - extraPackages = lib.mkOption { 16 - type = with lib.types; listOf package; 18 + extraPackages = mkOption { 19 + type = with types; listOf package; 17 20 default = with pkgs.xorg; [ 18 21 xclock 19 22 bitmap ··· 26 29 xwd 27 30 xwud 28 31 ]; 29 - defaultText = lib.literalExpression '' 32 + defaultText = literalExpression '' 30 33 with pkgs.xorg; [ 31 34 xclock bitmap xlsfonts xfd xrefresh xload xwininfo xdpyinfo xwd xwud 32 35 ] ··· 37 40 }; 38 41 }; 39 42 40 - config = lib.mkIf (xcfg.enable && cfg.enable) { 43 + config = mkIf (xcfg.enable && cfg.enable) { 41 44 environment.systemPackages = cfg.extraPackages; 42 45 43 46 services.rpcbind.enable = true;
+46 -43
nixos/modules/services/x11/desktop-managers/cinnamon.nix
··· 1 1 { config, lib, pkgs, utils, ... }: 2 + 3 + with lib; 4 + 2 5 let 3 6 4 7 cfg = config.services.xserver.desktopManager.cinnamon; ··· 15 18 { 16 19 options = { 17 20 services.cinnamon = { 18 - apps.enable = lib.mkEnableOption "Cinnamon default applications"; 21 + apps.enable = mkEnableOption "Cinnamon default applications"; 19 22 }; 20 23 21 24 services.xserver.desktopManager.cinnamon = { 22 - enable = lib.mkEnableOption "the cinnamon desktop manager"; 25 + enable = mkEnableOption "the cinnamon desktop manager"; 23 26 24 - sessionPath = lib.mkOption { 27 + sessionPath = mkOption { 25 28 default = []; 26 - type = lib.types.listOf lib.types.package; 27 - example = lib.literalExpression "[ pkgs.gpaste ]"; 29 + type = types.listOf types.package; 30 + example = literalExpression "[ pkgs.gpaste ]"; 28 31 description = '' 29 32 Additional list of packages to be added to the session search path. 30 33 Useful for GSettings-conditional autostart. ··· 33 36 ''; 34 37 }; 35 38 36 - extraGSettingsOverrides = lib.mkOption { 39 + extraGSettingsOverrides = mkOption { 37 40 default = ""; 38 - type = lib.types.lines; 41 + type = types.lines; 39 42 description = "Additional gsettings overrides."; 40 43 }; 41 44 42 - extraGSettingsOverridePackages = lib.mkOption { 45 + extraGSettingsOverridePackages = mkOption { 43 46 default = []; 44 - type = lib.types.listOf lib.types.path; 47 + type = types.listOf types.path; 45 48 description = "List of packages for which gsettings are overridden."; 46 49 }; 47 50 }; 48 51 49 - environment.cinnamon.excludePackages = lib.mkOption { 52 + environment.cinnamon.excludePackages = mkOption { 50 53 default = []; 51 - example = lib.literalExpression "[ pkgs.blueman ]"; 52 - type = lib.types.listOf lib.types.package; 54 + example = literalExpression "[ pkgs.blueman ]"; 55 + type = types.listOf types.package; 53 56 description = "Which packages cinnamon should exclude from the default environment"; 54 57 }; 55 58 56 59 }; 57 60 58 - config = lib.mkMerge [ 59 - (lib.mkIf cfg.enable { 61 + config = mkMerge [ 62 + (mkIf cfg.enable { 60 63 services.displayManager.sessionPackages = [ pkgs.cinnamon-common ]; 61 64 62 65 services.xserver.displayManager.lightdm.greeters.slick = { 63 - enable = lib.mkDefault true; 66 + enable = mkDefault true; 64 67 65 68 # Taken from mint-artwork.gschema.override 66 - theme = lib.mkIf (notExcluded pkgs.mint-themes) { 67 - name = lib.mkDefault "Mint-Y-Aqua"; 68 - package = lib.mkDefault pkgs.mint-themes; 69 + theme = mkIf (notExcluded pkgs.mint-themes) { 70 + name = mkDefault "Mint-Y-Aqua"; 71 + package = mkDefault pkgs.mint-themes; 69 72 }; 70 - iconTheme = lib.mkIf (notExcluded pkgs.mint-y-icons) { 71 - name = lib.mkDefault "Mint-Y-Sand"; 72 - package = lib.mkDefault pkgs.mint-y-icons; 73 + iconTheme = mkIf (notExcluded pkgs.mint-y-icons) { 74 + name = mkDefault "Mint-Y-Sand"; 75 + package = mkDefault pkgs.mint-y-icons; 73 76 }; 74 - cursorTheme = lib.mkIf (notExcluded pkgs.mint-cursor-themes) { 75 - name = lib.mkDefault "Bibata-Modern-Classic"; 76 - package = lib.mkDefault pkgs.mint-cursor-themes; 77 + cursorTheme = mkIf (notExcluded pkgs.mint-cursor-themes) { 78 + name = mkDefault "Bibata-Modern-Classic"; 79 + package = mkDefault pkgs.mint-cursor-themes; 77 80 }; 78 81 }; 79 82 80 83 # Have to take care of GDM + Cinnamon on Wayland users 81 84 environment.extraInit = '' 82 - ${lib.concatMapStrings (p: '' 85 + ${concatMapStrings (p: '' 83 86 if [ -d "${p}/share/gsettings-schemas/${p.name}" ]; then 84 87 export XDG_DATA_DIRS=$XDG_DATA_DIRS''${XDG_DATA_DIRS:+:}${p}/share/gsettings-schemas/${p.name} 85 88 fi ··· 92 95 ''; 93 96 94 97 # Default services 95 - services.blueman.enable = lib.mkDefault (notExcluded pkgs.blueman); 96 - hardware.bluetooth.enable = lib.mkDefault true; 98 + services.blueman.enable = mkDefault (notExcluded pkgs.blueman); 99 + hardware.bluetooth.enable = mkDefault true; 97 100 security.polkit.enable = true; 98 101 services.accounts-daemon.enable = true; 99 - services.system-config-printer.enable = (lib.mkIf config.services.printing.enable (lib.mkDefault true)); 102 + services.system-config-printer.enable = (mkIf config.services.printing.enable (mkDefault true)); 100 103 services.dbus.packages = with pkgs; [ 101 104 cinnamon-common 102 105 cinnamon-screensaver 103 106 nemo-with-extensions 104 107 xapp 105 108 ]; 106 - services.cinnamon.apps.enable = lib.mkDefault true; 109 + services.cinnamon.apps.enable = mkDefault true; 107 110 services.gnome.evolution-data-server.enable = true; 108 111 services.gnome.glib-networking.enable = true; 109 112 services.gnome.gnome-keyring.enable = true; 110 113 services.gvfs.enable = true; 111 - services.power-profiles-daemon.enable = lib.mkDefault true; 112 - services.switcherooControl.enable = lib.mkDefault true; # xapp-gpu-offload-helper 113 - services.touchegg.enable = lib.mkDefault true; 114 + services.power-profiles-daemon.enable = mkDefault true; 115 + services.switcherooControl.enable = mkDefault true; # xapp-gpu-offload-helper 116 + services.touchegg.enable = mkDefault true; 114 117 services.udisks2.enable = true; 115 - services.upower.enable = lib.mkDefault config.powerManagement.enable; 116 - services.libinput.enable = lib.mkDefault true; 118 + services.upower.enable = mkDefault config.powerManagement.enable; 119 + services.libinput.enable = mkDefault true; 117 120 services.xserver.updateDbusEnvironment = true; 118 - networking.networkmanager.enable = lib.mkDefault true; 121 + networking.networkmanager.enable = mkDefault true; 119 122 120 123 # Enable colord server 121 124 services.colord.enable = true; ··· 201 204 pkgs.xdg-desktop-portal-gtk 202 205 ]; 203 206 204 - services.orca.enable = lib.mkDefault (notExcluded pkgs.orca); 207 + services.orca.enable = mkDefault (notExcluded pkgs.orca); 205 208 206 - xdg.portal.configPackages = lib.mkDefault [ pkgs.cinnamon-common ]; 209 + xdg.portal.configPackages = mkDefault [ pkgs.cinnamon-common ]; 207 210 208 211 # Override GSettings schemas 209 212 environment.sessionVariables.NIX_GSETTINGS_OVERRIDES_DIR = "${nixos-gsettings-overrides}/share/gsettings-schemas/nixos-gsettings-overrides/glib-2.0/schemas"; ··· 214 217 ]; 215 218 216 219 # Shell integration for VTE terminals 217 - programs.bash.vteIntegration = lib.mkDefault true; 218 - programs.zsh.vteIntegration = lib.mkDefault true; 220 + programs.bash.vteIntegration = mkDefault true; 221 + programs.zsh.vteIntegration = mkDefault true; 219 222 220 223 # Default Fonts 221 224 fonts.packages = with pkgs; [ ··· 224 227 ]; 225 228 }) 226 229 227 - (lib.mkIf serviceCfg.apps.enable { 228 - programs.gnome-disks.enable = lib.mkDefault (notExcluded pkgs.gnome-disk-utility); 229 - programs.gnome-terminal.enable = lib.mkDefault (notExcluded pkgs.gnome-terminal); 230 - programs.file-roller.enable = lib.mkDefault (notExcluded pkgs.file-roller); 230 + (mkIf serviceCfg.apps.enable { 231 + programs.gnome-disks.enable = mkDefault (notExcluded pkgs.gnome-disk-utility); 232 + programs.gnome-terminal.enable = mkDefault (notExcluded pkgs.gnome-terminal); 233 + programs.file-roller.enable = mkDefault (notExcluded pkgs.file-roller); 231 234 232 235 environment.systemPackages = with pkgs; utils.removePackagesByName [ 233 236 # cinnamon team apps
+30 -27
nixos/modules/services/x11/desktop-managers/deepin.nix
··· 5 5 utils, 6 6 ... 7 7 }: 8 + 9 + with lib; 10 + 8 11 let 9 12 xcfg = config.services.xserver; 10 13 cfg = xcfg.desktopManager.deepin; ··· 18 21 options = { 19 22 20 23 services.xserver.desktopManager.deepin = { 21 - enable = lib.mkEnableOption "Deepin desktop manager"; 22 - extraGSettingsOverrides = lib.mkOption { 24 + enable = mkEnableOption "Deepin desktop manager"; 25 + extraGSettingsOverrides = mkOption { 23 26 default = ""; 24 - type = lib.types.lines; 27 + type = types.lines; 25 28 description = "Additional gsettings overrides."; 26 29 }; 27 - extraGSettingsOverridePackages = lib.mkOption { 30 + extraGSettingsOverridePackages = mkOption { 28 31 default = [ ]; 29 - type = lib.types.listOf lib.types.path; 32 + type = types.listOf types.path; 30 33 description = "List of packages for which gsettings are overridden."; 31 34 }; 32 35 }; 33 36 34 - environment.deepin.excludePackages = lib.mkOption { 37 + environment.deepin.excludePackages = mkOption { 35 38 default = [ ]; 36 - type = lib.types.listOf lib.types.package; 39 + type = types.listOf types.package; 37 40 description = "List of default packages to exclude from the configuration"; 38 41 }; 39 42 40 43 }; 41 44 42 - config = lib.mkIf cfg.enable { 45 + config = mkIf cfg.enable { 43 46 services.displayManager.sessionPackages = [ pkgs.deepin.dde-session ]; 44 - services.displayManager.defaultSession = lib.mkDefault "dde-x11"; 47 + services.displayManager.defaultSession = mkDefault "dde-x11"; 45 48 46 49 # Update the DBus activation environment after launching the desktop manager. 47 50 services.xserver.displayManager.sessionCommands = '' 48 51 ${lib.getBin pkgs.dbus}/bin/dbus-update-activation-environment --systemd --all 49 52 ''; 50 53 51 - hardware.bluetooth.enable = lib.mkDefault true; 54 + hardware.bluetooth.enable = mkDefault true; 52 55 security.polkit.enable = true; 53 56 54 - services.deepin.dde-daemon.enable = lib.mkForce true; 55 - services.deepin.dde-api.enable = lib.mkForce true; 56 - services.deepin.app-services.enable = lib.mkForce true; 57 + services.deepin.dde-daemon.enable = mkForce true; 58 + services.deepin.dde-api.enable = mkForce true; 59 + services.deepin.app-services.enable = mkForce true; 57 60 58 - services.colord.enable = lib.mkDefault true; 59 - services.accounts-daemon.enable = lib.mkDefault true; 60 - services.gvfs.enable = lib.mkDefault true; 61 - services.gnome.glib-networking.enable = lib.mkDefault true; 62 - services.gnome.gnome-keyring.enable = lib.mkDefault true; 63 - services.bamf.enable = lib.mkDefault true; 61 + services.colord.enable = mkDefault true; 62 + services.accounts-daemon.enable = mkDefault true; 63 + services.gvfs.enable = mkDefault true; 64 + services.gnome.glib-networking.enable = mkDefault true; 65 + services.gnome.gnome-keyring.enable = mkDefault true; 66 + services.bamf.enable = mkDefault true; 64 67 65 - services.libinput.enable = lib.mkDefault true; 68 + services.libinput.enable = mkDefault true; 66 69 services.udisks2.enable = true; 67 - services.upower.enable = lib.mkDefault config.powerManagement.enable; 68 - networking.networkmanager.enable = lib.mkDefault true; 69 - programs.dconf.enable = lib.mkDefault true; 70 - programs.gnupg.agent.pinentryPackage = lib.mkDefault pkgs.pinentry-qt; 70 + services.upower.enable = mkDefault config.powerManagement.enable; 71 + networking.networkmanager.enable = mkDefault true; 72 + programs.dconf.enable = mkDefault true; 73 + programs.gnupg.agent.pinentryPackage = mkDefault pkgs.pinentry-qt; 71 74 72 75 fonts.packages = with pkgs; [ noto-fonts ]; 73 76 xdg.mime.enable = true; 74 77 xdg.menus.enable = true; 75 78 xdg.icons.enable = true; 76 - xdg.portal.enable = lib.mkDefault true; 77 - xdg.portal.extraPortals = lib.mkDefault [ 79 + xdg.portal.enable = mkDefault true; 80 + xdg.portal.extraPortals = mkDefault [ 78 81 pkgs.xdg-desktop-portal-gtk 79 82 ]; 80 83 81 84 # https://github.com/NixOS/nixpkgs/pull/247766#issuecomment-1722839259 82 - xdg.portal.config.deepin.default = lib.mkDefault [ "gtk" ]; 85 + xdg.portal.config.deepin.default = mkDefault [ "gtk" ]; 83 86 84 87 environment.sessionVariables = { 85 88 NIX_GSETTINGS_OVERRIDES_DIR = "${nixos-gsettings-overrides}/share/gsettings-schemas/nixos-gsettings-overrides/glib-2.0/schemas";
+9 -6
nixos/modules/services/x11/desktop-managers/enlightenment.nix
··· 4 4 lib, 5 5 ... 6 6 }: 7 + 8 + with lib; 9 + 7 10 let 8 11 9 12 e = pkgs.enlightenment; ··· 20 23 21 24 { 22 25 meta = { 23 - maintainers = lib.teams.enlightenment.members; 26 + maintainers = teams.enlightenment.members; 24 27 }; 25 28 26 29 imports = [ 27 - (lib.mkRenamedOptionModule 30 + (mkRenamedOptionModule 28 31 [ "services" "xserver" "desktopManager" "e19" "enable" ] 29 32 [ "services" "xserver" "desktopManager" "enlightenment" "enable" ] 30 33 ) ··· 32 35 33 36 options = { 34 37 35 - services.xserver.desktopManager.enlightenment.enable = lib.mkOption { 36 - type = lib.types.bool; 38 + services.xserver.desktopManager.enlightenment.enable = mkOption { 39 + type = types.bool; 37 40 default = false; 38 41 description = "Enable the Enlightenment desktop environment."; 39 42 }; 40 43 41 44 }; 42 45 43 - config = lib.mkIf cfg.enable { 46 + config = mkIf cfg.enable { 44 47 45 48 environment.systemPackages = with pkgs; [ 46 49 enlightenment.econnman ··· 102 105 103 106 services.udisks2.enable = true; 104 107 services.upower.enable = config.powerManagement.enable; 105 - services.libinput.enable = lib.mkDefault true; 108 + services.libinput.enable = mkDefault true; 106 109 107 110 services.dbus.packages = [ e.efl ]; 108 111
+7 -4
nixos/modules/services/x11/desktop-managers/kodi.nix
··· 4 4 pkgs, 5 5 ... 6 6 }: 7 + 8 + with lib; 9 + 7 10 let 8 11 cfg = config.services.xserver.desktopManager.kodi; 9 12 in ··· 11 14 { 12 15 options = { 13 16 services.xserver.desktopManager.kodi = { 14 - enable = lib.mkOption { 15 - type = lib.types.bool; 17 + enable = mkOption { 18 + type = types.bool; 16 19 default = false; 17 20 description = "Enable the kodi multimedia center."; 18 21 }; 19 22 20 - package = lib.mkPackageOption pkgs "kodi" { 23 + package = mkPackageOption pkgs "kodi" { 21 24 example = "kodi.withPackages (p: with p; [ jellyfin pvr-iptvsimple vfs-sftp ])"; 22 25 }; 23 26 }; 24 27 }; 25 28 26 - config = lib.mkIf cfg.enable { 29 + config = mkIf cfg.enable { 27 30 services.xserver.desktopManager.session = [ 28 31 { 29 32 name = "kodi";
+7 -4
nixos/modules/services/x11/desktop-managers/lumina.nix
··· 4 4 pkgs, 5 5 ... 6 6 }: 7 + 8 + with lib; 9 + 7 10 let 8 11 9 12 xcfg = config.services.xserver; ··· 13 16 14 17 { 15 18 meta = { 16 - maintainers = lib.teams.lumina.members; 19 + maintainers = teams.lumina.members; 17 20 }; 18 21 19 22 options = { 20 23 21 - services.xserver.desktopManager.lumina.enable = lib.mkOption { 22 - type = lib.types.bool; 24 + services.xserver.desktopManager.lumina.enable = mkOption { 25 + type = types.bool; 23 26 default = false; 24 27 description = "Enable the Lumina desktop manager"; 25 28 }; 26 29 27 30 }; 28 31 29 - config = lib.mkIf cfg.enable { 32 + config = mkIf cfg.enable { 30 33 31 34 services.displayManager.sessionPackages = [ 32 35 pkgs.lumina.lumina
+15 -12
nixos/modules/services/x11/desktop-managers/lxqt.nix
··· 1 1 { config, lib, pkgs, utils, ... }: 2 + 3 + with lib; 4 + 2 5 let 3 6 xcfg = config.services.xserver; 4 7 cfg = xcfg.desktopManager.lxqt; ··· 7 10 8 11 { 9 12 meta = { 10 - maintainers = lib.teams.lxqt.members; 13 + maintainers = teams.lxqt.members; 11 14 }; 12 15 13 16 options = { 14 17 15 - services.xserver.desktopManager.lxqt.enable = lib.mkOption { 16 - type = lib.types.bool; 18 + services.xserver.desktopManager.lxqt.enable = mkOption { 19 + type = types.bool; 17 20 default = false; 18 21 description = "Enable the LXQt desktop manager"; 19 22 }; 20 23 21 - environment.lxqt.excludePackages = lib.mkOption { 24 + environment.lxqt.excludePackages = mkOption { 22 25 default = []; 23 - example = lib.literalExpression "[ pkgs.lxqt.qterminal ]"; 24 - type = lib.types.listOf lib.types.package; 26 + example = literalExpression "[ pkgs.lxqt.qterminal ]"; 27 + type = types.listOf types.package; 25 28 description = "Which LXQt packages to exclude from the default environment"; 26 29 }; 27 30 28 31 }; 29 32 30 - config = lib.mkIf cfg.enable { 33 + config = mkIf cfg.enable { 31 34 32 - services.xserver.desktopManager.session = lib.singleton { 35 + services.xserver.desktopManager.session = singleton { 33 36 name = "lxqt"; 34 37 bgSupport = true; 35 38 start = '' ··· 59 62 # Link some extra directories in /run/current-system/software/share 60 63 environment.pathsToLink = [ "/share" ]; 61 64 62 - programs.gnupg.agent.pinentryPackage = lib.mkDefault pkgs.pinentry-qt; 65 + programs.gnupg.agent.pinentryPackage = mkDefault pkgs.pinentry-qt; 63 66 64 67 # virtual file systems support for PCManFM-QT 65 68 services.gvfs.enable = true; 66 69 67 70 services.upower.enable = config.powerManagement.enable; 68 71 69 - services.libinput.enable = lib.mkDefault true; 72 + services.libinput.enable = mkDefault true; 70 73 71 - xdg.portal.lxqt.enable = lib.mkDefault true; 74 + xdg.portal.lxqt.enable = mkDefault true; 72 75 73 76 # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1050804 74 - xdg.portal.config.lxqt.default = lib.mkDefault [ "lxqt" "gtk" ]; 77 + xdg.portal.config.lxqt.default = mkDefault [ "lxqt" "gtk" ]; 75 78 }; 76 79 77 80 }
+24 -23
nixos/modules/services/x11/desktop-managers/mate.nix
··· 5 5 utils, 6 6 ... 7 7 }: 8 + 9 + with lib; 10 + 8 11 let 9 12 10 13 xcfg = config.services.xserver; ··· 16 19 options = { 17 20 18 21 services.xserver.desktopManager.mate = { 19 - enable = lib.mkOption { 20 - type = lib.types.bool; 22 + enable = mkOption { 23 + type = types.bool; 21 24 default = false; 22 25 description = "Enable the MATE desktop environment"; 23 26 }; 24 27 25 - debug = lib.mkEnableOption "mate-session debug messages"; 28 + debug = mkEnableOption "mate-session debug messages"; 26 29 27 - extraPanelApplets = lib.mkOption { 30 + extraPanelApplets = mkOption { 28 31 default = [ ]; 29 - example = lib.literalExpression "with pkgs.mate; [ mate-applets ]"; 30 - type = lib.types.listOf lib.types.package; 32 + example = literalExpression "with pkgs.mate; [ mate-applets ]"; 33 + type = types.listOf types.package; 31 34 description = "Extra applets to add to mate-panel."; 32 35 }; 33 36 34 - extraCajaExtensions = lib.mkOption { 37 + extraCajaExtensions = mkOption { 35 38 default = [ ]; 36 39 example = lib.literalExpression "with pkgs.mate; [ caja-extensions ]"; 37 - type = lib.types.listOf lib.types.package; 40 + type = types.listOf types.package; 38 41 description = "Extra extensions to add to caja."; 39 42 }; 40 43 41 - enableWaylandSession = lib.mkEnableOption "MATE Wayland session"; 44 + enableWaylandSession = mkEnableOption "MATE Wayland session"; 42 45 }; 43 46 44 - environment.mate.excludePackages = lib.mkOption { 47 + environment.mate.excludePackages = mkOption { 45 48 default = [ ]; 46 - example = lib.literalExpression "[ pkgs.mate.mate-terminal pkgs.mate.pluma ]"; 47 - type = lib.types.listOf lib.types.package; 49 + example = literalExpression "[ pkgs.mate.mate-terminal pkgs.mate.pluma ]"; 50 + type = types.listOf types.package; 48 51 description = "Which MATE packages to exclude from the default environment"; 49 52 }; 50 53 51 54 }; 52 55 53 - config = lib.mkMerge [ 54 - (lib.mkIf (cfg.enable || cfg.enableWaylandSession) { 56 + config = mkMerge [ 57 + (mkIf (cfg.enable || cfg.enableWaylandSession) { 55 58 services.displayManager.sessionPackages = [ 56 59 pkgs.mate.mate-session-manager 57 60 ]; 58 61 59 62 # Debugging 60 - environment.sessionVariables.MATE_SESSION_DEBUG = lib.mkIf cfg.debug "1"; 63 + environment.sessionVariables.MATE_SESSION_DEBUG = mkIf cfg.debug "1"; 61 64 62 65 environment.systemPackages = utils.removePackagesByName ( 63 66 pkgs.mate.basePackages ··· 80 83 81 84 programs.dconf.enable = true; 82 85 # Shell integration for VTE terminals 83 - programs.bash.vteIntegration = lib.mkDefault true; 84 - programs.zsh.vteIntegration = lib.mkDefault true; 86 + programs.bash.vteIntegration = mkDefault true; 87 + programs.zsh.vteIntegration = mkDefault true; 85 88 86 89 # Mate uses this for printing 87 - programs.system-config-printer.enable = ( 88 - lib.mkIf config.services.printing.enable (lib.mkDefault true) 89 - ); 90 + programs.system-config-printer.enable = (mkIf config.services.printing.enable (mkDefault true)); 90 91 91 92 services.gnome.at-spi2-core.enable = true; 92 93 services.gnome.glib-networking.enable = true; ··· 94 95 services.udev.packages = [ pkgs.mate.mate-settings-daemon ]; 95 96 services.gvfs.enable = true; 96 97 services.upower.enable = config.powerManagement.enable; 97 - services.libinput.enable = lib.mkDefault true; 98 + services.libinput.enable = mkDefault true; 98 99 99 100 security.pam.services.mate-screensaver.unixAuth = true; 100 101 101 - xdg.portal.configPackages = lib.mkDefault [ pkgs.mate.mate-desktop ]; 102 + xdg.portal.configPackages = mkDefault [ pkgs.mate.mate-desktop ]; 102 103 103 104 environment.pathsToLink = [ "/share" ]; 104 105 }) 105 - (lib.mkIf cfg.enableWaylandSession { 106 + (mkIf cfg.enableWaylandSession { 106 107 programs.wayfire.enable = true; 107 108 programs.wayfire.plugins = [ pkgs.wayfirePlugins.firedecor ]; 108 109
+6 -5
nixos/modules/services/x11/desktop-managers/none.nix
··· 4 4 pkgs, 5 5 ... 6 6 }: 7 + with lib; 7 8 let 8 9 runXdgAutostart = config.services.xserver.desktopManager.runXdgAutostartIfNone; 9 10 in 10 11 { 11 12 options = { 12 - services.xserver.desktopManager.runXdgAutostartIfNone = lib.mkOption { 13 - type = lib.types.bool; 13 + services.xserver.desktopManager.runXdgAutostartIfNone = mkOption { 14 + type = types.bool; 14 15 default = false; 15 16 description = '' 16 17 Whether to run XDG autostart files for sessions without a desktop manager ··· 26 27 }; 27 28 }; 28 29 29 - config = lib.mkMerge [ 30 + config = mkMerge [ 30 31 { 31 32 services.xserver.desktopManager.session = [ 32 33 { 33 34 name = "none"; 34 - start = lib.optionalString runXdgAutostart '' 35 + start = optionalString runXdgAutostart '' 35 36 /run/current-system/systemd/bin/systemctl --user start xdg-autostart-if-no-desktop-manager.target 36 37 ''; 37 38 } 38 39 ]; 39 40 } 40 - (lib.mkIf runXdgAutostart { 41 + (mkIf runXdgAutostart { 41 42 systemd.user.targets.xdg-autostart-if-no-desktop-manager = { 42 43 description = "Run XDG autostart files"; 43 44 # From `plasma-workspace`, `share/systemd/user/plasma-workspace@.target`.
+53 -50
nixos/modules/services/x11/desktop-managers/pantheon.nix
··· 1 1 { config, lib, utils, pkgs, ... }: 2 + 3 + with lib; 4 + 2 5 let 3 6 4 7 cfg = config.services.xserver.desktopManager.pantheon; ··· 16 19 17 20 meta = { 18 21 doc = ./pantheon.md; 19 - maintainers = lib.teams.pantheon.members; 22 + maintainers = teams.pantheon.members; 20 23 }; 21 24 22 25 options = { ··· 24 27 services.pantheon = { 25 28 26 29 contractor = { 27 - enable = lib.mkEnableOption "contractor, a desktop-wide extension service used by Pantheon"; 30 + enable = mkEnableOption "contractor, a desktop-wide extension service used by Pantheon"; 28 31 }; 29 32 30 - apps.enable = lib.mkEnableOption "Pantheon default applications"; 33 + apps.enable = mkEnableOption "Pantheon default applications"; 31 34 32 35 }; 33 36 34 37 services.xserver.desktopManager.pantheon = { 35 - enable = lib.mkOption { 36 - type = lib.types.bool; 38 + enable = mkOption { 39 + type = types.bool; 37 40 default = false; 38 41 description = "Enable the pantheon desktop manager"; 39 42 }; 40 43 41 - sessionPath = lib.mkOption { 44 + sessionPath = mkOption { 42 45 default = []; 43 - type = lib.types.listOf lib.types.package; 44 - example = lib.literalExpression "[ pkgs.gpaste ]"; 46 + type = types.listOf types.package; 47 + example = literalExpression "[ pkgs.gpaste ]"; 45 48 description = '' 46 49 Additional list of packages to be added to the session search path. 47 50 Useful for GSettings-conditional autostart. ··· 50 53 ''; 51 54 }; 52 55 53 - extraWingpanelIndicators = lib.mkOption { 56 + extraWingpanelIndicators = mkOption { 54 57 default = null; 55 - type = with lib.types; nullOr (listOf package); 58 + type = with types; nullOr (listOf package); 56 59 description = "Indicators to add to Wingpanel."; 57 60 }; 58 61 59 - extraSwitchboardPlugs = lib.mkOption { 62 + extraSwitchboardPlugs = mkOption { 60 63 default = null; 61 - type = with lib.types; nullOr (listOf package); 64 + type = with types; nullOr (listOf package); 62 65 description = "Plugs to add to Switchboard."; 63 66 }; 64 67 65 - extraGSettingsOverrides = lib.mkOption { 68 + extraGSettingsOverrides = mkOption { 66 69 default = ""; 67 - type = lib.types.lines; 70 + type = types.lines; 68 71 description = "Additional gsettings overrides."; 69 72 }; 70 73 71 - extraGSettingsOverridePackages = lib.mkOption { 74 + extraGSettingsOverridePackages = mkOption { 72 75 default = []; 73 - type = lib.types.listOf lib.types.path; 76 + type = types.listOf types.path; 74 77 description = "List of packages for which gsettings are overridden."; 75 78 }; 76 79 77 - debug = lib.mkEnableOption "gnome-session debug messages"; 80 + debug = mkEnableOption "gnome-session debug messages"; 78 81 79 82 }; 80 83 81 - environment.pantheon.excludePackages = lib.mkOption { 84 + environment.pantheon.excludePackages = mkOption { 82 85 default = []; 83 - example = lib.literalExpression "[ pkgs.pantheon.elementary-camera ]"; 84 - type = lib.types.listOf lib.types.package; 86 + example = literalExpression "[ pkgs.pantheon.elementary-camera ]"; 87 + type = types.listOf types.package; 85 88 description = "Which packages pantheon should exclude from the default environment"; 86 89 }; 87 90 88 91 }; 89 92 90 93 91 - config = lib.mkMerge [ 92 - (lib.mkIf cfg.enable { 94 + config = mkMerge [ 95 + (mkIf cfg.enable { 93 96 services.xserver.desktopManager.pantheon.sessionPath = utils.removePackagesByName [ 94 97 pkgs.pantheon.pantheon-agent-geoclue2 95 98 ] config.environment.pantheon.excludePackages; ··· 98 101 99 102 # Ensure lightdm is used when Pantheon is enabled 100 103 # Without it screen locking will be nonfunctional because of the use of lightlocker 101 - warnings = lib.optional (config.services.xserver.displayManager.lightdm.enable != true) 104 + warnings = optional (config.services.xserver.displayManager.lightdm.enable != true) 102 105 '' 103 106 Using Pantheon without LightDM as a displayManager will break screenlocking from the UI. 104 107 ''; 105 108 106 - services.xserver.displayManager.lightdm.greeters.pantheon.enable = lib.mkDefault true; 109 + services.xserver.displayManager.lightdm.greeters.pantheon.enable = mkDefault true; 107 110 108 111 # Without this, elementary LightDM greeter will pre-select non-existent `default` session 109 112 # https://github.com/elementary/greeter/issues/368 110 - services.displayManager.defaultSession = lib.mkDefault "pantheon"; 113 + services.displayManager.defaultSession = mkDefault "pantheon"; 111 114 112 115 services.xserver.displayManager.sessionCommands = '' 113 116 if test "$XDG_CURRENT_DESKTOP" = "Pantheon"; then 114 117 true 115 - ${lib.concatMapStrings (p: '' 118 + ${concatMapStrings (p: '' 116 119 if [ -d "${p}/share/gsettings-schemas/${p.name}" ]; then 117 120 export XDG_DATA_DIRS=$XDG_DATA_DIRS''${XDG_DATA_DIRS:+:}${p}/share/gsettings-schemas/${p.name} 118 121 fi ··· 126 129 ''; 127 130 128 131 # Default services 129 - hardware.bluetooth.enable = lib.mkDefault true; 132 + hardware.bluetooth.enable = mkDefault true; 130 133 security.polkit.enable = true; 131 134 services.accounts-daemon.enable = true; 132 135 services.bamf.enable = true; 133 - services.colord.enable = lib.mkDefault true; 134 - services.fwupd.enable = lib.mkDefault true; 136 + services.colord.enable = mkDefault true; 137 + services.fwupd.enable = mkDefault true; 135 138 # TODO: Enable once #177946 is resolved 136 139 # services.packagekit.enable = mkDefault true; 137 - services.power-profiles-daemon.enable = lib.mkDefault true; 138 - services.touchegg.enable = lib.mkDefault true; 140 + services.power-profiles-daemon.enable = mkDefault true; 141 + services.touchegg.enable = mkDefault true; 139 142 services.touchegg.package = pkgs.pantheon.touchegg; 140 - services.tumbler.enable = lib.mkDefault true; 141 - services.system-config-printer.enable = (lib.mkIf config.services.printing.enable (lib.mkDefault true)); 143 + services.tumbler.enable = mkDefault true; 144 + services.system-config-printer.enable = (mkIf config.services.printing.enable (mkDefault true)); 142 145 services.dbus.packages = with pkgs.pantheon; [ 143 146 switchboard-plug-power 144 147 elementary-default-settings # accountsservice extensions 145 148 ]; 146 - services.pantheon.apps.enable = lib.mkDefault true; 147 - services.pantheon.contractor.enable = lib.mkDefault true; 149 + services.pantheon.apps.enable = mkDefault true; 150 + services.pantheon.contractor.enable = mkDefault true; 148 151 services.gnome.at-spi2-core.enable = true; 149 152 services.gnome.evolution-data-server.enable = true; 150 153 services.gnome.glib-networking.enable = true; 151 154 services.gnome.gnome-keyring.enable = true; 152 155 services.gvfs.enable = true; 153 - services.gnome.rygel.enable = lib.mkDefault true; 156 + services.gnome.rygel.enable = mkDefault true; 154 157 services.udisks2.enable = true; 155 158 services.upower.enable = config.powerManagement.enable; 156 - services.libinput.enable = lib.mkDefault true; 157 - services.switcherooControl.enable = lib.mkDefault true; 159 + services.libinput.enable = mkDefault true; 160 + services.switcherooControl.enable = mkDefault true; 158 161 services.xserver.updateDbusEnvironment = true; 159 - services.zeitgeist.enable = lib.mkDefault true; 160 - services.geoclue2.enable = lib.mkDefault true; 162 + services.zeitgeist.enable = mkDefault true; 163 + services.geoclue2.enable = mkDefault true; 161 164 # pantheon has pantheon-agent-geoclue2 162 165 services.geoclue2.enableDemoAgent = false; 163 166 services.geoclue2.appConfig."io.elementary.desktop.agent-geoclue2" = { ··· 170 173 # https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1443 171 174 pkgs.pantheon.mutter 172 175 ]; 173 - services.orca.enable = lib.mkDefault (notExcluded pkgs.orca); 176 + services.orca.enable = mkDefault (notExcluded pkgs.orca); 174 177 systemd.packages = with pkgs; [ 175 178 gnome-session 176 179 pantheon.gala ··· 178 181 pantheon.elementary-session-settings 179 182 ]; 180 183 programs.dconf.enable = true; 181 - networking.networkmanager.enable = lib.mkDefault true; 184 + networking.networkmanager.enable = mkDefault true; 182 185 183 186 systemd.user.targets."gnome-session-x11-services".wants = [ 184 187 "org.gnome.SettingsDaemon.XSettings.service" ··· 243 246 xdg-desktop-portal-pantheon 244 247 ]); 245 248 246 - xdg.portal.configPackages = lib.mkDefault [ pkgs.pantheon.elementary-default-settings ]; 249 + xdg.portal.configPackages = mkDefault [ pkgs.pantheon.elementary-default-settings ]; 247 250 248 251 # Override GSettings schemas 249 252 environment.sessionVariables.NIX_GSETTINGS_OVERRIDES_DIR = "${nixos-gsettings-desktop-schemas}/share/gsettings-schemas/nixos-gsettings-overrides/glib-2.0/schemas"; 250 253 251 - environment.sessionVariables.GNOME_SESSION_DEBUG = lib.mkIf cfg.debug "1"; 254 + environment.sessionVariables.GNOME_SESSION_DEBUG = mkIf cfg.debug "1"; 252 255 253 256 environment.pathsToLink = [ 254 257 # FIXME: modules should link subdirs of `/share` rather than relying on this ··· 262 265 programs.nm-applet.indicator = false; 263 266 264 267 # Shell integration for VTE terminals 265 - programs.bash.vteIntegration = lib.mkDefault true; 266 - programs.zsh.vteIntegration = lib.mkDefault true; 268 + programs.bash.vteIntegration = mkDefault true; 269 + programs.zsh.vteIntegration = mkDefault true; 267 270 268 271 # Default Fonts 269 272 fonts.packages = with pkgs; [ ··· 279 282 }; 280 283 }) 281 284 282 - (lib.mkIf serviceCfg.apps.enable { 283 - programs.evince.enable = lib.mkDefault (notExcluded pkgs.evince); 284 - programs.file-roller.enable = lib.mkDefault (notExcluded pkgs.file-roller); 285 + (mkIf serviceCfg.apps.enable { 286 + programs.evince.enable = mkDefault (notExcluded pkgs.evince); 287 + programs.file-roller.enable = mkDefault (notExcluded pkgs.file-roller); 285 288 286 289 environment.systemPackages = utils.removePackagesByName ([ 287 290 pkgs.gnome-font-viewer ··· 312 315 ]; 313 316 }) 314 317 315 - (lib.mkIf serviceCfg.contractor.enable { 318 + (mkIf serviceCfg.contractor.enable { 316 319 environment.systemPackages = with pkgs.pantheon; [ 317 320 contractor 318 321 file-roller-contract
+10 -7
nixos/modules/services/x11/desktop-managers/retroarch.nix
··· 4 4 pkgs, 5 5 ... 6 6 }: 7 + 8 + with lib; 9 + 7 10 let 8 11 cfg = config.services.xserver.desktopManager.retroarch; 9 12 10 13 in 11 14 { 12 15 options.services.xserver.desktopManager.retroarch = { 13 - enable = lib.mkEnableOption "RetroArch"; 16 + enable = mkEnableOption "RetroArch"; 14 17 15 - package = lib.mkPackageOption pkgs "retroarch" { 18 + package = mkPackageOption pkgs "retroarch" { 16 19 example = "retroarch-full"; 17 20 }; 18 21 19 - extraArgs = lib.mkOption { 20 - type = lib.types.listOf lib.types.str; 22 + extraArgs = mkOption { 23 + type = types.listOf types.str; 21 24 default = [ ]; 22 25 example = [ 23 26 "--verbose" ··· 27 30 }; 28 31 }; 29 32 30 - config = lib.mkIf cfg.enable { 33 + config = mkIf cfg.enable { 31 34 services.xserver.desktopManager.session = [ 32 35 { 33 36 name = "RetroArch"; 34 37 start = '' 35 - ${cfg.package}/bin/retroarch -f ${lib.escapeShellArgs cfg.extraArgs} & 38 + ${cfg.package}/bin/retroarch -f ${escapeShellArgs cfg.extraArgs} & 36 39 waitPID=$! 37 40 ''; 38 41 } ··· 41 44 environment.systemPackages = [ cfg.package ]; 42 45 }; 43 46 44 - meta.maintainers = with lib.maintainers; [ j0hax ]; 47 + meta.maintainers = with maintainers; [ j0hax ]; 45 48 }
+18 -15
nixos/modules/services/x11/desktop-managers/surf-display.nix
··· 4 4 pkgs, 5 5 ... 6 6 }: 7 + 8 + with lib; 9 + 7 10 let 8 11 cfg = config.services.xserver.desktopManager.surf-display; 9 12 ··· 48 51 { 49 52 options = { 50 53 services.xserver.desktopManager.surf-display = { 51 - enable = lib.mkEnableOption "surf-display as a kiosk browser session"; 54 + enable = mkEnableOption "surf-display as a kiosk browser session"; 52 55 53 - defaultWwwUri = lib.mkOption { 54 - type = lib.types.str; 56 + defaultWwwUri = mkOption { 57 + type = types.str; 55 58 default = "${pkgs.surf-display}/share/surf-display/empty-page.html"; 56 - defaultText = lib.literalExpression ''"''${pkgs.surf-display}/share/surf-display/empty-page.html"''; 59 + defaultText = literalExpression ''"''${pkgs.surf-display}/share/surf-display/empty-page.html"''; 57 60 example = "https://www.example.com/"; 58 61 description = "Default URI to display."; 59 62 }; 60 63 61 - inactivityInterval = lib.mkOption { 62 - type = lib.types.int; 64 + inactivityInterval = mkOption { 65 + type = types.int; 63 66 default = 300; 64 67 example = 0; 65 68 description = '' ··· 72 75 ''; 73 76 }; 74 77 75 - screensaverSettings = lib.mkOption { 76 - type = lib.types.separatedString " "; 78 + screensaverSettings = mkOption { 79 + type = types.separatedString " "; 77 80 default = ""; 78 81 description = '' 79 82 Screensaver settings, see `man 1 xset` for possible options. 80 83 ''; 81 84 }; 82 85 83 - pointerButtonMap = lib.mkOption { 84 - type = lib.types.str; 86 + pointerButtonMap = mkOption { 87 + type = types.str; 85 88 default = "1 0 0 4 5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0"; 86 89 description = '' 87 90 Disable right and middle pointer device click in browser sessions ··· 90 93 ''; 91 94 }; 92 95 93 - hideIdlePointer = lib.mkOption { 94 - type = lib.types.str; 96 + hideIdlePointer = mkOption { 97 + type = types.str; 95 98 default = "yes"; 96 99 example = "no"; 97 100 description = "Hide idle mouse pointer."; 98 101 }; 99 102 100 - extraConfig = lib.mkOption { 101 - type = lib.types.lines; 103 + extraConfig = mkOption { 104 + type = types.lines; 102 105 default = ""; 103 106 example = '' 104 107 # Enforce fixed resolution for all displays (default: not set): ··· 121 124 }; 122 125 }; 123 126 124 - config = lib.mkIf cfg.enable { 127 + config = mkIf cfg.enable { 125 128 services.displayManager.sessionPackages = [ 126 129 pkgs.surf-display 127 130 ];
+34 -31
nixos/modules/services/x11/desktop-managers/xfce.nix
··· 1 1 { config, lib, pkgs, utils, ... }: 2 + 3 + with lib; 4 + 2 5 let 3 6 cfg = config.services.xserver.desktopManager.xfce; 4 7 excludePackages = config.environment.xfce.excludePackages; ··· 6 9 in 7 10 { 8 11 meta = { 9 - maintainers = lib.teams.xfce.members; 12 + maintainers = teams.xfce.members; 10 13 }; 11 14 12 15 imports = [ 13 16 # added 2019-08-18 14 17 # needed to preserve some semblance of UI familarity 15 18 # with original XFCE module 16 - (lib.mkRenamedOptionModule 19 + (mkRenamedOptionModule 17 20 [ "services" "xserver" "desktopManager" "xfce4-14" "extraSessionCommands" ] 18 21 [ "services" "xserver" "displayManager" "sessionCommands" ]) 19 22 20 23 # added 2019-11-04 21 24 # xfce4-14 module removed and promoted to xfce. 22 25 # Needed for configs that used xfce4-14 module to migrate to this one. 23 - (lib.mkRenamedOptionModule 26 + (mkRenamedOptionModule 24 27 [ "services" "xserver" "desktopManager" "xfce4-14" "enable" ] 25 28 [ "services" "xserver" "desktopManager" "xfce" "enable" ]) 26 - (lib.mkRenamedOptionModule 29 + (mkRenamedOptionModule 27 30 [ "services" "xserver" "desktopManager" "xfce4-14" "noDesktop" ] 28 31 [ "services" "xserver" "desktopManager" "xfce" "noDesktop" ]) 29 - (lib.mkRenamedOptionModule 32 + (mkRenamedOptionModule 30 33 [ "services" "xserver" "desktopManager" "xfce4-14" "enableXfwm" ] 31 34 [ "services" "xserver" "desktopManager" "xfce" "enableXfwm" ]) 32 - (lib.mkRenamedOptionModule 35 + (mkRenamedOptionModule 33 36 [ "services" "xserver" "desktopManager" "xfce" "extraSessionCommands" ] 34 37 [ "services" "xserver" "displayManager" "sessionCommands" ]) 35 - (lib.mkRemovedOptionModule [ "services" "xserver" "desktopManager" "xfce" "screenLock" ] "") 38 + (mkRemovedOptionModule [ "services" "xserver" "desktopManager" "xfce" "screenLock" ] "") 36 39 37 40 # added 2022-06-26 38 41 # thunar has its own module 39 - (lib.mkRenamedOptionModule 42 + (mkRenamedOptionModule 40 43 [ "services" "xserver" "desktopManager" "xfce" "thunarPlugins" ] 41 44 [ "programs" "thunar" "plugins" ]) 42 45 ]; 43 46 44 47 options = { 45 48 services.xserver.desktopManager.xfce = { 46 - enable = lib.mkOption { 47 - type = lib.types.bool; 49 + enable = mkOption { 50 + type = types.bool; 48 51 default = false; 49 52 description = "Enable the Xfce desktop environment."; 50 53 }; 51 54 52 - noDesktop = lib.mkOption { 53 - type = lib.types.bool; 55 + noDesktop = mkOption { 56 + type = types.bool; 54 57 default = false; 55 58 description = "Don't install XFCE desktop components (xfdesktop and panel)."; 56 59 }; 57 60 58 - enableXfwm = lib.mkOption { 59 - type = lib.types.bool; 61 + enableXfwm = mkOption { 62 + type = types.bool; 60 63 default = true; 61 64 description = "Enable the XFWM (default) window manager."; 62 65 }; 63 66 64 - enableScreensaver = lib.mkOption { 65 - type = lib.types.bool; 67 + enableScreensaver = mkOption { 68 + type = types.bool; 66 69 default = true; 67 70 description = "Enable the XFCE screensaver."; 68 71 }; 69 72 70 - enableWaylandSession = lib.mkEnableOption "the experimental Xfce Wayland session"; 73 + enableWaylandSession = mkEnableOption "the experimental Xfce Wayland session"; 71 74 72 - waylandSessionCompositor = lib.mkOption { 75 + waylandSessionCompositor = mkOption { 73 76 type = lib.types.str; 74 77 default = ""; 75 78 example = "wayfire"; ··· 84 87 }; 85 88 }; 86 89 87 - environment.xfce.excludePackages = lib.mkOption { 90 + environment.xfce.excludePackages = mkOption { 88 91 default = []; 89 - example = lib.literalExpression "[ pkgs.xfce.xfce4-volumed-pulse ]"; 90 - type = lib.types.listOf lib.types.package; 92 + example = literalExpression "[ pkgs.xfce.xfce4-volumed-pulse ]"; 93 + type = types.listOf types.package; 91 94 description = "Which packages XFCE should exclude from the default environment"; 92 95 }; 93 96 }; 94 97 95 - config = lib.mkIf cfg.enable { 98 + config = mkIf cfg.enable { 96 99 environment.systemPackages = utils.removePackagesByName (with pkgs; [ 97 100 glib # for gsettings 98 101 gtk3.out # gtk-update-icon-cache ··· 144 147 xfce.xfdesktop 145 148 ] ++ lib.optional cfg.enableScreensaver xfce.xfce4-screensaver) excludePackages; 146 149 147 - programs.gnupg.agent.pinentryPackage = lib.mkDefault pkgs.pinentry-gtk2; 150 + programs.gnupg.agent.pinentryPackage = mkDefault pkgs.pinentry-gtk2; 148 151 programs.xfconf.enable = true; 149 152 programs.thunar.enable = true; 150 - programs.labwc.enable = lib.mkDefault (cfg.enableWaylandSession && ( 153 + programs.labwc.enable = mkDefault (cfg.enableWaylandSession && ( 151 154 cfg.waylandSessionCompositor == "" || lib.substring 0 5 cfg.waylandSessionCompositor == "labwc")); 152 155 153 156 environment.pathsToLink = [ ··· 170 173 171 174 # Copied from https://gitlab.xfce.org/xfce/xfce4-session/-/blob/xfce4-session-4.19.2/xfce-wayland.desktop.in 172 175 # to maintain consistent l10n state with X11 session file and to support the waylandSessionCompositor option. 173 - services.displayManager.sessionPackages = lib.optionals cfg.enableWaylandSession [ 176 + services.displayManager.sessionPackages = optionals cfg.enableWaylandSession [ 174 177 ((pkgs.writeTextDir "share/wayland-sessions/xfce-wayland.desktop" '' 175 178 [Desktop Entry] 176 179 Version=1.0 ··· 195 198 services.gnome.glib-networking.enable = true; 196 199 services.gvfs.enable = true; 197 200 services.tumbler.enable = true; 198 - services.system-config-printer.enable = (lib.mkIf config.services.printing.enable (lib.mkDefault true)); 199 - services.libinput.enable = lib.mkDefault true; # used in xfce4-settings-manager 200 - services.colord.enable = lib.mkDefault true; 201 + services.system-config-printer.enable = (mkIf config.services.printing.enable (mkDefault true)); 202 + services.libinput.enable = mkDefault true; # used in xfce4-settings-manager 203 + services.colord.enable = mkDefault true; 201 204 202 205 # Enable default programs 203 206 programs.dconf.enable = true; 204 207 205 208 # Shell integration for VTE terminals 206 - programs.bash.vteIntegration = lib.mkDefault true; 207 - programs.zsh.vteIntegration = lib.mkDefault true; 209 + programs.bash.vteIntegration = mkDefault true; 210 + programs.zsh.vteIntegration = mkDefault true; 208 211 209 212 # Systemd services 210 213 systemd.packages = utils.removePackagesByName (with pkgs.xfce; [ ··· 213 216 214 217 security.pam.services.xfce4-screensaver.unixAuth = cfg.enableScreensaver; 215 218 216 - xdg.portal.configPackages = lib.mkDefault [ pkgs.xfce.xfce4-session ]; 219 + xdg.portal.configPackages = mkDefault [ pkgs.xfce.xfce4-session ]; 217 220 }; 218 221 }
+9 -6
nixos/modules/services/x11/desktop-managers/xterm.nix
··· 4 4 pkgs, 5 5 ... 6 6 }: 7 + 8 + with lib; 9 + 7 10 let 8 11 9 12 cfg = config.services.xserver.desktopManager.xterm; ··· 14 17 { 15 18 options = { 16 19 17 - services.xserver.desktopManager.xterm.enable = lib.mkOption { 18 - type = lib.types.bool; 19 - default = lib.versionOlder config.system.stateVersion "19.09" && xSessionEnabled; 20 - defaultText = lib.literalExpression ''versionOlder config.system.stateVersion "19.09" && config.services.xserver.enable;''; 20 + services.xserver.desktopManager.xterm.enable = mkOption { 21 + type = types.bool; 22 + default = versionOlder config.system.stateVersion "19.09" && xSessionEnabled; 23 + defaultText = literalExpression ''versionOlder config.system.stateVersion "19.09" && config.services.xserver.enable;''; 21 24 description = "Enable a xterm terminal as a desktop manager."; 22 25 }; 23 26 24 27 }; 25 28 26 - config = lib.mkIf cfg.enable { 29 + config = mkIf cfg.enable { 27 30 28 - services.xserver.desktopManager.session = lib.singleton { 31 + services.xserver.desktopManager.session = singleton { 29 32 name = "xterm"; 30 33 start = '' 31 34 ${pkgs.xterm}/bin/xterm -ls &
+28 -26
nixos/modules/services/x11/display-managers/lightdm-greeters/enso-os.nix
··· 4 4 pkgs, 5 5 ... 6 6 }: 7 + 8 + with lib; 7 9 let 8 10 dmcfg = config.services.xserver.displayManager; 9 11 ldmcfg = dmcfg.lightdm; ··· 27 29 { 28 30 options = { 29 31 services.xserver.displayManager.lightdm.greeters.enso = { 30 - enable = lib.mkOption { 31 - type = lib.types.bool; 32 + enable = mkOption { 33 + type = types.bool; 32 34 default = false; 33 35 description = '' 34 36 Whether to enable enso-os-greeter as the lightdm greeter ··· 36 38 }; 37 39 38 40 theme = { 39 - package = lib.mkOption { 40 - type = lib.types.package; 41 + package = mkOption { 42 + type = types.package; 41 43 default = pkgs.gnome-themes-extra; 42 - defaultText = lib.literalExpression "pkgs.gnome-themes-extra"; 44 + defaultText = literalExpression "pkgs.gnome-themes-extra"; 43 45 description = '' 44 46 The package path that contains the theme given in the name option. 45 47 ''; 46 48 }; 47 49 48 - name = lib.mkOption { 49 - type = lib.types.str; 50 + name = mkOption { 51 + type = types.str; 50 52 default = "Adwaita"; 51 53 description = '' 52 54 Name of the theme to use for the lightdm-enso-os-greeter ··· 55 57 }; 56 58 57 59 iconTheme = { 58 - package = lib.mkOption { 59 - type = lib.types.package; 60 + package = mkOption { 61 + type = types.package; 60 62 default = pkgs.papirus-icon-theme; 61 - defaultText = lib.literalExpression "pkgs.papirus-icon-theme"; 63 + defaultText = literalExpression "pkgs.papirus-icon-theme"; 62 64 description = '' 63 65 The package path that contains the icon theme given in the name option. 64 66 ''; 65 67 }; 66 68 67 - name = lib.mkOption { 68 - type = lib.types.str; 69 + name = mkOption { 70 + type = types.str; 69 71 default = "ePapirus"; 70 72 description = '' 71 73 Name of the icon theme to use for the lightdm-enso-os-greeter ··· 74 76 }; 75 77 76 78 cursorTheme = { 77 - package = lib.mkOption { 78 - type = lib.types.package; 79 + package = mkOption { 80 + type = types.package; 79 81 default = pkgs.capitaine-cursors; 80 - defaultText = lib.literalExpression "pkgs.capitaine-cursors"; 82 + defaultText = literalExpression "pkgs.capitaine-cursors"; 81 83 description = '' 82 84 The package path that contains the cursor theme given in the name option. 83 85 ''; 84 86 }; 85 87 86 - name = lib.mkOption { 87 - type = lib.types.str; 88 + name = mkOption { 89 + type = types.str; 88 90 default = "capitane-cursors"; 89 91 description = '' 90 92 Name of the cursor theme to use for the lightdm-enso-os-greeter ··· 92 94 }; 93 95 }; 94 96 95 - blur = lib.mkOption { 96 - type = lib.types.bool; 97 + blur = mkOption { 98 + type = types.bool; 97 99 default = false; 98 100 description = '' 99 101 Whether or not to enable blur 100 102 ''; 101 103 }; 102 104 103 - brightness = lib.mkOption { 104 - type = lib.types.int; 105 + brightness = mkOption { 106 + type = types.int; 105 107 default = 7; 106 108 description = '' 107 109 Brightness 108 110 ''; 109 111 }; 110 112 111 - extraConfig = lib.mkOption { 112 - type = lib.types.lines; 113 + extraConfig = mkOption { 114 + type = types.lines; 113 115 default = ""; 114 116 description = '' 115 117 Extra configuration that should be put in the greeter.conf ··· 119 121 }; 120 122 }; 121 123 122 - config = lib.mkIf (ldmcfg.enable && cfg.enable) { 124 + config = mkIf (ldmcfg.enable && cfg.enable) { 123 125 environment.etc."lightdm/greeter.conf".source = ensoGreeterConf; 124 126 125 127 environment.systemPackages = [ ··· 129 131 ]; 130 132 131 133 services.xserver.displayManager.lightdm = { 132 - greeter = lib.mkDefault { 134 + greeter = mkDefault { 133 135 package = pkgs.lightdm-enso-os-greeter.xgreeters; 134 136 name = "pantheon-greeter"; 135 137 }; 136 138 137 139 greeters = { 138 140 gtk = { 139 - enable = lib.mkDefault false; 141 + enable = mkDefault false; 140 142 }; 141 143 }; 142 144 };
+33 -32
nixos/modules/services/x11/display-managers/lightdm-greeters/gtk.nix
··· 4 4 pkgs, 5 5 ... 6 6 }: 7 + 8 + with lib; 9 + 7 10 let 8 11 9 12 dmcfg = config.services.xserver.displayManager; ··· 24 27 cursor-theme-name = ${cfg.cursorTheme.name} 25 28 cursor-theme-size = ${toString cfg.cursorTheme.size} 26 29 background = ${ldmcfg.background} 27 - ${lib.optionalString (cfg.clock-format != null) "clock-format = ${cfg.clock-format}"} 28 - ${lib.optionalString ( 29 - cfg.indicators != null 30 - ) "indicators = ${lib.concatStringsSep ";" cfg.indicators}"} 31 - ${lib.optionalString (xcfg.dpi != null) "xft-dpi=${toString xcfg.dpi}"} 30 + ${optionalString (cfg.clock-format != null) "clock-format = ${cfg.clock-format}"} 31 + ${optionalString (cfg.indicators != null) "indicators = ${concatStringsSep ";" cfg.indicators}"} 32 + ${optionalString (xcfg.dpi != null) "xft-dpi=${toString xcfg.dpi}"} 32 33 ${cfg.extraConfig} 33 34 ''; 34 35 ··· 38 39 39 40 services.xserver.displayManager.lightdm.greeters.gtk = { 40 41 41 - enable = lib.mkOption { 42 - type = lib.types.bool; 42 + enable = mkOption { 43 + type = types.bool; 43 44 default = true; 44 45 description = '' 45 46 Whether to enable lightdm-gtk-greeter as the lightdm greeter. ··· 48 49 49 50 theme = { 50 51 51 - package = lib.mkOption { 52 - type = lib.types.package; 52 + package = mkOption { 53 + type = types.package; 53 54 default = pkgs.gnome-themes-extra; 54 - defaultText = lib.literalExpression "pkgs.gnome-themes-extra"; 55 + defaultText = literalExpression "pkgs.gnome-themes-extra"; 55 56 description = '' 56 57 The package path that contains the theme given in the name option. 57 58 ''; 58 59 }; 59 60 60 - name = lib.mkOption { 61 - type = lib.types.str; 61 + name = mkOption { 62 + type = types.str; 62 63 default = "Adwaita"; 63 64 description = '' 64 65 Name of the theme to use for the lightdm-gtk-greeter. ··· 69 70 70 71 iconTheme = { 71 72 72 - package = lib.mkOption { 73 - type = lib.types.package; 73 + package = mkOption { 74 + type = types.package; 74 75 default = pkgs.adwaita-icon-theme; 75 - defaultText = lib.literalExpression "pkgs.adwaita-icon-theme"; 76 + defaultText = literalExpression "pkgs.adwaita-icon-theme"; 76 77 description = '' 77 78 The package path that contains the icon theme given in the name option. 78 79 ''; 79 80 }; 80 81 81 - name = lib.mkOption { 82 - type = lib.types.str; 82 + name = mkOption { 83 + type = types.str; 83 84 default = "Adwaita"; 84 85 description = '' 85 86 Name of the icon theme to use for the lightdm-gtk-greeter. ··· 90 91 91 92 cursorTheme = { 92 93 93 - package = lib.mkOption { 94 - type = lib.types.package; 94 + package = mkOption { 95 + type = types.package; 95 96 default = pkgs.adwaita-icon-theme; 96 - defaultText = lib.literalExpression "pkgs.adwaita-icon-theme"; 97 + defaultText = literalExpression "pkgs.adwaita-icon-theme"; 97 98 description = '' 98 99 The package path that contains the cursor theme given in the name option. 99 100 ''; 100 101 }; 101 102 102 - name = lib.mkOption { 103 - type = lib.types.str; 103 + name = mkOption { 104 + type = types.str; 104 105 default = "Adwaita"; 105 106 description = '' 106 107 Name of the cursor theme to use for the lightdm-gtk-greeter. 107 108 ''; 108 109 }; 109 110 110 - size = lib.mkOption { 111 - type = lib.types.int; 111 + size = mkOption { 112 + type = types.int; 112 113 default = 16; 113 114 description = '' 114 115 Size of the cursor theme to use for the lightdm-gtk-greeter. ··· 116 117 }; 117 118 }; 118 119 119 - clock-format = lib.mkOption { 120 - type = lib.types.nullOr lib.types.str; 120 + clock-format = mkOption { 121 + type = types.nullOr types.str; 121 122 default = null; 122 123 example = "%F"; 123 124 description = '' ··· 128 129 ''; 129 130 }; 130 131 131 - indicators = lib.mkOption { 132 - type = lib.types.nullOr (lib.types.listOf lib.types.str); 132 + indicators = mkOption { 133 + type = types.nullOr (types.listOf types.str); 133 134 default = null; 134 135 example = [ 135 136 "~host" ··· 154 155 ''; 155 156 }; 156 157 157 - extraConfig = lib.mkOption { 158 - type = lib.types.lines; 158 + extraConfig = mkOption { 159 + type = types.lines; 159 160 default = ""; 160 161 description = '' 161 162 Extra configuration that should be put in the lightdm-gtk-greeter.conf ··· 167 168 168 169 }; 169 170 170 - config = lib.mkIf (ldmcfg.enable && cfg.enable) { 171 + config = mkIf (ldmcfg.enable && cfg.enable) { 171 172 172 - services.xserver.displayManager.lightdm.greeter = lib.mkDefault { 173 + services.xserver.displayManager.lightdm.greeter = mkDefault { 173 174 package = pkgs.lightdm-gtk-greeter.xgreeters; 174 175 name = "lightdm-gtk-greeter"; 175 176 };
+11 -8
nixos/modules/services/x11/display-managers/lightdm-greeters/mini.nix
··· 4 4 pkgs, 5 5 ... 6 6 }: 7 + 8 + with lib; 9 + 7 10 let 8 11 9 12 dmcfg = config.services.xserver.displayManager; ··· 53 56 54 57 services.xserver.displayManager.lightdm.greeters.mini = { 55 58 56 - enable = lib.mkOption { 57 - type = lib.types.bool; 59 + enable = mkOption { 60 + type = types.bool; 58 61 default = false; 59 62 description = '' 60 63 Whether to enable lightdm-mini-greeter as the lightdm greeter. ··· 65 68 ''; 66 69 }; 67 70 68 - user = lib.mkOption { 69 - type = lib.types.str; 71 + user = mkOption { 72 + type = types.str; 70 73 default = "root"; 71 74 description = '' 72 75 The user to login as. 73 76 ''; 74 77 }; 75 78 76 - extraConfig = lib.mkOption { 77 - type = lib.types.lines; 79 + extraConfig = mkOption { 80 + type = types.lines; 78 81 default = ""; 79 82 description = '' 80 83 Extra configuration that should be put in the lightdm-mini-greeter.conf ··· 86 89 87 90 }; 88 91 89 - config = lib.mkIf (ldmcfg.enable && cfg.enable) { 92 + config = mkIf (ldmcfg.enable && cfg.enable) { 90 93 91 94 services.xserver.displayManager.lightdm.greeters.gtk.enable = false; 92 95 93 - services.xserver.displayManager.lightdm.greeter = lib.mkDefault { 96 + services.xserver.displayManager.lightdm.greeter = mkDefault { 94 97 package = pkgs.lightdm-mini-greeter.xgreeters; 95 98 name = "lightdm-mini-greeter"; 96 99 };
+5 -3
nixos/modules/services/x11/display-managers/lightdm-greeters/mobile.nix
··· 4 4 pkgs, 5 5 ... 6 6 }: 7 + 8 + with lib; 7 9 let 8 10 dmcfg = config.services.xserver.displayManager; 9 11 ldmcfg = dmcfg.lightdm; ··· 12 14 { 13 15 options = { 14 16 services.xserver.displayManager.lightdm.greeters.mobile = { 15 - enable = lib.mkEnableOption "lightdm-mobile-greeter as the lightdm greeter"; 17 + enable = mkEnableOption "lightdm-mobile-greeter as the lightdm greeter"; 16 18 }; 17 19 }; 18 20 19 - config = lib.mkIf (ldmcfg.enable && cfg.enable) { 21 + config = mkIf (ldmcfg.enable && cfg.enable) { 20 22 services.xserver.displayManager.lightdm.greeters.gtk.enable = false; 21 23 22 - services.xserver.displayManager.lightdm.greeter = lib.mkDefault { 24 + services.xserver.displayManager.lightdm.greeter = mkDefault { 23 25 package = pkgs.lightdm-mobile-greeter.xgreeters; 24 26 name = "lightdm-mobile-greeter"; 25 27 };
+7 -4
nixos/modules/services/x11/display-managers/lightdm-greeters/pantheon.nix
··· 4 4 pkgs, 5 5 ... 6 6 }: 7 + 8 + with lib; 9 + 7 10 let 8 11 9 12 dmcfg = config.services.xserver.displayManager; ··· 20 23 21 24 services.xserver.displayManager.lightdm.greeters.pantheon = { 22 25 23 - enable = lib.mkOption { 24 - type = lib.types.bool; 26 + enable = mkOption { 27 + type = types.bool; 25 28 default = false; 26 29 description = '' 27 30 Whether to enable elementary-greeter as the lightdm greeter. ··· 32 35 33 36 }; 34 37 35 - config = lib.mkIf (ldmcfg.enable && cfg.enable) { 38 + config = mkIf (ldmcfg.enable && cfg.enable) { 36 39 37 40 services.xserver.displayManager.lightdm.greeters.gtk.enable = false; 38 41 39 - services.xserver.displayManager.lightdm.greeter = lib.mkDefault { 42 + services.xserver.displayManager.lightdm.greeter = mkDefault { 40 43 package = pkgs.pantheon.elementary-greeter.xgreeters; 41 44 name = "io.elementary.greeter"; 42 45 };
+32 -29
nixos/modules/services/x11/display-managers/lightdm-greeters/slick.nix
··· 4 4 pkgs, 5 5 ... 6 6 }: 7 + 8 + with lib; 9 + 7 10 let 8 11 ldmcfg = config.services.xserver.displayManager.lightdm; 9 12 cfg = ldmcfg.greeters.slick; ··· 23 26 font-name=${cfg.font.name} 24 27 cursor-theme-name=${cfg.cursorTheme.name} 25 28 cursor-theme-size=${toString cfg.cursorTheme.size} 26 - draw-user-backgrounds=${lib.boolToString cfg.draw-user-backgrounds} 29 + draw-user-backgrounds=${boolToString cfg.draw-user-backgrounds} 27 30 ${cfg.extraConfig} 28 31 ''; 29 32 in 30 33 { 31 34 options = { 32 35 services.xserver.displayManager.lightdm.greeters.slick = { 33 - enable = lib.mkEnableOption "lightdm-slick-greeter as the lightdm greeter"; 36 + enable = mkEnableOption "lightdm-slick-greeter as the lightdm greeter"; 34 37 35 38 theme = { 36 - package = lib.mkOption { 37 - type = lib.types.package; 39 + package = mkOption { 40 + type = types.package; 38 41 default = pkgs.gnome-themes-extra; 39 - defaultText = lib.literalExpression "pkgs.gnome-themes-extra"; 42 + defaultText = literalExpression "pkgs.gnome-themes-extra"; 40 43 description = '' 41 44 The package path that contains the theme given in the name option. 42 45 ''; 43 46 }; 44 47 45 - name = lib.mkOption { 46 - type = lib.types.str; 48 + name = mkOption { 49 + type = types.str; 47 50 default = "Adwaita"; 48 51 description = '' 49 52 Name of the theme to use for the lightdm-slick-greeter. ··· 52 55 }; 53 56 54 57 iconTheme = { 55 - package = lib.mkOption { 56 - type = lib.types.package; 58 + package = mkOption { 59 + type = types.package; 57 60 default = pkgs.adwaita-icon-theme; 58 - defaultText = lib.literalExpression "pkgs.adwaita-icon-theme"; 61 + defaultText = literalExpression "pkgs.adwaita-icon-theme"; 59 62 description = '' 60 63 The package path that contains the icon theme given in the name option. 61 64 ''; 62 65 }; 63 66 64 - name = lib.mkOption { 65 - type = lib.types.str; 67 + name = mkOption { 68 + type = types.str; 66 69 default = "Adwaita"; 67 70 description = '' 68 71 Name of the icon theme to use for the lightdm-slick-greeter. ··· 71 74 }; 72 75 73 76 font = { 74 - package = lib.mkOption { 75 - type = lib.types.package; 77 + package = mkOption { 78 + type = types.package; 76 79 default = pkgs.ubuntu-classic; 77 - defaultText = lib.literalExpression "pkgs.ubuntu-classic"; 80 + defaultText = literalExpression "pkgs.ubuntu-classic"; 78 81 description = '' 79 82 The package path that contains the font given in the name option. 80 83 ''; 81 84 }; 82 85 83 - name = lib.mkOption { 84 - type = lib.types.str; 86 + name = mkOption { 87 + type = types.str; 85 88 default = "Ubuntu 11"; 86 89 description = '' 87 90 Name of the font to use. ··· 90 93 }; 91 94 92 95 cursorTheme = { 93 - package = lib.mkOption { 94 - type = lib.types.package; 96 + package = mkOption { 97 + type = types.package; 95 98 default = pkgs.adwaita-icon-theme; 96 - defaultText = lib.literalExpression "pkgs.adwaita-icon-theme"; 99 + defaultText = literalExpression "pkgs.adwaita-icon-theme"; 97 100 description = '' 98 101 The package path that contains the cursor theme given in the name option. 99 102 ''; 100 103 }; 101 104 102 - name = lib.mkOption { 103 - type = lib.types.str; 105 + name = mkOption { 106 + type = types.str; 104 107 default = "Adwaita"; 105 108 description = '' 106 109 Name of the cursor theme to use for the lightdm-slick-greeter. 107 110 ''; 108 111 }; 109 112 110 - size = lib.mkOption { 111 - type = lib.types.int; 113 + size = mkOption { 114 + type = types.int; 112 115 default = 24; 113 116 description = '' 114 117 Size of the cursor theme to use for the lightdm-slick-greeter. ··· 116 119 }; 117 120 }; 118 121 119 - draw-user-backgrounds = lib.mkEnableOption "draw user backgrounds"; 122 + draw-user-backgrounds = mkEnableOption "draw user backgrounds"; 120 123 121 - extraConfig = lib.mkOption { 122 - type = lib.types.lines; 124 + extraConfig = mkOption { 125 + type = types.lines; 123 126 default = ""; 124 127 description = '' 125 128 Extra configuration that should be put in the lightdm-slick-greeter.conf ··· 129 132 }; 130 133 }; 131 134 132 - config = lib.mkIf (ldmcfg.enable && cfg.enable) { 135 + config = mkIf (ldmcfg.enable && cfg.enable) { 133 136 services.xserver.displayManager.lightdm = { 134 137 greeters.gtk.enable = false; 135 - greeter = lib.mkDefault { 138 + greeter = mkDefault { 136 139 package = pkgs.lightdm-slick-greeter.xgreeters; 137 140 name = "lightdm-slick-greeter"; 138 141 };
+14 -11
nixos/modules/services/x11/display-managers/lightdm-greeters/tiny.nix
··· 4 4 pkgs, 5 5 ... 6 6 }: 7 + 8 + with lib; 9 + 7 10 let 8 11 9 12 dmcfg = config.services.xserver.displayManager; ··· 16 19 17 20 services.xserver.displayManager.lightdm.greeters.tiny = { 18 21 19 - enable = lib.mkOption { 20 - type = lib.types.bool; 22 + enable = mkOption { 23 + type = types.bool; 21 24 default = false; 22 25 description = '' 23 26 Whether to enable lightdm-tiny-greeter as the lightdm greeter. ··· 29 32 }; 30 33 31 34 label = { 32 - user = lib.mkOption { 33 - type = lib.types.str; 35 + user = mkOption { 36 + type = types.str; 34 37 default = "Username"; 35 38 description = '' 36 39 The string to represent the user_text label. 37 40 ''; 38 41 }; 39 42 40 - pass = lib.mkOption { 41 - type = lib.types.str; 43 + pass = mkOption { 44 + type = types.str; 42 45 default = "Password"; 43 46 description = '' 44 47 The string to represent the pass_text label. ··· 46 49 }; 47 50 }; 48 51 49 - extraConfig = lib.mkOption { 50 - type = lib.types.lines; 52 + extraConfig = mkOption { 53 + type = types.lines; 51 54 default = ""; 52 55 description = '' 53 56 Section to describe style and ui. ··· 58 61 59 62 }; 60 63 61 - config = lib.mkIf (ldmcfg.enable && cfg.enable) { 64 + config = mkIf (ldmcfg.enable && cfg.enable) { 62 65 63 66 services.xserver.displayManager.lightdm.greeters.gtk.enable = false; 64 67 ··· 70 73 static const char *pass_text = "${cfg.label.pass}"; 71 74 static const char *session = "${dmcfg.defaultSession}"; 72 75 ''; 73 - config = lib.optionalString (cfg.extraConfig != "") (configHeader + cfg.extraConfig); 76 + config = optionalString (cfg.extraConfig != "") (configHeader + cfg.extraConfig); 74 77 package = pkgs.lightdm-tiny-greeter.override { conf = config; }; 75 78 in 76 - lib.mkDefault { 79 + mkDefault { 77 80 package = package.xgreeters; 78 81 name = "lightdm-tiny-greeter"; 79 82 };
+31 -28
nixos/modules/services/x11/display-managers/lightdm.nix
··· 4 4 pkgs, 5 5 ... 6 6 }: 7 + 8 + with lib; 9 + 7 10 let 8 11 9 12 xcfg = config.services.xserver; ··· 19 22 # lightdm runs with clearenv(), but we need a few things in the environment for X to startup 20 23 xserverWrapper = writeScript "xserver-wrapper" '' 21 24 #! ${pkgs.bash}/bin/bash 22 - ${lib.concatMapStrings (n: "export ${n}=\"${lib.getAttr n xEnv}\"\n") (lib.attrNames xEnv)} 25 + ${concatMapStrings (n: "export ${n}=\"${getAttr n xEnv}\"\n") (attrNames xEnv)} 23 26 24 27 display=$(echo "$@" | xargs -n 1 | grep -P ^:\\d\$ | head -n 1 | sed s/^://) 25 28 if [ -z "$display" ] ··· 33 36 usersConf = writeText "users.conf" '' 34 37 [UserList] 35 38 minimum-uid=1000 36 - hidden-users=${lib.concatStringsSep " " dmcfg.hiddenUsers} 39 + hidden-users=${concatStringsSep " " dmcfg.hiddenUsers} 37 40 hidden-shells=/run/current-system/sw/bin/nologin 38 41 ''; 39 42 40 43 lightdmConf = writeText "lightdm.conf" '' 41 44 [LightDM] 42 - ${lib.optionalString cfg.greeter.enable '' 45 + ${optionalString cfg.greeter.enable '' 43 46 greeter-user = ${config.users.users.lightdm.name} 44 47 greeters-directory = ${cfg.greeter.package} 45 48 ''} ··· 49 52 [Seat:*] 50 53 xserver-command = ${xserverWrapper} 51 54 session-wrapper = ${dmcfg.sessionData.wrapper} 52 - ${lib.optionalString cfg.greeter.enable '' 55 + ${optionalString cfg.greeter.enable '' 53 56 greeter-session = ${cfg.greeter.name} 54 57 ''} 55 - ${lib.optionalString dmcfg.autoLogin.enable '' 58 + ${optionalString dmcfg.autoLogin.enable '' 56 59 autologin-user = ${dmcfg.autoLogin.user} 57 60 autologin-user-timeout = ${toString cfg.autoLogin.timeout} 58 61 autologin-session = ${sessionData.autologinSession} 59 62 ''} 60 - ${lib.optionalString (xcfg.displayManager.setupCommands != "") '' 63 + ${optionalString (xcfg.displayManager.setupCommands != "") '' 61 64 display-setup-script=${pkgs.writeScript "lightdm-display-setup" '' 62 65 #!${pkgs.bash}/bin/bash 63 66 ${xcfg.displayManager.setupCommands} ··· 84 87 ./lightdm-greeters/tiny.nix 85 88 ./lightdm-greeters/slick.nix 86 89 ./lightdm-greeters/mobile.nix 87 - (lib.mkRenamedOptionModule 90 + (mkRenamedOptionModule 88 91 [ "services" "xserver" "displayManager" "lightdm" "autoLogin" "enable" ] 89 92 [ 90 93 "services" ··· 93 96 "enable" 94 97 ] 95 98 ) 96 - (lib.mkRenamedOptionModule 99 + (mkRenamedOptionModule 97 100 [ "services" "xserver" "displayManager" "lightdm" "autoLogin" "user" ] 98 101 [ 99 102 "services" ··· 108 111 109 112 services.xserver.displayManager.lightdm = { 110 113 111 - enable = lib.mkOption { 112 - type = lib.types.bool; 114 + enable = mkOption { 115 + type = types.bool; 113 116 default = false; 114 117 description = '' 115 118 Whether to enable lightdm as the display manager. ··· 117 120 }; 118 121 119 122 greeter = { 120 - enable = lib.mkOption { 121 - type = lib.types.bool; 123 + enable = mkOption { 124 + type = types.bool; 122 125 default = true; 123 126 description = '' 124 127 If set to false, run lightdm in greeterless mode. This only works if autologin 125 128 is enabled and autoLogin.timeout is zero. 126 129 ''; 127 130 }; 128 - package = lib.mkOption { 129 - type = lib.types.package; 131 + package = mkOption { 132 + type = types.package; 130 133 description = '' 131 134 The LightDM greeter to login via. The package should be a directory 132 135 containing a .desktop file matching the name in the 'name' option. 133 136 ''; 134 137 135 138 }; 136 - name = lib.mkOption { 137 - type = lib.types.str; 139 + name = mkOption { 140 + type = types.str; 138 141 description = '' 139 142 The name of a .desktop file in the directory specified 140 143 in the 'package' option. ··· 142 145 }; 143 146 }; 144 147 145 - extraConfig = lib.mkOption { 146 - type = lib.types.lines; 148 + extraConfig = mkOption { 149 + type = types.lines; 147 150 default = ""; 148 151 example = '' 149 152 user-authority-in-system-dir = true ··· 151 154 description = "Extra lines to append to LightDM section."; 152 155 }; 153 156 154 - background = lib.mkOption { 155 - type = lib.types.either lib.types.path (lib.types.strMatching "^#[0-9]\{6\}$"); 157 + background = mkOption { 158 + type = types.either types.path (types.strMatching "^#[0-9]\{6\}$"); 156 159 # Manual cannot depend on packages, we are actually setting the default in config below. 157 - defaultText = lib.literalExpression "pkgs.nixos-artwork.wallpapers.simple-dark-gray-bottom.gnomeFilePath"; 160 + defaultText = literalExpression "pkgs.nixos-artwork.wallpapers.simple-dark-gray-bottom.gnomeFilePath"; 158 161 description = '' 159 162 The background image or color to use. 160 163 ''; 161 164 }; 162 165 163 - extraSeatDefaults = lib.mkOption { 164 - type = lib.types.lines; 166 + extraSeatDefaults = mkOption { 167 + type = types.lines; 165 168 default = ""; 166 169 example = '' 167 170 greeter-show-manual-login=true ··· 170 173 }; 171 174 172 175 # Configuration for automatic login specific to LightDM 173 - autoLogin.timeout = lib.mkOption { 174 - type = lib.types.int; 176 + autoLogin.timeout = mkOption { 177 + type = types.int; 175 178 default = 0; 176 179 description = '' 177 180 Show the greeter for this many seconds before automatic login occurs. ··· 181 184 }; 182 185 }; 183 186 184 - config = lib.mkIf cfg.enable { 187 + config = mkIf cfg.enable { 185 188 186 189 assertions = [ 187 190 { ··· 207 210 208 211 # Keep in sync with the defaultText value from the option definition. 209 212 services.xserver.displayManager.lightdm.background = 210 - lib.mkDefault pkgs.nixos-artwork.wallpapers.simple-dark-gray-bottom.gnomeFilePath; 213 + mkDefault pkgs.nixos-artwork.wallpapers.simple-dark-gray-bottom.gnomeFilePath; 211 214 212 215 # Set default session in session chooser to a specified values – basically ignore session history. 213 216 # Auto-login is already covered by a config value. 214 217 services.displayManager.preStart = 215 - lib.optionalString (!dmcfg.autoLogin.enable && dmcfg.defaultSession != null) 218 + optionalString (!dmcfg.autoLogin.enable && dmcfg.defaultSession != null) 216 219 '' 217 220 ${setSessionScript}/bin/set-session ${dmcfg.defaultSession} 218 221 '';
+4 -1
nixos/modules/services/x11/display-managers/slim.nix
··· 4 4 pkgs, 5 5 ... 6 6 }: 7 + 8 + with lib; 9 + 7 10 { 8 11 # added 2019-11-11 9 12 imports = [ 10 - (lib.mkRemovedOptionModule [ "services" "xserver" "displayManager" "slim" ] '' 13 + (mkRemovedOptionModule [ "services" "xserver" "displayManager" "slim" ] '' 11 14 The SLIM project is abandoned and their last release was in 2013. 12 15 Because of this it poses a security risk to your system. 13 16 Other issues include it not fully supporting systemd and logind sessions.
+7 -4
nixos/modules/services/x11/display-managers/startx.nix
··· 4 4 pkgs, 5 5 ... 6 6 }: 7 + 8 + with lib; 9 + 7 10 let 8 11 9 12 cfg = config.services.xserver.displayManager.startx; ··· 16 19 17 20 options = { 18 21 services.xserver.displayManager.startx = { 19 - enable = lib.mkOption { 20 - type = lib.types.bool; 22 + enable = mkOption { 23 + type = types.bool; 21 24 default = false; 22 25 description = '' 23 26 Whether to enable the dummy "startx" pseudo-display manager, ··· 33 36 34 37 ###### implementation 35 38 36 - config = lib.mkIf cfg.enable { 39 + config = mkIf cfg.enable { 37 40 services.xserver = { 38 41 exportConfiguration = true; 39 42 }; ··· 43 46 # 44 47 # To send log to Xorg's default log location ($XDG_DATA_HOME/xorg/), we do 45 48 # not specify a log file when running X 46 - services.xserver.logFile = lib.mkDefault null; 49 + services.xserver.logFile = mkDefault null; 47 50 48 51 # Implement xserverArgs via xinit's system-wide xserverrc 49 52 environment.etc."X11/xinit/xserverrc".source = pkgs.writeShellScript "xserverrc" ''
+22 -19
nixos/modules/services/x11/display-managers/xpra.nix
··· 1 1 { config, lib, pkgs, ... }: 2 + 3 + with lib; 4 + 2 5 let 3 6 cfg = config.services.xserver.displayManager.xpra; 4 7 dmcfg = config.services.xserver.displayManager; ··· 10 13 11 14 options = { 12 15 services.xserver.displayManager.xpra = { 13 - enable = lib.mkOption { 14 - type = lib.types.bool; 16 + enable = mkOption { 17 + type = types.bool; 15 18 default = false; 16 19 description = "Whether to enable xpra as display manager."; 17 20 }; 18 21 19 - bindTcp = lib.mkOption { 22 + bindTcp = mkOption { 20 23 default = "127.0.0.1:10000"; 21 24 example = "0.0.0.0:10000"; 22 - type = lib.types.nullOr lib.types.str; 25 + type = types.nullOr types.str; 23 26 description = "Bind xpra to TCP"; 24 27 }; 25 28 26 - desktop = lib.mkOption { 27 - type = lib.types.nullOr lib.types.str; 29 + desktop = mkOption { 30 + type = types.nullOr types.str; 28 31 default = null; 29 32 example = "gnome-shell"; 30 33 description = "Start a desktop environment instead of seamless mode"; 31 34 }; 32 35 33 - auth = lib.mkOption { 34 - type = lib.types.str; 36 + auth = mkOption { 37 + type = types.str; 35 38 default = "pam"; 36 39 example = "password:value=mysecret"; 37 40 description = "Authentication to use when connecting to xpra"; 38 41 }; 39 42 40 - pulseaudio = lib.mkEnableOption "pulseaudio audio streaming"; 43 + pulseaudio = mkEnableOption "pulseaudio audio streaming"; 41 44 42 - extraOptions = lib.mkOption { 45 + extraOptions = mkOption { 43 46 description = "Extra xpra options"; 44 47 default = []; 45 - type = lib.types.listOf lib.types.str; 48 + type = types.listOf types.str; 46 49 }; 47 50 }; 48 51 }; 49 52 50 53 ###### implementation 51 54 52 - config = lib.mkIf cfg.enable { 55 + config = mkIf cfg.enable { 53 56 services.xserver.videoDrivers = ["dummy"]; 54 57 55 58 services.xserver.monitorSection = '' ··· 224 227 ''; 225 228 226 229 services.displayManager.execCmd = '' 227 - ${lib.optionalString (cfg.pulseaudio) 230 + ${optionalString (cfg.pulseaudio) 228 231 "export PULSE_COOKIE=/run/pulse/.config/pulse/cookie"} 229 232 exec ${pkgs.xpra}/bin/xpra ${if cfg.desktop == null then "start" else "start-desktop --start=${cfg.desktop}"} \ 230 233 --daemon=off \ ··· 236 239 --speaker=yes \ 237 240 --mdns=no \ 238 241 --pulseaudio=no \ 239 - ${lib.optionalString (cfg.pulseaudio) "--sound-source=pulse"} \ 242 + ${optionalString (cfg.pulseaudio) "--sound-source=pulse"} \ 240 243 --socket-dirs=/run/xpra \ 241 - --xvfb="xpra_Xdummy ${lib.concatStringsSep " " dmcfg.xserverArgs}" \ 242 - ${lib.optionalString (cfg.bindTcp != null) "--bind-tcp=${cfg.bindTcp}"} \ 244 + --xvfb="xpra_Xdummy ${concatStringsSep " " dmcfg.xserverArgs}" \ 245 + ${optionalString (cfg.bindTcp != null) "--bind-tcp=${cfg.bindTcp}"} \ 243 246 --auth=${cfg.auth} \ 244 - ${lib.concatStringsSep " " cfg.extraOptions} 247 + ${concatStringsSep " " cfg.extraOptions} 245 248 ''; 246 249 247 250 services.xserver.terminateOnReset = false; 248 251 249 252 environment.systemPackages = [pkgs.xpra]; 250 253 251 - services.pulseaudio.enable = lib.mkDefault cfg.pulseaudio; 252 - services.pulseaudio.systemWide = lib.mkDefault cfg.pulseaudio; 254 + services.pulseaudio.enable = mkDefault cfg.pulseaudio; 255 + services.pulseaudio.systemWide = mkDefault cfg.pulseaudio; 253 256 }; 254 257 255 258 }
+21 -18
nixos/modules/services/x11/extra-layouts.nix
··· 4 4 pkgs, 5 5 ... 6 6 }: 7 + 8 + with lib; 9 + 7 10 let 8 11 layouts = config.services.xserver.xkb.extraLayouts; 9 12 10 13 layoutOpts = { 11 14 options = { 12 - description = lib.mkOption { 13 - type = lib.types.str; 15 + description = mkOption { 16 + type = types.str; 14 17 description = "A short description of the layout."; 15 18 }; 16 19 17 - languages = lib.mkOption { 18 - type = lib.types.listOf lib.types.str; 20 + languages = mkOption { 21 + type = types.listOf types.str; 19 22 description = '' 20 23 A list of languages provided by the layout. 21 24 (Use ISO 639-2 codes, for example: "eng" for english) 22 25 ''; 23 26 }; 24 27 25 - compatFile = lib.mkOption { 26 - type = lib.types.nullOr lib.types.path; 28 + compatFile = mkOption { 29 + type = types.nullOr types.path; 27 30 default = null; 28 31 description = '' 29 32 The path to the xkb compat file. ··· 33 36 ''; 34 37 }; 35 38 36 - geometryFile = lib.mkOption { 37 - type = lib.types.nullOr lib.types.path; 39 + geometryFile = mkOption { 40 + type = types.nullOr types.path; 38 41 default = null; 39 42 description = '' 40 43 The path to the xkb geometry file. ··· 44 47 ''; 45 48 }; 46 49 47 - keycodesFile = lib.mkOption { 48 - type = lib.types.nullOr lib.types.path; 50 + keycodesFile = mkOption { 51 + type = types.nullOr types.path; 49 52 default = null; 50 53 description = '' 51 54 The path to the xkb keycodes file. ··· 55 58 ''; 56 59 }; 57 60 58 - symbolsFile = lib.mkOption { 59 - type = lib.types.nullOr lib.types.path; 61 + symbolsFile = mkOption { 62 + type = types.nullOr types.path; 60 63 default = null; 61 64 description = '' 62 65 The path to the xkb symbols file. ··· 66 69 ''; 67 70 }; 68 71 69 - typesFile = lib.mkOption { 70 - type = lib.types.nullOr lib.types.path; 72 + typesFile = mkOption { 73 + type = types.nullOr types.path; 71 74 default = null; 72 75 description = '' 73 76 The path to the xkb types file. ··· 108 111 ###### interface 109 112 110 113 options.services.xserver.xkb = { 111 - extraLayouts = lib.mkOption { 112 - type = lib.types.attrsOf (lib.types.submodule layoutOpts); 114 + extraLayouts = mkOption { 115 + type = types.attrsOf (types.submodule layoutOpts); 113 116 default = { }; 114 - example = lib.literalExpression '' 117 + example = literalExpression '' 115 118 { 116 119 mine = { 117 120 description = "My custom xkb layout."; ··· 133 136 134 137 ###### implementation 135 138 136 - config = lib.mkIf (layouts != { }) { 139 + config = mkIf (layouts != { }) { 137 140 138 141 environment.sessionVariables = { 139 142 # runtime override supported by multiple libraries e. g. libxkbcommon
+10 -9
nixos/modules/services/x11/fractalart.nix
··· 4 4 pkgs, 5 5 ... 6 6 }: 7 + with lib; 7 8 let 8 9 cfg = config.services.fractalart; 9 10 in 10 11 { 11 12 options.services.fractalart = { 12 - enable = lib.mkOption { 13 - type = lib.types.bool; 13 + enable = mkOption { 14 + type = types.bool; 14 15 default = false; 15 16 example = true; 16 17 description = "Enable FractalArt for generating colorful wallpapers on login"; 17 18 }; 18 19 19 - width = lib.mkOption { 20 - type = lib.types.nullOr lib.types.int; 20 + width = mkOption { 21 + type = types.nullOr types.int; 21 22 default = null; 22 23 example = 1920; 23 24 description = "Screen width"; 24 25 }; 25 26 26 - height = lib.mkOption { 27 - type = lib.types.nullOr lib.types.int; 27 + height = mkOption { 28 + type = types.nullOr types.int; 28 29 default = null; 29 30 example = 1080; 30 31 description = "Screen height"; 31 32 }; 32 33 }; 33 34 34 - config = lib.mkIf cfg.enable { 35 + config = mkIf cfg.enable { 35 36 environment.systemPackages = [ pkgs.haskellPackages.FractalArt ]; 36 37 services.xserver.displayManager.sessionCommands = 37 38 "${pkgs.haskellPackages.FractalArt}/bin/FractalArt --no-bg -f .background-image" 38 - + lib.optionalString (cfg.width != null) " -w ${toString cfg.width}" 39 - + lib.optionalString (cfg.height != null) " -h ${toString cfg.height}"; 39 + + optionalString (cfg.width != null) " -w ${toString cfg.width}" 40 + + optionalString (cfg.height != null) " -h ${toString cfg.height}"; 40 41 }; 41 42 }
+8 -5
nixos/modules/services/x11/hardware/cmt.nix
··· 4 4 pkgs, 5 5 ... 6 6 }: 7 + 8 + with lib; 9 + 7 10 let 8 11 9 12 cfg = config.services.xserver.cmt; ··· 15 18 options = { 16 19 17 20 services.xserver.cmt = { 18 - enable = lib.mkOption { 19 - type = lib.types.bool; 21 + enable = mkOption { 22 + type = types.bool; 20 23 default = false; 21 24 description = "Enable chrome multitouch input (cmt). Touchpad drivers that are configured for chromebooks."; 22 25 }; 23 - models = lib.mkOption { 24 - type = lib.types.enum [ 26 + models = mkOption { 27 + type = types.enum [ 25 28 "atlas" 26 29 "banjo" 27 30 "candy" ··· 80 83 }; # closes services 81 84 }; # closes options 82 85 83 - config = lib.mkIf cfg.enable { 86 + config = mkIf cfg.enable { 84 87 85 88 services.xserver.modules = [ pkgs.xf86_input_cmt ]; 86 89
+5 -2
nixos/modules/services/x11/hardware/digimend.nix
··· 4 4 pkgs, 5 5 ... 6 6 }: 7 + 8 + with lib; 9 + 7 10 let 8 11 9 12 cfg = config.services.xserver.digimend; ··· 18 21 19 22 services.xserver.digimend = { 20 23 21 - enable = lib.mkEnableOption "the digimend drivers for Huion/XP-Pen/etc. tablets"; 24 + enable = mkEnableOption "the digimend drivers for Huion/XP-Pen/etc. tablets"; 22 25 23 26 }; 24 27 25 28 }; 26 29 27 - config = lib.mkIf cfg.enable { 30 + config = mkIf cfg.enable { 28 31 29 32 # digimend drivers use xsetwacom and wacom X11 drivers 30 33 services.xserver.wacom.enable = true;
+56 -53
nixos/modules/services/x11/hardware/synaptics.nix
··· 5 5 pkgs, 6 6 ... 7 7 }: 8 + 9 + with lib; 10 + 8 11 let 9 12 cfg = config.services.xserver.synaptics; 10 13 opt = options.services.xserver.synaptics; ··· 32 35 33 36 services.xserver.synaptics = { 34 37 35 - enable = lib.mkOption { 36 - type = lib.types.bool; 38 + enable = mkOption { 39 + type = types.bool; 37 40 default = false; 38 41 description = "Whether to enable touchpad support. Deprecated: Consider services.libinput.enable."; 39 42 }; 40 43 41 - dev = lib.mkOption { 42 - type = lib.types.nullOr lib.types.str; 44 + dev = mkOption { 45 + type = types.nullOr types.str; 43 46 default = null; 44 47 example = "/dev/input/event0"; 45 48 description = '' ··· 48 51 ''; 49 52 }; 50 53 51 - accelFactor = lib.mkOption { 52 - type = lib.types.nullOr lib.types.str; 54 + accelFactor = mkOption { 55 + type = types.nullOr types.str; 53 56 default = "0.001"; 54 57 description = "Cursor acceleration (how fast speed increases from minSpeed to maxSpeed)."; 55 58 }; 56 59 57 - minSpeed = lib.mkOption { 58 - type = lib.types.nullOr lib.types.str; 60 + minSpeed = mkOption { 61 + type = types.nullOr types.str; 59 62 default = "0.6"; 60 63 description = "Cursor speed factor for precision finger motion."; 61 64 }; 62 65 63 - maxSpeed = lib.mkOption { 64 - type = lib.types.nullOr lib.types.str; 66 + maxSpeed = mkOption { 67 + type = types.nullOr types.str; 65 68 default = "1.0"; 66 69 description = "Cursor speed factor for highest-speed finger motion."; 67 70 }; 68 71 69 - scrollDelta = lib.mkOption { 70 - type = lib.types.nullOr lib.types.int; 72 + scrollDelta = mkOption { 73 + type = types.nullOr types.int; 71 74 default = null; 72 75 example = 75; 73 76 description = "Move distance of the finger for a scroll event."; 74 77 }; 75 78 76 - twoFingerScroll = lib.mkOption { 77 - type = lib.types.bool; 79 + twoFingerScroll = mkOption { 80 + type = types.bool; 78 81 default = false; 79 82 description = "Whether to enable two-finger drag-scrolling. Overridden by horizTwoFingerScroll and vertTwoFingerScroll."; 80 83 }; 81 84 82 - horizTwoFingerScroll = lib.mkOption { 83 - type = lib.types.bool; 85 + horizTwoFingerScroll = mkOption { 86 + type = types.bool; 84 87 default = cfg.twoFingerScroll; 85 - defaultText = lib.literalExpression "config.${opt.twoFingerScroll}"; 88 + defaultText = literalExpression "config.${opt.twoFingerScroll}"; 86 89 description = "Whether to enable horizontal two-finger drag-scrolling."; 87 90 }; 88 91 89 - vertTwoFingerScroll = lib.mkOption { 90 - type = lib.types.bool; 92 + vertTwoFingerScroll = mkOption { 93 + type = types.bool; 91 94 default = cfg.twoFingerScroll; 92 - defaultText = lib.literalExpression "config.${opt.twoFingerScroll}"; 95 + defaultText = literalExpression "config.${opt.twoFingerScroll}"; 93 96 description = "Whether to enable vertical two-finger drag-scrolling."; 94 97 }; 95 98 96 - horizEdgeScroll = lib.mkOption { 97 - type = lib.types.bool; 99 + horizEdgeScroll = mkOption { 100 + type = types.bool; 98 101 default = !cfg.horizTwoFingerScroll; 99 - defaultText = lib.literalExpression "! config.${opt.horizTwoFingerScroll}"; 102 + defaultText = literalExpression "! config.${opt.horizTwoFingerScroll}"; 100 103 description = "Whether to enable horizontal edge drag-scrolling."; 101 104 }; 102 105 103 - vertEdgeScroll = lib.mkOption { 104 - type = lib.types.bool; 106 + vertEdgeScroll = mkOption { 107 + type = types.bool; 105 108 default = !cfg.vertTwoFingerScroll; 106 - defaultText = lib.literalExpression "! config.${opt.vertTwoFingerScroll}"; 109 + defaultText = literalExpression "! config.${opt.vertTwoFingerScroll}"; 107 110 description = "Whether to enable vertical edge drag-scrolling."; 108 111 }; 109 112 110 - tapButtons = lib.mkOption { 111 - type = lib.types.bool; 113 + tapButtons = mkOption { 114 + type = types.bool; 112 115 default = true; 113 116 description = "Whether to enable tap buttons."; 114 117 }; 115 118 116 - buttonsMap = lib.mkOption { 117 - type = lib.types.listOf lib.types.int; 119 + buttonsMap = mkOption { 120 + type = types.listOf types.int; 118 121 default = [ 119 122 1 120 123 2 ··· 129 132 apply = map toString; 130 133 }; 131 134 132 - fingersMap = lib.mkOption { 133 - type = lib.types.listOf lib.types.int; 135 + fingersMap = mkOption { 136 + type = types.listOf types.int; 134 137 default = [ 135 138 1 136 139 2 ··· 145 148 apply = map toString; 146 149 }; 147 150 148 - palmDetect = lib.mkOption { 149 - type = lib.types.bool; 151 + palmDetect = mkOption { 152 + type = types.bool; 150 153 default = false; 151 154 description = "Whether to enable palm detection (hardware support required)"; 152 155 }; 153 156 154 - palmMinWidth = lib.mkOption { 155 - type = lib.types.nullOr lib.types.int; 157 + palmMinWidth = mkOption { 158 + type = types.nullOr types.int; 156 159 default = null; 157 160 example = 5; 158 161 description = "Minimum finger width at which touch is considered a palm"; 159 162 }; 160 163 161 - palmMinZ = lib.mkOption { 162 - type = lib.types.nullOr lib.types.int; 164 + palmMinZ = mkOption { 165 + type = types.nullOr types.int; 163 166 default = null; 164 167 example = 20; 165 168 description = "Minimum finger pressure at which touch is considered a palm"; 166 169 }; 167 170 168 - horizontalScroll = lib.mkOption { 169 - type = lib.types.bool; 171 + horizontalScroll = mkOption { 172 + type = types.bool; 170 173 default = true; 171 174 description = "Whether to enable horizontal scrolling (on touchpad)"; 172 175 }; 173 176 174 - additionalOptions = lib.mkOption { 175 - type = lib.types.str; 177 + additionalOptions = mkOption { 178 + type = types.str; 176 179 default = ""; 177 180 example = '' 178 181 Option "RTCornerButton" "2" ··· 187 190 188 191 }; 189 192 190 - config = lib.mkIf cfg.enable { 193 + config = mkIf cfg.enable { 191 194 192 195 services.xserver.modules = [ pkg.out ]; 193 196 ··· 200 203 Section "InputClass" 201 204 Identifier "synaptics touchpad catchall" 202 205 MatchIsTouchpad "on" 203 - ${lib.optionalString (cfg.dev != null) ''MatchDevicePath "${cfg.dev}"''} 206 + ${optionalString (cfg.dev != null) ''MatchDevicePath "${cfg.dev}"''} 204 207 Driver "synaptics" 205 - ${lib.optionalString (cfg.minSpeed != null) ''Option "MinSpeed" "${cfg.minSpeed}"''} 206 - ${lib.optionalString (cfg.maxSpeed != null) ''Option "MaxSpeed" "${cfg.maxSpeed}"''} 207 - ${lib.optionalString (cfg.accelFactor != null) ''Option "AccelFactor" "${cfg.accelFactor}"''} 208 - ${lib.optionalString cfg.tapButtons tapConfig} 208 + ${optionalString (cfg.minSpeed != null) ''Option "MinSpeed" "${cfg.minSpeed}"''} 209 + ${optionalString (cfg.maxSpeed != null) ''Option "MaxSpeed" "${cfg.maxSpeed}"''} 210 + ${optionalString (cfg.accelFactor != null) ''Option "AccelFactor" "${cfg.accelFactor}"''} 211 + ${optionalString cfg.tapButtons tapConfig} 209 212 Option "ClickFinger1" "${builtins.elemAt cfg.buttonsMap 0}" 210 213 Option "ClickFinger2" "${builtins.elemAt cfg.buttonsMap 1}" 211 214 Option "ClickFinger3" "${builtins.elemAt cfg.buttonsMap 2}" ··· 213 216 Option "HorizTwoFingerScroll" "${if cfg.horizTwoFingerScroll then "1" else "0"}" 214 217 Option "VertEdgeScroll" "${if cfg.vertEdgeScroll then "1" else "0"}" 215 218 Option "HorizEdgeScroll" "${if cfg.horizEdgeScroll then "1" else "0"}" 216 - ${lib.optionalString cfg.palmDetect ''Option "PalmDetect" "1"''} 217 - ${lib.optionalString ( 219 + ${optionalString cfg.palmDetect ''Option "PalmDetect" "1"''} 220 + ${optionalString ( 218 221 cfg.palmMinWidth != null 219 222 ) ''Option "PalmMinWidth" "${toString cfg.palmMinWidth}"''} 220 - ${lib.optionalString (cfg.palmMinZ != null) ''Option "PalmMinZ" "${toString cfg.palmMinZ}"''} 221 - ${lib.optionalString ( 223 + ${optionalString (cfg.palmMinZ != null) ''Option "PalmMinZ" "${toString cfg.palmMinZ}"''} 224 + ${optionalString ( 222 225 cfg.scrollDelta != null 223 226 ) ''Option "VertScrollDelta" "${toString cfg.scrollDelta}"''} 224 227 ${ 225 228 if !cfg.horizontalScroll then 226 229 ''Option "HorizScrollDelta" "0"'' 227 230 else 228 - (lib.optionalString ( 231 + (optionalString ( 229 232 cfg.scrollDelta != null 230 233 ) ''Option "HorizScrollDelta" "${toString cfg.scrollDelta}"'') 231 234 }
+6 -3
nixos/modules/services/x11/hardware/wacom.nix
··· 4 4 pkgs, 5 5 ... 6 6 }: 7 + 8 + with lib; 9 + 7 10 let 8 11 9 12 cfg = config.services.xserver.wacom; ··· 16 19 17 20 services.xserver.wacom = { 18 21 19 - enable = lib.mkOption { 20 - type = lib.types.bool; 22 + enable = mkOption { 23 + type = types.bool; 21 24 default = false; 22 25 description = '' 23 26 Whether to enable the Wacom touchscreen/digitizer/tablet. ··· 34 37 35 38 }; 36 39 37 - config = lib.mkIf cfg.enable { 40 + config = mkIf cfg.enable { 38 41 39 42 environment.systemPackages = [ pkgs.xf86_input_wacom ]; # provides xsetwacom 40 43
+10 -9
nixos/modules/services/x11/imwheel.nix
··· 4 4 pkgs, 5 5 ... 6 6 }: 7 + with lib; 7 8 let 8 9 cfg = config.services.xserver.imwheel; 9 10 in 10 11 { 11 12 options = { 12 13 services.xserver.imwheel = { 13 - enable = lib.mkEnableOption "IMWheel service"; 14 + enable = mkEnableOption "IMWheel service"; 14 15 15 - extraOptions = lib.mkOption { 16 - type = lib.types.listOf lib.types.str; 16 + extraOptions = mkOption { 17 + type = types.listOf types.str; 17 18 default = [ "--buttons=45" ]; 18 19 example = [ "--debug" ]; 19 20 description = '' ··· 22 23 ''; 23 24 }; 24 25 25 - rules = lib.mkOption { 26 - type = lib.types.attrsOf lib.types.str; 26 + rules = mkOption { 27 + type = types.attrsOf types.str; 27 28 default = { }; 28 - example = lib.literalExpression '' 29 + example = literalExpression '' 29 30 { 30 31 ".*" = ''' 31 32 None, Up, Button4, 8 ··· 48 49 }; 49 50 }; 50 51 51 - config = lib.mkIf cfg.enable { 52 + config = mkIf cfg.enable { 52 53 environment.systemPackages = [ pkgs.imwheel ]; 53 54 54 55 environment.etc."X11/imwheel/imwheelrc".source = pkgs.writeText "imwheelrc" ( 55 - lib.concatStringsSep "\n\n" (lib.mapAttrsToList (rule: conf: "\"${rule}\"\n${conf}") cfg.rules) 56 + concatStringsSep "\n\n" (mapAttrsToList (rule: conf: "\"${rule}\"\n${conf}") cfg.rules) 56 57 ); 57 58 58 59 systemd.user.services.imwheel = { ··· 62 63 serviceConfig = { 63 64 ExecStart = 64 65 "${pkgs.imwheel}/bin/imwheel " 65 - + lib.escapeShellArgs ( 66 + + escapeShellArgs ( 66 67 [ 67 68 "--detach" 68 69 "--kill"
+67 -64
nixos/modules/services/x11/picom.nix
··· 5 5 pkgs, 6 6 ... 7 7 }: 8 + 9 + with lib; 10 + 8 11 let 9 12 10 13 cfg = config.services.picom; ··· 12 15 13 16 pairOf = 14 17 x: 15 - with lib.types; 18 + with types; 16 19 addCheck (listOf x) (y: length y == 2) // { description = "pair of ${x.description}"; }; 17 20 18 - mkDefaultAttrs = lib.mapAttrs (n: v: lib.mkDefault v); 21 + mkDefaultAttrs = mapAttrs (n: v: mkDefault v); 19 22 20 23 # Basically a tinkered lib.generators.mkKeyValueDefault 21 24 # It either serializes a top-level definition "key: { values };" 22 25 # or an expression "key = { values };" 23 26 mkAttrsString = 24 27 top: 25 - lib.mapAttrsToList ( 28 + mapAttrsToList ( 26 29 k: v: 27 30 let 28 - sep = if (top && lib.isAttrs v) then ":" else "="; 31 + sep = if (top && isAttrs v) then ":" else "="; 29 32 in 30 - "${lib.escape [ sep ] k}${sep}${mkValueString v};" 33 + "${escape [ sep ] k}${sep}${mkValueString v};" 31 34 ); 32 35 33 36 # This serializes a Nix expression to the libconfig format. 34 37 mkValueString = 35 38 v: 36 - if lib.types.bool.check v then 37 - lib.boolToString v 38 - else if lib.types.int.check v then 39 + if types.bool.check v then 40 + boolToString v 41 + else if types.int.check v then 39 42 toString v 40 - else if lib.types.float.check v then 43 + else if types.float.check v then 41 44 toString v 42 - else if lib.types.str.check v then 43 - "\"${lib.escape [ "\"" ] v}\"" 45 + else if types.str.check v then 46 + "\"${escape [ "\"" ] v}\"" 44 47 else if builtins.isList v then 45 - "[ ${lib.concatMapStringsSep " , " mkValueString v} ]" 46 - else if lib.types.attrs.check v then 47 - "{ ${lib.concatStringsSep " " (mkAttrsString false v)} }" 48 + "[ ${concatMapStringsSep " , " mkValueString v} ]" 49 + else if types.attrs.check v then 50 + "{ ${concatStringsSep " " (mkAttrsString false v)} }" 48 51 else 49 52 throw '' 50 53 invalid expression used in option services.picom.settings: 51 54 ${v} 52 55 ''; 53 56 54 - toConf = attrs: lib.concatStringsSep "\n" (mkAttrsString true cfg.settings); 57 + toConf = attrs: concatStringsSep "\n" (mkAttrsString true cfg.settings); 55 58 56 59 configFile = pkgs.writeText "picom.conf" (toConf cfg.settings); 57 60 ··· 59 62 { 60 63 61 64 imports = [ 62 - (lib.mkAliasOptionModuleMD [ "services" "compton" ] [ "services" "picom" ]) 63 - (lib.mkRemovedOptionModule [ "services" "picom" "refreshRate" ] '' 65 + (mkAliasOptionModuleMD [ "services" "compton" ] [ "services" "picom" ]) 66 + (mkRemovedOptionModule [ "services" "picom" "refreshRate" ] '' 64 67 This option corresponds to `refresh-rate`, which has been unused 65 68 since picom v6 and was subsequently removed by upstream. 66 69 See https://github.com/yshui/picom/commit/bcbc410 67 70 '') 68 - (lib.mkRemovedOptionModule [ "services" "picom" "experimentalBackends" ] '' 71 + (mkRemovedOptionModule [ "services" "picom" "experimentalBackends" ] '' 69 72 This option was removed by upstream since picom v10. 70 73 '') 71 74 ]; 72 75 73 76 options.services.picom = { 74 - enable = lib.mkOption { 75 - type = lib.types.bool; 77 + enable = mkOption { 78 + type = types.bool; 76 79 default = false; 77 80 description = '' 78 81 Whether or not to enable Picom as the X.org composite manager. 79 82 ''; 80 83 }; 81 84 82 - package = lib.mkPackageOption pkgs "picom" { }; 85 + package = mkPackageOption pkgs "picom" { }; 83 86 84 - fade = lib.mkOption { 85 - type = lib.types.bool; 87 + fade = mkOption { 88 + type = types.bool; 86 89 default = false; 87 90 description = '' 88 91 Fade windows in and out. 89 92 ''; 90 93 }; 91 94 92 - fadeDelta = lib.mkOption { 93 - type = lib.types.ints.positive; 95 + fadeDelta = mkOption { 96 + type = types.ints.positive; 94 97 default = 10; 95 98 example = 5; 96 99 description = '' ··· 98 101 ''; 99 102 }; 100 103 101 - fadeSteps = lib.mkOption { 102 - type = pairOf (lib.types.numbers.between 0.01 1); 104 + fadeSteps = mkOption { 105 + type = pairOf (types.numbers.between 0.01 1); 103 106 default = [ 104 107 0.028 105 108 0.03 ··· 113 116 ''; 114 117 }; 115 118 116 - fadeExclude = lib.mkOption { 117 - type = lib.types.listOf lib.types.str; 119 + fadeExclude = mkOption { 120 + type = types.listOf types.str; 118 121 default = [ ]; 119 122 example = [ 120 123 "window_type *= 'menu'" ··· 127 130 ''; 128 131 }; 129 132 130 - shadow = lib.mkOption { 131 - type = lib.types.bool; 133 + shadow = mkOption { 134 + type = types.bool; 132 135 default = false; 133 136 description = '' 134 137 Draw window shadows. 135 138 ''; 136 139 }; 137 140 138 - shadowOffsets = lib.mkOption { 139 - type = pairOf lib.types.int; 141 + shadowOffsets = mkOption { 142 + type = pairOf types.int; 140 143 default = [ 141 144 (-15) 142 145 (-15) ··· 150 153 ''; 151 154 }; 152 155 153 - shadowOpacity = lib.mkOption { 154 - type = lib.types.numbers.between 0 1; 156 + shadowOpacity = mkOption { 157 + type = types.numbers.between 0 1; 155 158 default = 0.75; 156 159 example = 0.8; 157 160 description = '' ··· 159 162 ''; 160 163 }; 161 164 162 - shadowExclude = lib.mkOption { 163 - type = lib.types.listOf lib.types.str; 165 + shadowExclude = mkOption { 166 + type = types.listOf types.str; 164 167 default = [ ]; 165 168 example = [ 166 169 "window_type *= 'menu'" ··· 173 176 ''; 174 177 }; 175 178 176 - activeOpacity = lib.mkOption { 177 - type = lib.types.numbers.between 0 1; 179 + activeOpacity = mkOption { 180 + type = types.numbers.between 0 1; 178 181 default = 1.0; 179 182 example = 0.8; 180 183 description = '' ··· 182 185 ''; 183 186 }; 184 187 185 - inactiveOpacity = lib.mkOption { 186 - type = lib.types.numbers.between 0.1 1; 188 + inactiveOpacity = mkOption { 189 + type = types.numbers.between 0.1 1; 187 190 default = 1.0; 188 191 example = 0.8; 189 192 description = '' ··· 191 194 ''; 192 195 }; 193 196 194 - menuOpacity = lib.mkOption { 195 - type = lib.types.numbers.between 0 1; 197 + menuOpacity = mkOption { 198 + type = types.numbers.between 0 1; 196 199 default = 1.0; 197 200 example = 0.8; 198 201 description = '' ··· 200 203 ''; 201 204 }; 202 205 203 - wintypes = lib.mkOption { 204 - type = lib.types.attrs; 206 + wintypes = mkOption { 207 + type = types.attrs; 205 208 default = { 206 209 popup_menu = { 207 210 opacity = cfg.menuOpacity; ··· 210 213 opacity = cfg.menuOpacity; 211 214 }; 212 215 }; 213 - defaultText = lib.literalExpression '' 216 + defaultText = literalExpression '' 214 217 { 215 218 popup_menu = { opacity = config.${opt.menuOpacity}; }; 216 219 dropdown_menu = { opacity = config.${opt.menuOpacity}; }; ··· 222 225 ''; 223 226 }; 224 227 225 - opacityRules = lib.mkOption { 226 - type = lib.types.listOf lib.types.str; 228 + opacityRules = mkOption { 229 + type = types.listOf types.str; 227 230 default = [ ]; 228 231 example = [ 229 232 "95:class_g = 'URxvt' && !_NET_WM_STATE@:32a" ··· 234 237 ''; 235 238 }; 236 239 237 - backend = lib.mkOption { 238 - type = lib.types.enum [ 240 + backend = mkOption { 241 + type = types.enum [ 239 242 "egl" 240 243 "glx" 241 244 "xrender" ··· 247 250 ''; 248 251 }; 249 252 250 - vSync = lib.mkOption { 253 + vSync = mkOption { 251 254 type = 252 - with lib.types; 255 + with types; 253 256 either bool (enum [ 254 257 "none" 255 258 "drm" ··· 265 268 res = x != "none"; 266 269 msg = 267 270 "The type of services.picom.vSync has changed to bool:" 268 - + " interpreting ${x} as ${lib.boolToString res}"; 271 + + " interpreting ${x} as ${boolToString res}"; 269 272 in 270 - if lib.isBool x then x else lib.warn msg res; 273 + if isBool x then x else warn msg res; 271 274 272 275 description = '' 273 276 Enable vertical synchronization. Chooses the best method ··· 277 280 }; 278 281 279 282 settings = 280 - with lib.types; 283 + with types; 281 284 let 282 285 scalar = 283 286 oneOf [ ··· 310 313 }; 311 314 312 315 in 313 - lib.mkOption { 316 + mkOption { 314 317 type = topLevel; 315 318 default = { }; 316 - example = lib.literalExpression '' 319 + example = literalExpression '' 317 320 blur = 318 321 { method = "gaussian"; 319 322 size = 10; ··· 328 331 }; 329 332 }; 330 333 331 - config = lib.mkIf cfg.enable { 334 + config = mkIf cfg.enable { 332 335 services.picom.settings = mkDefaultAttrs { 333 336 # fading 334 337 fading = cfg.fade; 335 338 fade-delta = cfg.fadeDelta; 336 - fade-in-step = lib.elemAt cfg.fadeSteps 0; 337 - fade-out-step = lib.elemAt cfg.fadeSteps 1; 339 + fade-in-step = elemAt cfg.fadeSteps 0; 340 + fade-out-step = elemAt cfg.fadeSteps 1; 338 341 fade-exclude = cfg.fadeExclude; 339 342 340 343 # shadows 341 344 shadow = cfg.shadow; 342 - shadow-offset-x = lib.elemAt cfg.shadowOffsets 0; 343 - shadow-offset-y = lib.elemAt cfg.shadowOffsets 1; 345 + shadow-offset-x = elemAt cfg.shadowOffsets 0; 346 + shadow-offset-y = elemAt cfg.shadowOffsets 1; 344 347 shadow-opacity = cfg.shadowOpacity; 345 348 shadow-exclude = cfg.shadowExclude; 346 349 ··· 363 366 partOf = [ "graphical-session.target" ]; 364 367 365 368 # Temporarily fixes corrupt colours with Mesa 18 366 - environment = lib.mkIf (cfg.backend == "glx") { 369 + environment = mkIf (cfg.backend == "glx") { 367 370 allow_rgb10_configs = "false"; 368 371 }; 369 372 370 373 serviceConfig = { 371 - ExecStart = "${lib.getExe cfg.package} --config ${configFile}"; 374 + ExecStart = "${getExe cfg.package} --config ${configFile}"; 372 375 RestartSec = 3; 373 376 Restart = "always"; 374 377 };
+24 -21
nixos/modules/services/x11/redshift.nix
··· 4 4 pkgs, 5 5 ... 6 6 }: 7 + 8 + with lib; 9 + 7 10 let 8 11 9 12 cfg = config.services.redshift; ··· 13 16 { 14 17 15 18 imports = [ 16 - (lib.mkChangedOptionModule [ "services" "redshift" "latitude" ] [ "location" "latitude" ] ( 19 + (mkChangedOptionModule [ "services" "redshift" "latitude" ] [ "location" "latitude" ] ( 17 20 config: 18 21 let 19 - value = lib.getAttrFromPath [ "services" "redshift" "latitude" ] config; 22 + value = getAttrFromPath [ "services" "redshift" "latitude" ] config; 20 23 in 21 24 if value == null then 22 25 throw "services.redshift.latitude is set to null, you can remove this" 23 26 else 24 27 builtins.fromJSON value 25 28 )) 26 - (lib.mkChangedOptionModule [ "services" "redshift" "longitude" ] [ "location" "longitude" ] ( 29 + (mkChangedOptionModule [ "services" "redshift" "longitude" ] [ "location" "longitude" ] ( 27 30 config: 28 31 let 29 - value = lib.getAttrFromPath [ "services" "redshift" "longitude" ] config; 32 + value = getAttrFromPath [ "services" "redshift" "longitude" ] config; 30 33 in 31 34 if value == null then 32 35 throw "services.redshift.longitude is set to null, you can remove this" 33 36 else 34 37 builtins.fromJSON value 35 38 )) 36 - (lib.mkRenamedOptionModule [ "services" "redshift" "provider" ] [ "location" "provider" ]) 39 + (mkRenamedOptionModule [ "services" "redshift" "provider" ] [ "location" "provider" ]) 37 40 ]; 38 41 39 42 options.services.redshift = { 40 - enable = lib.mkOption { 41 - type = lib.types.bool; 43 + enable = mkOption { 44 + type = types.bool; 42 45 default = false; 43 46 description = '' 44 47 Enable Redshift to change your screen's colour temperature depending on ··· 47 50 }; 48 51 49 52 temperature = { 50 - day = lib.mkOption { 51 - type = lib.types.int; 53 + day = mkOption { 54 + type = types.int; 52 55 default = 5500; 53 56 description = '' 54 57 Colour temperature to use during the day, between 55 58 `1000` and `25000` K. 56 59 ''; 57 60 }; 58 - night = lib.mkOption { 59 - type = lib.types.int; 61 + night = mkOption { 62 + type = types.int; 60 63 default = 3700; 61 64 description = '' 62 65 Colour temperature to use at night, between ··· 66 69 }; 67 70 68 71 brightness = { 69 - day = lib.mkOption { 70 - type = lib.types.str; 72 + day = mkOption { 73 + type = types.str; 71 74 default = "1"; 72 75 description = '' 73 76 Screen brightness to apply during the day, 74 77 between `0.1` and `1.0`. 75 78 ''; 76 79 }; 77 - night = lib.mkOption { 78 - type = lib.types.str; 80 + night = mkOption { 81 + type = types.str; 79 82 default = "1"; 80 83 description = '' 81 84 Screen brightness to apply during the night, ··· 84 87 }; 85 88 }; 86 89 87 - package = lib.mkPackageOption pkgs "redshift" { }; 90 + package = mkPackageOption pkgs "redshift" { }; 88 91 89 - executable = lib.mkOption { 90 - type = lib.types.str; 92 + executable = mkOption { 93 + type = types.str; 91 94 default = "/bin/redshift"; 92 95 example = "/bin/redshift-gtk"; 93 96 description = '' ··· 95 98 ''; 96 99 }; 97 100 98 - extraOptions = lib.mkOption { 99 - type = lib.types.listOf lib.types.str; 101 + extraOptions = mkOption { 102 + type = types.listOf types.str; 100 103 default = [ ]; 101 104 example = [ 102 105 "-v" ··· 109 112 }; 110 113 }; 111 114 112 - config = lib.mkIf cfg.enable { 115 + config = mkIf cfg.enable { 113 116 # needed so that .desktop files are installed, which geoclue cares about 114 117 environment.systemPackages = [ cfg.package ]; 115 118
+7 -4
nixos/modules/services/x11/touchegg.nix
··· 4 4 pkgs, 5 5 ... 6 6 }: 7 + 8 + with lib; 9 + 7 10 let 8 11 cfg = config.services.touchegg; 9 12 10 13 in 11 14 { 12 15 meta = { 13 - maintainers = lib.teams.pantheon.members; 16 + maintainers = teams.pantheon.members; 14 17 }; 15 18 16 19 ###### interface 17 20 options.services.touchegg = { 18 - enable = lib.mkEnableOption "touchegg, a multi-touch gesture recognizer"; 21 + enable = mkEnableOption "touchegg, a multi-touch gesture recognizer"; 19 22 20 - package = lib.mkPackageOption pkgs "touchegg" { }; 23 + package = mkPackageOption pkgs "touchegg" { }; 21 24 }; 22 25 23 26 ###### implementation 24 - config = lib.mkIf cfg.enable { 27 + config = mkIf cfg.enable { 25 28 systemd.services.touchegg = { 26 29 description = "Touchegg Daemon"; 27 30 serviceConfig = {
+14 -11
nixos/modules/services/x11/unclutter-xfixes.nix
··· 4 4 pkgs, 5 5 ... 6 6 }: 7 + 8 + with lib; 9 + 7 10 let 8 11 cfg = config.services.unclutter-xfixes; 9 12 ··· 11 14 { 12 15 options.services.unclutter-xfixes = { 13 16 14 - enable = lib.mkOption { 17 + enable = mkOption { 15 18 description = "Enable unclutter-xfixes to hide your mouse cursor when inactive."; 16 - type = lib.types.bool; 19 + type = types.bool; 17 20 default = false; 18 21 }; 19 22 20 - package = lib.mkPackageOption pkgs "unclutter-xfixes" { }; 23 + package = mkPackageOption pkgs "unclutter-xfixes" { }; 21 24 22 - timeout = lib.mkOption { 25 + timeout = mkOption { 23 26 description = "Number of seconds before the cursor is marked inactive."; 24 - type = lib.types.int; 27 + type = types.int; 25 28 default = 1; 26 29 }; 27 30 28 - threshold = lib.mkOption { 31 + threshold = mkOption { 29 32 description = "Minimum number of pixels considered cursor movement."; 30 - type = lib.types.int; 33 + type = types.int; 31 34 default = 1; 32 35 }; 33 36 34 - extraOptions = lib.mkOption { 37 + extraOptions = mkOption { 35 38 description = "More arguments to pass to the unclutter-xfixes command."; 36 - type = lib.types.listOf lib.types.str; 39 + type = types.listOf types.str; 37 40 default = [ ]; 38 41 example = [ 39 42 "exclude-root" ··· 43 46 }; 44 47 }; 45 48 46 - config = lib.mkIf cfg.enable { 49 + config = mkIf cfg.enable { 47 50 systemd.user.services.unclutter-xfixes = { 48 51 description = "unclutter-xfixes"; 49 52 wantedBy = [ "graphical-session.target" ]; ··· 52 55 ${cfg.package}/bin/unclutter \ 53 56 --timeout ${toString cfg.timeout} \ 54 57 --jitter ${toString (cfg.threshold - 1)} \ 55 - ${lib.concatMapStrings (x: " --" + x) cfg.extraOptions} \ 58 + ${concatMapStrings (x: " --" + x) cfg.extraOptions} \ 56 59 ''; 57 60 serviceConfig.RestartSec = 3; 58 61 serviceConfig.Restart = "always";
+21 -18
nixos/modules/services/x11/unclutter.nix
··· 4 4 pkgs, 5 5 ... 6 6 }: 7 + 8 + with lib; 9 + 7 10 let 8 11 cfg = config.services.unclutter; 9 12 ··· 11 14 { 12 15 options.services.unclutter = { 13 16 14 - enable = lib.mkOption { 17 + enable = mkOption { 15 18 description = "Enable unclutter to hide your mouse cursor when inactive"; 16 - type = lib.types.bool; 19 + type = types.bool; 17 20 default = false; 18 21 }; 19 22 20 - package = lib.mkPackageOption pkgs "unclutter" { }; 23 + package = mkPackageOption pkgs "unclutter" { }; 21 24 22 - keystroke = lib.mkOption { 25 + keystroke = mkOption { 23 26 description = "Wait for a keystroke before hiding the cursor"; 24 - type = lib.types.bool; 27 + type = types.bool; 25 28 default = false; 26 29 }; 27 30 28 - timeout = lib.mkOption { 31 + timeout = mkOption { 29 32 description = "Number of seconds before the cursor is marked inactive"; 30 - type = lib.types.int; 33 + type = types.int; 31 34 default = 1; 32 35 }; 33 36 34 - threshold = lib.mkOption { 37 + threshold = mkOption { 35 38 description = "Minimum number of pixels considered cursor movement"; 36 - type = lib.types.int; 39 + type = types.int; 37 40 default = 1; 38 41 }; 39 42 40 - excluded = lib.mkOption { 43 + excluded = mkOption { 41 44 description = "Names of windows where unclutter should not apply"; 42 - type = lib.types.listOf lib.types.str; 45 + type = types.listOf types.str; 43 46 default = [ ]; 44 47 example = [ "" ]; 45 48 }; 46 49 47 - extraOptions = lib.mkOption { 50 + extraOptions = mkOption { 48 51 description = "More arguments to pass to the unclutter command"; 49 - type = lib.types.listOf lib.types.str; 52 + type = types.listOf types.str; 50 53 default = [ ]; 51 54 example = [ 52 55 "noevent" ··· 55 58 }; 56 59 }; 57 60 58 - config = lib.mkIf cfg.enable { 61 + config = mkIf cfg.enable { 59 62 systemd.user.services.unclutter = { 60 63 description = "unclutter"; 61 64 wantedBy = [ "graphical-session.target" ]; ··· 64 67 ${cfg.package}/bin/unclutter \ 65 68 -idle ${toString cfg.timeout} \ 66 69 -jitter ${toString (cfg.threshold - 1)} \ 67 - ${lib.optionalString cfg.keystroke "-keystroke"} \ 68 - ${lib.concatMapStrings (x: " -" + x) cfg.extraOptions} \ 69 - -not ${lib.concatStringsSep " " cfg.excluded} \ 70 + ${optionalString cfg.keystroke "-keystroke"} \ 71 + ${concatMapStrings (x: " -" + x) cfg.extraOptions} \ 72 + -not ${concatStringsSep " " cfg.excluded} \ 70 73 ''; 71 74 serviceConfig.PassEnvironment = "DISPLAY"; 72 75 serviceConfig.RestartSec = 3; ··· 75 78 }; 76 79 77 80 imports = [ 78 - (lib.mkRenamedOptionModule 81 + (mkRenamedOptionModule 79 82 [ "services" "unclutter" "threeshold" ] 80 83 [ "services" "unclutter" "threshold" ] 81 84 )
+8 -4
nixos/modules/services/x11/urxvtd.nix
··· 4 4 pkgs, 5 5 ... 6 6 }: 7 + 7 8 # maintainer: siddharthist 9 + 10 + with lib; 11 + 8 12 let 9 13 cfg = config.services.urxvtd; 10 14 in 11 15 { 12 16 options.services.urxvtd = { 13 - enable = lib.mkOption { 14 - type = lib.types.bool; 17 + enable = mkOption { 18 + type = types.bool; 15 19 default = false; 16 20 description = '' 17 21 Enable urxvtd, the urxvt terminal daemon. To use urxvtd, run ··· 19 23 ''; 20 24 }; 21 25 22 - package = lib.mkPackageOption pkgs "rxvt-unicode" { }; 26 + package = mkPackageOption pkgs "rxvt-unicode" { }; 23 27 }; 24 28 25 - config = lib.mkIf cfg.enable { 29 + config = mkIf cfg.enable { 26 30 systemd.user.services.urxvtd = { 27 31 description = "urxvt terminal daemon"; 28 32 wantedBy = [ "graphical-session.target" ];
+6 -3
nixos/modules/services/x11/window-managers/2bwm.nix
··· 4 4 pkgs, 5 5 ... 6 6 }: 7 + 8 + with lib; 9 + 7 10 let 8 11 9 12 cfg = config.services.xserver.windowManager."2bwm"; ··· 15 18 ###### interface 16 19 17 20 options = { 18 - services.xserver.windowManager."2bwm".enable = lib.mkEnableOption "2bwm"; 21 + services.xserver.windowManager."2bwm".enable = mkEnableOption "2bwm"; 19 22 }; 20 23 21 24 ###### implementation 22 25 23 - config = lib.mkIf cfg.enable { 26 + config = mkIf cfg.enable { 24 27 25 - services.xserver.windowManager.session = lib.singleton { 28 + services.xserver.windowManager.session = singleton { 26 29 name = "2bwm"; 27 30 start = '' 28 31 ${pkgs._2bwm}/bin/2bwm &
+6 -3
nixos/modules/services/x11/window-managers/afterstep.nix
··· 4 4 pkgs, 5 5 ... 6 6 }: 7 + 8 + with lib; 9 + 7 10 let 8 11 cfg = config.services.xserver.windowManager.afterstep; 9 12 in 10 13 { 11 14 ###### interface 12 15 options = { 13 - services.xserver.windowManager.afterstep.enable = lib.mkEnableOption "afterstep"; 16 + services.xserver.windowManager.afterstep.enable = mkEnableOption "afterstep"; 14 17 }; 15 18 16 19 ###### implementation 17 - config = lib.mkIf cfg.enable { 18 - services.xserver.windowManager.session = lib.singleton { 20 + config = mkIf cfg.enable { 21 + services.xserver.windowManager.session = singleton { 19 22 name = "afterstep"; 20 23 start = '' 21 24 ${pkgs.afterstep}/bin/afterstep &
+12 -9
nixos/modules/services/x11/window-managers/awesome.nix
··· 4 4 pkgs, 5 5 ... 6 6 }: 7 + 8 + with lib; 9 + 7 10 let 8 11 9 12 cfg = config.services.xserver.windowManager.awesome; ··· 22 25 23 26 services.xserver.windowManager.awesome = { 24 27 25 - enable = lib.mkEnableOption "Awesome window manager"; 28 + enable = mkEnableOption "Awesome window manager"; 26 29 27 - luaModules = lib.mkOption { 30 + luaModules = mkOption { 28 31 default = [ ]; 29 - type = lib.types.listOf lib.types.package; 32 + type = types.listOf types.package; 30 33 description = "List of lua packages available for being used in the Awesome configuration."; 31 - example = lib.literalExpression "[ pkgs.luaPackages.vicious ]"; 34 + example = literalExpression "[ pkgs.luaPackages.vicious ]"; 32 35 }; 33 36 34 - package = lib.mkPackageOption pkgs "awesome" { }; 37 + package = mkPackageOption pkgs "awesome" { }; 35 38 36 - noArgb = lib.mkOption { 39 + noArgb = mkOption { 37 40 default = false; 38 - type = lib.types.bool; 41 + type = types.bool; 39 42 description = "Disable client transparency support, which can be greatly detrimental to performance in some setups"; 40 43 }; 41 44 }; ··· 44 47 45 48 ###### implementation 46 49 47 - config = lib.mkIf cfg.enable { 50 + config = mkIf cfg.enable { 48 51 49 - services.xserver.windowManager.session = lib.singleton { 52 + services.xserver.windowManager.session = singleton { 50 53 name = "awesome"; 51 54 start = '' 52 55 ${awesome}/bin/awesome ${lib.optionalString cfg.noArgb "--no-argb"} ${makeSearchPath cfg.luaModules} &
+6 -3
nixos/modules/services/x11/window-managers/berry.nix
··· 4 4 pkgs, 5 5 ... 6 6 }: 7 + 8 + with lib; 9 + 7 10 let 8 11 cfg = config.services.xserver.windowManager.berry; 9 12 in 10 13 { 11 14 ###### interface 12 15 options = { 13 - services.xserver.windowManager.berry.enable = lib.mkEnableOption "berry"; 16 + services.xserver.windowManager.berry.enable = mkEnableOption "berry"; 14 17 }; 15 18 16 19 ###### implementation 17 - config = lib.mkIf cfg.enable { 18 - services.xserver.windowManager.session = lib.singleton { 20 + config = mkIf cfg.enable { 21 + services.xserver.windowManager.session = singleton { 19 22 name = "berry"; 20 23 start = '' 21 24 ${pkgs.berry}/bin/berry &
+19 -16
nixos/modules/services/x11/window-managers/bspwm.nix
··· 4 4 pkgs, 5 5 ... 6 6 }: 7 + 8 + with lib; 9 + 7 10 let 8 11 cfg = config.services.xserver.windowManager.bspwm; 9 12 in ··· 11 14 { 12 15 options = { 13 16 services.xserver.windowManager.bspwm = { 14 - enable = lib.mkEnableOption "bspwm"; 17 + enable = mkEnableOption "bspwm"; 15 18 16 - package = lib.mkPackageOption pkgs "bspwm" { 19 + package = mkPackageOption pkgs "bspwm" { 17 20 example = "bspwm-unstable"; 18 21 }; 19 - configFile = lib.mkOption { 20 - type = with lib.types; nullOr path; 21 - example = lib.literalExpression ''"''${pkgs.bspwm}/share/doc/bspwm/examples/bspwmrc"''; 22 + configFile = mkOption { 23 + type = with types; nullOr path; 24 + example = literalExpression ''"''${pkgs.bspwm}/share/doc/bspwm/examples/bspwmrc"''; 22 25 default = null; 23 26 description = '' 24 27 Path to the bspwm configuration file. ··· 27 30 }; 28 31 29 32 sxhkd = { 30 - package = lib.mkPackageOption pkgs "sxhkd" { 33 + package = mkPackageOption pkgs "sxhkd" { 31 34 example = "sxhkd-unstable"; 32 35 }; 33 - configFile = lib.mkOption { 34 - type = with lib.types; nullOr path; 35 - example = lib.literalExpression ''"''${pkgs.bspwm}/share/doc/bspwm/examples/sxhkdrc"''; 36 + configFile = mkOption { 37 + type = with types; nullOr path; 38 + example = literalExpression ''"''${pkgs.bspwm}/share/doc/bspwm/examples/sxhkdrc"''; 36 39 default = null; 37 40 description = '' 38 41 Path to the sxhkd configuration file. ··· 43 46 }; 44 47 }; 45 48 46 - config = lib.mkIf cfg.enable { 47 - services.xserver.windowManager.session = lib.singleton { 49 + config = mkIf cfg.enable { 50 + services.xserver.windowManager.session = singleton { 48 51 name = "bspwm"; 49 52 start = '' 50 53 export _JAVA_AWT_WM_NONREPARENTING=1 51 54 SXHKD_SHELL=/bin/sh ${cfg.sxhkd.package}/bin/sxhkd ${ 52 - lib.optionalString (cfg.sxhkd.configFile != null) "-c \"${cfg.sxhkd.configFile}\"" 55 + optionalString (cfg.sxhkd.configFile != null) "-c \"${cfg.sxhkd.configFile}\"" 53 56 } & 54 - ${cfg.package}/bin/bspwm ${lib.optionalString (cfg.configFile != null) "-c \"${cfg.configFile}\""} & 57 + ${cfg.package}/bin/bspwm ${optionalString (cfg.configFile != null) "-c \"${cfg.configFile}\""} & 55 58 waitPID=$! 56 59 ''; 57 60 }; ··· 59 62 }; 60 63 61 64 imports = [ 62 - (lib.mkRemovedOptionModule [ "services" "xserver" "windowManager" "bspwm-unstable" "enable" ] 65 + (mkRemovedOptionModule [ "services" "xserver" "windowManager" "bspwm-unstable" "enable" ] 63 66 "Use services.xserver.windowManager.bspwm.enable and set services.xserver.windowManager.bspwm.package to pkgs.bspwm-unstable to use the unstable version of bspwm." 64 67 ) 65 - (lib.mkRemovedOptionModule [ 68 + (mkRemovedOptionModule [ 66 69 "services" 67 70 "xserver" 68 71 "windowManager" 69 72 "bspwm" 70 73 "startThroughSession" 71 74 ] "bspwm package does not provide bspwm-session anymore.") 72 - (lib.mkRemovedOptionModule [ 75 + (mkRemovedOptionModule [ 73 76 "services" 74 77 "xserver" 75 78 "windowManager"
+7 -4
nixos/modules/services/x11/window-managers/clfswm.nix
··· 4 4 pkgs, 5 5 ... 6 6 }: 7 + 8 + with lib; 9 + 7 10 let 8 11 cfg = config.services.xserver.windowManager.clfswm; 9 12 in ··· 11 14 { 12 15 options = { 13 16 services.xserver.windowManager.clfswm = { 14 - enable = lib.mkEnableOption "clfswm"; 15 - package = lib.mkPackageOption pkgs [ "sbclPackages" "clfswm" ] { }; 17 + enable = mkEnableOption "clfswm"; 18 + package = mkPackageOption pkgs [ "sbclPackages" "clfswm" ] { }; 16 19 }; 17 20 }; 18 21 19 - config = lib.mkIf cfg.enable { 20 - services.xserver.windowManager.session = lib.singleton { 22 + config = mkIf cfg.enable { 23 + services.xserver.windowManager.session = singleton { 21 24 name = "clfswm"; 22 25 start = '' 23 26 ${cfg.package}/bin/clfswm &
+6 -3
nixos/modules/services/x11/window-managers/cwm.nix
··· 4 4 pkgs, 5 5 ... 6 6 }: 7 + 8 + with lib; 9 + 7 10 let 8 11 cfg = config.services.xserver.windowManager.cwm; 9 12 in 10 13 { 11 14 options = { 12 - services.xserver.windowManager.cwm.enable = lib.mkEnableOption "cwm"; 15 + services.xserver.windowManager.cwm.enable = mkEnableOption "cwm"; 13 16 }; 14 - config = lib.mkIf cfg.enable { 15 - services.xserver.windowManager.session = lib.singleton { 17 + config = mkIf cfg.enable { 18 + services.xserver.windowManager.session = singleton { 16 19 name = "cwm"; 17 20 start = '' 18 21 cwm &
+7 -4
nixos/modules/services/x11/window-managers/dwm.nix
··· 1 1 { config, lib, pkgs, ... }: 2 + 3 + with lib; 4 + 2 5 let 3 6 4 7 cfg = config.services.xserver.windowManager.dwm; ··· 11 14 12 15 options = { 13 16 services.xserver.windowManager.dwm = { 14 - enable = lib.mkEnableOption "dwm"; 15 - package = lib.mkPackageOption pkgs "dwm" { 17 + enable = mkEnableOption "dwm"; 18 + package = mkPackageOption pkgs "dwm" { 16 19 example = '' 17 20 pkgs.dwm.overrideAttrs (oldAttrs: rec { 18 21 patches = [ ··· 30 33 31 34 ###### implementation 32 35 33 - config = lib.mkIf cfg.enable { 36 + config = mkIf cfg.enable { 34 37 35 - services.xserver.windowManager.session = lib.singleton 38 + services.xserver.windowManager.session = singleton 36 39 { name = "dwm"; 37 40 start = 38 41 ''
+6 -3
nixos/modules/services/x11/window-managers/e16.nix
··· 4 4 pkgs, 5 5 ... 6 6 }: 7 + 8 + with lib; 9 + 7 10 let 8 11 cfg = config.services.xserver.windowManager.e16; 9 12 in 10 13 { 11 14 ###### interface 12 15 options = { 13 - services.xserver.windowManager.e16.enable = lib.mkEnableOption "e16"; 16 + services.xserver.windowManager.e16.enable = mkEnableOption "e16"; 14 17 }; 15 18 16 19 ###### implementation 17 - config = lib.mkIf cfg.enable { 18 - services.xserver.windowManager.session = lib.singleton { 20 + config = mkIf cfg.enable { 21 + services.xserver.windowManager.session = singleton { 19 22 name = "E16"; 20 23 start = '' 21 24 ${pkgs.e16}/bin/e16 &