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

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