push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,281 @@
{
lib,
pkgs,
config,
utils,
...
}:
let
inherit (lib)
concatMapStrings
literalExpression
mkDefault
mkEnableOption
mkIf
mkOption
types
;
cfg = config.services.xserver.desktopManager.budgie;
nixos-background-light = pkgs.nixos-artwork.wallpapers.nineish;
nixos-background-dark = pkgs.nixos-artwork.wallpapers.nineish-dark-gray;
nixos-gsettings-overrides = pkgs.budgie-gsettings-overrides.override {
inherit (cfg) extraGSettingsOverrides extraGSettingsOverridePackages;
inherit nixos-background-dark nixos-background-light;
};
nixos-background-info = pkgs.writeTextFile {
name = "nixos-background-info";
text = ''
<?xml version="1.0"?>
<!DOCTYPE wallpapers SYSTEM "gnome-wp-list.dtd">
<wallpapers>
<wallpaper deleted="false">
<name>Nineish</name>
<filename>${nixos-background-light.gnomeFilePath}</filename>
<options>zoom</options>
<shade_type>solid</shade_type>
<pcolor>#d1dcf8</pcolor>
<scolor>#e3ebfe</scolor>
</wallpaper>
<wallpaper deleted="false">
<name>Nineish Dark Gray</name>
<filename>${nixos-background-dark.gnomeFilePath}</filename>
<options>zoom</options>
<shade_type>solid</shade_type>
<pcolor>#151515</pcolor>
<scolor>#262626</scolor>
</wallpaper>
</wallpapers>
'';
destination = "/share/gnome-background-properties/nixos.xml";
};
budgie-control-center' = pkgs.budgie-control-center.override {
enableSshSocket = config.services.openssh.startWhenNeeded;
};
notExcluded = pkg: utils.disablePackageByName pkg config.environment.budgie.excludePackages;
in
{
meta.maintainers = lib.teams.budgie.members;
options = {
services.xserver.desktopManager.budgie = {
enable = mkEnableOption "the Budgie desktop";
sessionPath = mkOption {
description = ''
Additional list of packages to be added to the session search path.
Useful for GSettings-conditional autostart.
Note that this should be a last resort; patching the package is preferred (see GPaste).
'';
type = types.listOf types.package;
default = [ ];
example = literalExpression "[ pkgs.gpaste ]";
};
extraGSettingsOverrides = mkOption {
description = "Additional GSettings overrides.";
type = types.lines;
default = "";
};
extraGSettingsOverridePackages = mkOption {
description = "List of packages for which GSettings are overridden.";
type = types.listOf types.path;
default = [ ];
};
extraPlugins = mkOption {
description = "Extra plugins for the Budgie desktop";
type = types.listOf types.package;
default = [ ];
example = literalExpression "[ pkgs.budgie-analogue-clock-applet ]";
};
};
environment.budgie.excludePackages = mkOption {
description = "Which packages Budgie should exclude from the default environment.";
type = types.listOf types.package;
default = [ ];
example = literalExpression "[ pkgs.mate-terminal ]";
};
};
config = mkIf cfg.enable {
services.displayManager.sessionPackages = with pkgs; [
budgie-desktop
];
services.xserver.displayManager.lightdm.greeters.slick = {
enable = mkDefault true;
theme = mkDefault {
name = "Qogir";
package = pkgs.qogir-theme;
};
iconTheme = mkDefault {
name = "Qogir";
package = pkgs.qogir-icon-theme;
};
cursorTheme = mkDefault {
name = "Qogir";
package = pkgs.qogir-icon-theme;
};
};
services.xserver.desktopManager.budgie.sessionPath = [ pkgs.budgie-desktop-view ];
environment.extraInit = ''
${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
if [ -d "${p}/lib/girepository-1.0" ]; then
export GI_TYPELIB_PATH=$GI_TYPELIB_PATH''${GI_TYPELIB_PATH:+:}${p}/lib/girepository-1.0
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}${p}/lib
fi
'') cfg.sessionPath}
''
+ lib.optionalString config.services.gnome.gcr-ssh-agent.enable ''
# Hack: https://bugzilla.redhat.com/show_bug.cgi?id=2250704 still
# applies to sessions not managed by systemd.
if [ -z "$SSH_AUTH_SOCK" ] && [ -n "$XDG_RUNTIME_DIR" ]; then
export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/gcr/ssh"
fi
'';
environment.systemPackages =
with pkgs;
[
# Budgie Desktop.
budgie-backgrounds
budgie-control-center'
(budgie-desktop-with-plugins.override { plugins = cfg.extraPlugins; })
budgie-desktop-view
budgie-screensaver
budgie-session
# Required by Budgie Menu.
gnome-menus
# Required by Budgie Control Center.
zenity
# Provides `gsettings`.
glib
# Update user directories.
xdg-user-dirs
]
++ lib.optional config.networking.networkmanager.enable pkgs.networkmanagerapplet
++ (utils.removePackagesByName [
nemo
mate.eom
mate.pluma
mate.atril
mate.engrampa
mate.mate-calc
mate.mate-system-monitor
vlc
# Desktop themes.
qogir-theme
qogir-icon-theme
nixos-background-info
# Default settings.
nixos-gsettings-overrides
] config.environment.budgie.excludePackages)
++ cfg.sessionPath;
# Both budgie-desktop-view and nemo defaults to this emulator.
programs.gnome-terminal.enable = mkDefault (notExcluded pkgs.gnome-terminal);
# Fonts.
fonts.packages = [
pkgs.noto-fonts
pkgs.hack-font
];
fonts.fontconfig.defaultFonts = {
sansSerif = mkDefault [ "Noto Sans" ];
monospace = mkDefault [ "Hack" ];
};
environment.pathsToLink = [
"/share" # TODO: https://github.com/NixOS/nixpkgs/issues/47173
];
# GSettings overrides.
environment.sessionVariables.NIX_GSETTINGS_OVERRIDES_DIR = "${nixos-gsettings-overrides}/share/gsettings-schemas/nixos-gsettings-overrides/glib-2.0/schemas";
# Required by Budgie Desktop.
services.xserver.updateDbusEnvironment = true;
programs.dconf.enable = true;
# Required by Budgie Screensaver.
security.pam.services.budgie-screensaver = { };
# Required by Budgie's Polkit Dialog.
security.polkit.enable = mkDefault true;
# Required by Budgie Panel plugins and/or Budgie Control Center panels.
networking.networkmanager.enable = mkDefault true; # for BCC's Network panel.
programs.nm-applet.enable = config.networking.networkmanager.enable; # Budgie has no Network applet.
programs.nm-applet.indicator = true; # Budgie uses AppIndicators.
hardware.bluetooth.enable = mkDefault true; # for Budgie's Status Indicator and BCC's Bluetooth panel.
xdg.portal.enable = mkDefault true; # for BCC's Applications panel.
xdg.portal.extraPortals = with pkgs; [
xdg-desktop-portal-gtk # provides a XDG Portals implementation.
];
xdg.portal.configPackages = mkDefault [ pkgs.budgie-desktop ];
services.geoclue2.enable = mkDefault true; # for BCC's Privacy > Location Services panel.
services.upower.enable = config.powerManagement.enable; # for Budgie's Status Indicator and BCC's Power panel.
services.libinput.enable = mkDefault true; # for BCC's Mouse panel.
services.colord.enable = mkDefault true; # for BCC's Color panel.
services.gnome.at-spi2-core.enable = mkDefault true; # for BCC's A11y panel.
services.accounts-daemon.enable = mkDefault true; # for BCC's Users panel.
services.udisks2.enable = mkDefault true; # for BCC's Details panel.
# For BCC's Online Accounts panel.
services.gnome.gnome-online-accounts.enable = mkDefault true;
# For BCC's Printers panel.
services.printing.enable = mkDefault true;
services.system-config-printer.enable = config.services.printing.enable;
# For BCC's Sharing panel.
services.dleyna.enable = mkDefault true;
services.gnome.gnome-user-share.enable = mkDefault true;
services.gnome.rygel.enable = mkDefault true;
# Other default services.
services.gnome.evolution-data-server.enable = mkDefault true;
services.gnome.glib-networking.enable = mkDefault true;
services.gnome.gnome-keyring.enable = mkDefault true;
services.gnome.gcr-ssh-agent.enable = mkDefault true;
services.gnome.gnome-settings-daemon.enable = mkDefault true;
services.gvfs.enable = mkDefault true;
# Register packages for DBus.
services.dbus.packages = [
budgie-control-center'
];
# Register packages for udev.
services.udev.packages = with pkgs; [
magpie
];
# Shell integration for MATE Terminal.
programs.bash.vteIntegration = true;
programs.zsh.vteIntegration = true;
};
}

View File

@@ -0,0 +1,90 @@
{
config,
lib,
pkgs,
...
}:
with lib;
let
xcfg = config.services.xserver;
cfg = xcfg.desktopManager.cde;
in
{
options.services.xserver.desktopManager.cde = {
enable = mkEnableOption "Common Desktop Environment";
extraPackages = mkOption {
type = with types; listOf package;
default = with pkgs.xorg; [
xclock
bitmap
xlsfonts
xfd
xrefresh
xload
xwininfo
xdpyinfo
xwd
xwud
];
defaultText = literalExpression ''
with pkgs.xorg; [
xclock bitmap xlsfonts xfd xrefresh xload xwininfo xdpyinfo xwd xwud
]
'';
description = ''
Extra packages to be installed system wide.
'';
};
};
config = mkIf (xcfg.enable && cfg.enable) {
environment.systemPackages = cfg.extraPackages;
services.rpcbind.enable = true;
services.xinetd.enable = true;
services.xinetd.services = [
{
name = "cmsd";
protocol = "udp";
user = "root";
server = "${pkgs.cdesktopenv}/bin/rpc.cmsd";
extraConfig = ''
type = RPC UNLISTED
rpc_number = 100068
rpc_version = 2-5
only_from = 127.0.0.1/0
'';
}
];
users.groups.mail = { };
security.wrappers = {
dtmail = {
setgid = true;
owner = "root";
group = "mail";
source = "${pkgs.cdesktopenv}/bin/dtmail";
};
};
system.activationScripts.setup-cde = ''
mkdir -p /var/dt/{tmp,appconfig/appmanager}
chmod a+w+t /var/dt/{tmp,appconfig/appmanager}
'';
services.xserver.desktopManager.session = [
{
name = "CDE";
start = ''
exec ${pkgs.cdesktopenv}/bin/Xsession
'';
}
];
};
meta.maintainers = [ ];
}

View File

@@ -0,0 +1,275 @@
{
config,
lib,
pkgs,
utils,
...
}:
with lib;
let
cfg = config.services.xserver.desktopManager.cinnamon;
serviceCfg = config.services.cinnamon;
nixos-gsettings-overrides = pkgs.cinnamon-gsettings-overrides.override {
extraGSettingsOverridePackages = cfg.extraGSettingsOverridePackages;
extraGSettingsOverrides = cfg.extraGSettingsOverrides;
};
notExcluded = pkg: utils.disablePackageByName pkg config.environment.cinnamon.excludePackages;
in
{
options = {
services.cinnamon = {
apps.enable = mkEnableOption "Cinnamon default applications";
};
services.xserver.desktopManager.cinnamon = {
enable = mkEnableOption "the cinnamon desktop manager";
sessionPath = mkOption {
default = [ ];
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.
Note that this should be a last resort; patching the package is preferred (see GPaste).
'';
};
extraGSettingsOverrides = mkOption {
default = "";
type = types.lines;
description = "Additional gsettings overrides.";
};
extraGSettingsOverridePackages = mkOption {
default = [ ];
type = types.listOf types.path;
description = "List of packages for which gsettings are overridden.";
};
};
environment.cinnamon.excludePackages = mkOption {
default = [ ];
example = literalExpression "[ pkgs.blueman ]";
type = types.listOf types.package;
description = "Which packages cinnamon should exclude from the default environment";
};
};
config = mkMerge [
(mkIf cfg.enable {
services.displayManager.sessionPackages = [ pkgs.cinnamon ];
services.xserver.displayManager.lightdm.greeters.slick = {
enable = mkDefault true;
# Taken from mint-artwork.gschema.override
theme = mkIf (notExcluded pkgs.mint-themes) {
name = mkDefault "Mint-Y-Aqua";
package = mkDefault pkgs.mint-themes;
};
iconTheme = mkIf (notExcluded pkgs.mint-y-icons) {
name = mkDefault "Mint-Y-Sand";
package = mkDefault pkgs.mint-y-icons;
};
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 = ''
${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
if [ -d "${p}/lib/girepository-1.0" ]; then
export GI_TYPELIB_PATH=$GI_TYPELIB_PATH''${GI_TYPELIB_PATH:+:}${p}/lib/girepository-1.0
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}${p}/lib
fi
'') cfg.sessionPath}
''
+ lib.optionalString config.services.gnome.gcr-ssh-agent.enable ''
# Hack: https://bugzilla.redhat.com/show_bug.cgi?id=2250704 still
# applies to sessions not managed by systemd.
if [ -z "$SSH_AUTH_SOCK" ] && [ -n "$XDG_RUNTIME_DIR" ]; then
export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/gcr/ssh"
fi
'';
# Default services
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 = (mkIf config.services.printing.enable (mkDefault true));
services.dbus.packages = with pkgs; [
cinnamon
cinnamon-screensaver
nemo-with-extensions
xapp
];
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.gnome.gcr-ssh-agent.enable = mkDefault true;
services.gvfs.enable = 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 = mkDefault config.powerManagement.enable;
services.libinput.enable = mkDefault true;
services.xserver.updateDbusEnvironment = true;
networking.networkmanager.enable = mkDefault true;
# Enable colord server
services.colord.enable = true;
# Enable dconf
programs.dconf.enable = true;
# Enable org.a11y.Bus
services.gnome.at-spi2-core.enable = true;
# Fix lockscreen
security.pam.services = {
cinnamon-screensaver = { };
};
environment.systemPackages =
with pkgs;
(
[
# Teach nemo-desktop how to launch file browser.
# https://github.com/linuxmint/nemo/blob/6.4.0/src/nemo-desktop-application.c#L398
(writeTextFile {
name = "x-cinnamon-mimeapps";
destination = "/share/applications/x-cinnamon-mimeapps.list";
text = ''
[Default Applications]
inode/directory=nemo.desktop
'';
})
desktop-file-utils
# common-files
cinnamon
cinnamon-session
cinnamon-desktop
cinnamon-menus
cinnamon-translations
# utils needed by some scripts
killall
# session requirements
cinnamon-screensaver
# cinnamon-killer-daemon: provided by cinnamon
networkmanagerapplet # session requirement - also nm-applet not needed
# packages
nemo-with-extensions
gnome-online-accounts-gtk
cinnamon-control-center
cinnamon-settings-daemon
libgnomekbd
# theme
adwaita-icon-theme
gnome-themes-extra
gtk3.out
# other
glib # for gsettings
xdg-user-dirs
]
++ utils.removePackagesByName [
# accessibility
onboard
# theme
sound-theme-freedesktop
nixos-artwork.wallpapers.simple-dark-gray
mint-artwork
mint-cursor-themes
mint-l-icons
mint-l-theme
mint-themes
mint-x-icons
mint-y-icons
xapp # provides some xapp-* icons
] config.environment.cinnamon.excludePackages
);
xdg.mime.enable = true;
xdg.icons.enable = true;
xdg.portal.enable = true;
xdg.portal.extraPortals = [
pkgs.xdg-desktop-portal-xapp
pkgs.xdg-desktop-portal-gtk
];
services.orca.enable = mkDefault (notExcluded pkgs.orca);
xdg.portal.configPackages = mkDefault [ pkgs.cinnamon ];
# Override GSettings schemas
environment.sessionVariables.NIX_GSETTINGS_OVERRIDES_DIR = "${nixos-gsettings-overrides}/share/gsettings-schemas/nixos-gsettings-overrides/glib-2.0/schemas";
environment.pathsToLink = [
# FIXME: modules should link subdirs of `/share` rather than relying on this
"/share" # TODO: https://github.com/NixOS/nixpkgs/issues/47173
];
# Shell integration for VTE terminals
programs.bash.vteIntegration = mkDefault true;
programs.zsh.vteIntegration = mkDefault true;
# Default Fonts
fonts.packages = with pkgs; [
dejavu_fonts # Default monospace font in LMDE 6+
ubuntu-classic # required for default theme
];
})
(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
bulky
warpinator
# cinnamon xapp
xviewer
xreader
xed-editor
pix
# external apps shipped with linux-mint
celluloid
gnome-calculator
gnome-calendar
gnome-screenshot
] config.environment.cinnamon.excludePackages;
})
];
}

View File

@@ -0,0 +1,120 @@
{
config,
lib,
pkgs,
...
}:
let
inherit (lib) mkOption types;
xcfg = config.services.xserver;
cfg = xcfg.desktopManager;
# If desktop manager `d' isn't capable of setting a background and
# the xserver is enabled, `feh' or `xsetroot' are used as a fallback.
needBGCond = d: !(d ? bgSupport && d.bgSupport) && xcfg.enable;
in
{
# Note: the order in which desktop manager modules are imported here
# determines the default: later modules (if enabled) are preferred.
# E.g., if Plasma 5 is enabled, it supersedes xterm.
imports = [
./none.nix
./xterm.nix
./phosh.nix
./xfce.nix
../../desktop-managers/plasma6.nix
./lumina.nix
./lxqt.nix
./enlightenment.nix
./retroarch.nix
./kodi.nix
./mate.nix
../../desktop-managers/pantheon.nix
./surf-display.nix
./cde.nix
./cinnamon.nix
./budgie.nix
../../desktop-managers/lomiri.nix
../../desktop-managers/cosmic.nix
../../desktop-managers/gnome.nix
];
options = {
services.xserver.desktopManager = {
wallpaper = {
mode = mkOption {
type = types.enum [
"center"
"fill"
"max"
"scale"
"tile"
];
default = "scale";
example = "fill";
description = ''
The file {file}`~/.background-image` is used as a background image.
This option specifies the placement of this image onto your desktop.
Possible values:
`center`: Center the image on the background. If it is too small, it will be surrounded by a black border.
`fill`: Like `scale`, but preserves aspect ratio by zooming the image until it fits. Either a horizontal or a vertical part of the image will be cut off.
`max`: Like `fill`, but scale the image to the maximum size that fits the screen with black borders on one side.
`scale`: Fit the file into the background without repeating it, cutting off stuff or using borders. But the aspect ratio is not preserved either.
`tile`: Tile (repeat) the image in case it is too small for the screen.
'';
};
combineScreens = mkOption {
type = types.bool;
default = false;
description = ''
When set to `true` the wallpaper will stretch across all screens.
When set to `false` the wallpaper is duplicated to all screens.
'';
};
};
session = mkOption {
internal = true;
default = [ ];
example = lib.singleton {
name = "kde";
bgSupport = true;
start = "...";
};
description = ''
Internal option used to add some common line to desktop manager
scripts before forwarding the value to the
`displayManager`.
'';
apply = map (
d:
d
// {
manage = "desktop";
start =
d.start
# literal newline to ensure d.start's last line is not appended to
+ lib.optionalString (needBGCond d) ''
if [ -e $HOME/.background-image ]; then
${pkgs.feh}/bin/feh --bg-${cfg.wallpaper.mode} ${lib.optionalString cfg.wallpaper.combineScreens "--no-xinerama"} $HOME/.background-image
fi
'';
}
);
};
};
};
config.services.xserver.displayManager.session = cfg.session;
}

View File

@@ -0,0 +1,140 @@
{
config,
lib,
pkgs,
utils,
...
}:
with lib;
let
e = pkgs.enlightenment;
xcfg = config.services.xserver;
cfg = xcfg.desktopManager.enlightenment;
GST_PLUGIN_PATH = lib.makeSearchPathOutput "lib" "lib/gstreamer-1.0" [
pkgs.gst_all_1.gst-plugins-base
pkgs.gst_all_1.gst-plugins-good
pkgs.gst_all_1.gst-plugins-bad
pkgs.gst_all_1.gst-libav
];
in
{
meta = {
maintainers = teams.enlightenment.members;
};
imports = [
(mkRenamedOptionModule
[ "services" "xserver" "desktopManager" "e19" "enable" ]
[ "services" "xserver" "desktopManager" "enlightenment" "enable" ]
)
];
options = {
services.xserver.desktopManager.enlightenment.enable = mkOption {
type = types.bool;
default = false;
description = "Enable the Enlightenment desktop environment.";
};
environment.enlightenment.excludePackages = mkOption {
default = [ ];
example = literalExpression "[ pkgs.enlightenment.ephoto ]";
type = types.listOf types.package;
description = "Which packages Enlightenment should exclude from the default environment";
};
};
config = mkIf cfg.enable {
environment.systemPackages = utils.removePackagesByName (with pkgs; [
enlightenment.econnman
enlightenment.efl
enlightenment.enlightenment
enlightenment.ecrire
enlightenment.ephoto
enlightenment.rage
enlightenment.terminology
xorg.xcursorthemes
]) config.environment.enlightenment.excludePackages;
environment.pathsToLink = [
"/etc/enlightenment"
"/share/enlightenment"
"/share/elementary"
"/share/locale"
];
services.displayManager.sessionPackages = [ pkgs.enlightenment.enlightenment ];
services.xserver.displayManager.sessionCommands = ''
if test "$XDG_CURRENT_DESKTOP" = "Enlightenment"; then
export GST_PLUGIN_PATH="${GST_PLUGIN_PATH}"
# make available for D-BUS user services
#export XDG_DATA_DIRS=$XDG_DATA_DIRS''${XDG_DATA_DIRS:+:}:${config.system.path}/share:${e.efl}/share
# Update user dirs as described in https://freedesktop.org/wiki/Software/xdg-user-dirs/
${pkgs.xdg-user-dirs}/bin/xdg-user-dirs-update
fi
'';
# Wrappers for programs installed by enlightenment that should be setuid
security.wrappers = {
enlightenment_ckpasswd = {
setuid = true;
owner = "root";
group = "root";
source = "${pkgs.enlightenment.enlightenment}/lib/enlightenment/utils/enlightenment_ckpasswd";
};
enlightenment_sys = {
setuid = true;
owner = "root";
group = "root";
source = "${pkgs.enlightenment.enlightenment}/lib/enlightenment/utils/enlightenment_sys";
};
enlightenment_system = {
setuid = true;
owner = "root";
group = "root";
source = "${pkgs.enlightenment.enlightenment}/lib/enlightenment/utils/enlightenment_system";
};
};
environment.etc."X11/xkb".source = xcfg.xkb.dir;
fonts.packages = [ pkgs.dejavu_fonts ];
services.udisks2.enable = true;
services.upower.enable = config.powerManagement.enable;
services.libinput.enable = mkDefault true;
services.dbus.packages = [ e.efl ];
systemd.user.services.efreet = {
enable = true;
description = "org.enlightenment.Efreet";
serviceConfig = {
ExecStart = "${e.efl}/bin/efreetd";
StandardOutput = "null";
};
};
systemd.user.services.ethumb = {
enable = true;
description = "org.enlightenment.Ethumb";
serviceConfig = {
ExecStart = "${e.efl}/bin/ethumbd";
StandardOutput = "null";
};
};
};
}

View File

@@ -0,0 +1,42 @@
{
config,
lib,
pkgs,
...
}:
with lib;
let
cfg = config.services.xserver.desktopManager.kodi;
in
{
options = {
services.xserver.desktopManager.kodi = {
enable = mkOption {
type = types.bool;
default = false;
description = "Enable the kodi multimedia center.";
};
package = mkPackageOption pkgs "kodi" {
example = "kodi.withPackages (p: with p; [ jellyfin pvr-iptvsimple vfs-sftp ])";
};
};
};
config = mkIf cfg.enable {
services.xserver.desktopManager.session = [
{
name = "kodi";
start = ''
LIRC_SOCKET_PATH=/run/lirc/lircd ${cfg.package}/bin/kodi --standalone &
waitPID=$!
'';
}
];
environment.systemPackages = [ cfg.package ];
};
}

View File

@@ -0,0 +1,48 @@
{
config,
lib,
pkgs,
...
}:
with lib;
let
xcfg = config.services.xserver;
cfg = xcfg.desktopManager.lumina;
in
{
meta = {
maintainers = teams.lumina.members;
};
options = {
services.xserver.desktopManager.lumina.enable = mkOption {
type = types.bool;
default = false;
description = "Enable the Lumina desktop manager";
};
};
config = mkIf cfg.enable {
services.displayManager.sessionPackages = [
pkgs.lumina.lumina
];
environment.systemPackages = pkgs.lumina.preRequisitePackages ++ pkgs.lumina.corePackages;
# Link some extra directories in /run/current-system/software/share
environment.pathsToLink = [
"/share/lumina"
# FIXME: modules should link subdirs of `/share` rather than relying on this
"/share"
];
};
}

View File

@@ -0,0 +1,99 @@
{
config,
lib,
pkgs,
utils,
...
}:
with lib;
let
cfg = config.services.xserver.desktopManager.lxqt;
in
{
meta = {
maintainers = teams.lxqt.members;
};
options = {
services.xserver.desktopManager.lxqt.enable = mkEnableOption "the LXQt desktop manager";
services.xserver.desktopManager.lxqt.iconThemePackage =
lib.mkPackageOption pkgs [ "kdePackages" "breeze-icons" ] { }
// {
description = "The package that provides a default icon theme.";
};
services.xserver.desktopManager.lxqt.extraPackages = lib.mkOption {
type = with lib.types; listOf package;
default = [ ];
defaultText = lib.literalExpression "[ ]";
example = lib.literalExpression "with pkgs; [ xscreensaver ]";
description = "Extra packages to be installed system wide.";
};
environment.lxqt.excludePackages = mkOption {
type = with lib.types; listOf package;
default = [ ];
defaultText = lib.literalExpression "[ ]";
example = lib.literalExpression "with pkgs; [ lxqt.qterminal ]";
description = "Which LXQt packages to exclude from the default environment";
};
};
config = mkIf cfg.enable {
services.xserver.desktopManager.session = singleton {
name = "lxqt";
bgSupport = true;
start = ''
# Upstream installs default configuration files in
# $prefix/share/lxqt instead of $prefix/etc/xdg, (arguably)
# giving distributors freedom to ship custom default
# configuration files more easily. In order to let the session
# manager find them the share subdirectory is added to the
# XDG_CONFIG_DIRS environment variable.
#
# For an explanation see
# https://github.com/lxqt/lxqt/issues/1521#issuecomment-405097453
#
export XDG_CONFIG_DIRS=$XDG_CONFIG_DIRS''${XDG_CONFIG_DIRS:+:}${config.system.path}/share
exec ${pkgs.lxqt.lxqt-session}/bin/startlxqt
'';
};
environment.systemPackages =
pkgs.lxqt.preRequisitePackages
++ pkgs.lxqt.corePackages
++ [ cfg.iconThemePackage ]
++ (utils.removePackagesByName pkgs.lxqt.optionalPackages config.environment.lxqt.excludePackages)
++ cfg.extraPackages;
# Link some extra directories in /run/current-system/software/share
environment.pathsToLink = [ "/share" ];
programs.gnupg.agent.pinentryPackage = mkDefault pkgs.pinentry-qt;
# virtual file systems support for PCManFM-QT
services.gvfs.enable = mkDefault true;
services.upower.enable = config.powerManagement.enable;
services.libinput.enable = mkDefault true;
xdg.portal.lxqt.enable = mkDefault true;
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1050804
xdg.portal.config.lxqt.default = mkDefault [
"lxqt"
"gtk"
];
};
}

View File

@@ -0,0 +1,124 @@
{
config,
lib,
pkgs,
utils,
...
}:
with lib;
let
xcfg = config.services.xserver;
cfg = xcfg.desktopManager.mate;
in
{
options = {
services.xserver.desktopManager.mate = {
enable = mkOption {
type = types.bool;
default = false;
description = "Enable the MATE desktop environment";
};
debug = mkEnableOption "mate-session debug messages";
extraPanelApplets = mkOption {
default = [ ];
example = literalExpression "with pkgs.mate; [ mate-applets ]";
type = types.listOf types.package;
description = "Extra applets to add to mate-panel.";
};
extraCajaExtensions = mkOption {
default = [ ];
example = lib.literalExpression "with pkgs.mate; [ caja-extensions ]";
type = types.listOf types.package;
description = "Extra extensions to add to caja.";
};
enableWaylandSession = mkEnableOption "MATE Wayland session";
};
environment.mate.excludePackages = mkOption {
default = [ ];
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 = mkMerge [
(mkIf (cfg.enable || cfg.enableWaylandSession) {
services.displayManager.sessionPackages = [
pkgs.mate.mate-session-manager
];
environment.extraInit = lib.optionalString config.services.gnome.gcr-ssh-agent.enable ''
# Hack: https://bugzilla.redhat.com/show_bug.cgi?id=2250704 still
# applies to sessions not managed by systemd.
if [ -z "$SSH_AUTH_SOCK" ] && [ -n "$XDG_RUNTIME_DIR" ]; then
export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/gcr/ssh"
fi
'';
# Debugging
environment.sessionVariables.MATE_SESSION_DEBUG = mkIf cfg.debug "1";
environment.systemPackages = utils.removePackagesByName (
pkgs.mate.basePackages
++ pkgs.mate.extraPackages
++ [
(pkgs.mate.caja-with-extensions.override {
extensions = cfg.extraCajaExtensions;
})
(pkgs.mate.mate-panel-with-applets.override {
applets = cfg.extraPanelApplets;
})
pkgs.desktop-file-utils
pkgs.glib
pkgs.gtk3.out
pkgs.shared-mime-info
pkgs.xdg-user-dirs # Update user dirs as described in https://freedesktop.org/wiki/Software/xdg-user-dirs/
pkgs.yelp # for 'Contents' in 'Help' menus
]
) config.environment.mate.excludePackages;
programs.dconf.enable = true;
# Shell integration for VTE terminals
programs.bash.vteIntegration = mkDefault true;
programs.zsh.vteIntegration = mkDefault true;
# Mate uses this for printing
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.gnome.gnome-keyring.enable = true;
services.gnome.gcr-ssh-agent.enable = mkDefault true;
services.udev.packages = [ pkgs.mate.mate-settings-daemon ];
services.gvfs.enable = true;
services.upower.enable = config.powerManagement.enable;
services.libinput.enable = mkDefault true;
security.pam.services.mate-screensaver.unixAuth = true;
xdg.portal.configPackages = mkDefault [ pkgs.mate.mate-desktop ];
environment.pathsToLink = [ "/share" ];
})
(mkIf cfg.enableWaylandSession {
programs.wayfire.enable = true;
environment.sessionVariables.NIX_GSETTINGS_OVERRIDES_DIR = "${pkgs.mate.mate-gsettings-overrides}/share/gsettings-schemas/nixos-gsettings-overrides/glib-2.0/schemas";
environment.systemPackages = [ pkgs.mate.mate-wayland-session ];
services.displayManager.sessionPackages = [ pkgs.mate.mate-wayland-session ];
})
];
}

View File

@@ -0,0 +1,57 @@
{
config,
lib,
pkgs,
...
}:
with lib;
let
runXdgAutostart = config.services.xserver.desktopManager.runXdgAutostartIfNone;
in
{
options = {
services.xserver.desktopManager.runXdgAutostartIfNone = mkOption {
type = types.bool;
default = false;
description = ''
Whether to run XDG autostart files for sessions without a desktop manager
(with only a window manager), these sessions usually don't handle XDG
autostart files by default.
Some services like {option}`i18n.inputMethod` and
{option}`service.earlyoom` use XDG autostart files to start.
If this option is not set to `true` and you are using
a window manager without a desktop manager, you need to manually start
them or running `dex` somewhere.
'';
};
};
config = mkMerge [
{
services.xserver.desktopManager.session = [
{
name = "none";
start = optionalString runXdgAutostart ''
/run/current-system/systemd/bin/systemctl --user start xdg-autostart-if-no-desktop-manager.target
'';
}
];
}
(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`.
requires = [
"xdg-desktop-autostart.target"
"graphical-session.target"
];
before = [
"xdg-desktop-autostart.target"
"graphical-session.target"
];
bindsTo = [ "graphical-session.target" ];
};
})
];
}

View File

@@ -0,0 +1,254 @@
{
config,
lib,
pkgs,
...
}:
let
cfg = config.services.xserver.desktopManager.phosh;
# Based on https://source.puri.sm/Librem5/librem5-base/-/blob/4596c1056dd75ac7f043aede07887990fd46f572/default/sm.puri.OSK0.desktop
oskItem = pkgs.makeDesktopItem {
name = "sm.puri.OSK0";
desktopName = "On-screen keyboard";
exec = "${pkgs.squeekboard}/bin/squeekboard";
categories = [
"GNOME"
"Core"
];
onlyShowIn = [ "GNOME" ];
noDisplay = true;
extraConfig = {
X-GNOME-Autostart-Phase = "Panel";
X-GNOME-Provides = "inputmethod";
X-GNOME-Autostart-Notify = "true";
X-GNOME-AutoRestart = "true";
};
};
phocConfigType = lib.types.submodule {
options = {
xwayland = lib.mkOption {
description = ''
Whether to enable XWayland support.
To start XWayland immediately, use `immediate`.
'';
type = lib.types.enum [
"true"
"false"
"immediate"
];
default = "false";
};
cursorTheme = lib.mkOption {
description = ''
Cursor theme to use in Phosh.
'';
type = lib.types.str;
default = "default";
};
outputs = lib.mkOption {
description = ''
Output configurations.
'';
type = lib.types.attrsOf phocOutputType;
default = {
DSI-1 = {
scale = 2;
};
};
};
};
};
phocOutputType = lib.types.submodule {
options = {
modeline = lib.mkOption {
description = ''
One or more modelines.
'';
type = lib.types.either lib.types.str (lib.types.listOf lib.types.str);
default = [ ];
example = [
"87.25 720 776 848 976 1440 1443 1453 1493 -hsync +vsync"
"65.13 768 816 896 1024 1024 1025 1028 1060 -HSync +VSync"
];
};
mode = lib.mkOption {
description = ''
Default video mode.
'';
type = lib.types.nullOr lib.types.str;
default = null;
example = "768x1024";
};
scale = lib.mkOption {
description = ''
Display scaling factor.
'';
type =
lib.types.nullOr (lib.types.addCheck (lib.types.either lib.types.int lib.types.float) (x: x > 0))
// {
description = "null or positive integer or float";
};
default = null;
example = 2;
};
rotate = lib.mkOption {
description = ''
Screen transformation.
'';
type = lib.types.enum [
"90"
"180"
"270"
"flipped"
"flipped-90"
"flipped-180"
"flipped-270"
null
];
default = null;
};
};
};
optionalKV = k: v: lib.optionalString (v != null) "${k} = ${builtins.toString v}";
renderPhocOutput =
name: output:
let
modelines = if builtins.isList output.modeline then output.modeline else [ output.modeline ];
renderModeline = l: "modeline = ${l}";
in
''
[output:${name}]
${lib.concatStringsSep "\n" (map renderModeline modelines)}
${optionalKV "mode" output.mode}
${optionalKV "scale" output.scale}
${optionalKV "rotate" output.rotate}
'';
renderPhocConfig =
phoc:
let
outputs = lib.mapAttrsToList renderPhocOutput phoc.outputs;
in
''
[core]
xwayland = ${phoc.xwayland}
${lib.concatStringsSep "\n" outputs}
[cursor]
theme = ${phoc.cursorTheme}
'';
in
{
options = {
services.xserver.desktopManager.phosh = {
enable = lib.mkOption {
type = lib.types.bool;
default = false;
description = "Enable the Phone Shell.";
};
package = lib.mkPackageOption pkgs "phosh" { };
user = lib.mkOption {
description = "The user to run the Phosh service.";
type = lib.types.str;
example = "alice";
};
group = lib.mkOption {
description = "The group to run the Phosh service.";
type = lib.types.str;
example = "users";
};
phocConfig = lib.mkOption {
description = ''
Configurations for the Phoc compositor.
'';
type = lib.types.oneOf [
lib.types.lines
lib.types.path
phocConfigType
];
default = { };
};
};
};
config = lib.mkIf cfg.enable {
# Inspired by https://gitlab.gnome.org/World/Phosh/phosh/-/blob/main/data/phosh.service
systemd.services.phosh = {
wantedBy = [ "graphical.target" ];
serviceConfig = {
ExecStart = "${cfg.package}/bin/phosh-session";
User = cfg.user;
Group = cfg.group;
PAMName = "login";
WorkingDirectory = "~";
Restart = "always";
TTYPath = "/dev/tty7";
TTYReset = "yes";
TTYVHangup = "yes";
TTYVTDisallocate = "yes";
# Fail to start if not controlling the tty.
StandardInput = "tty-fail";
StandardOutput = "journal";
StandardError = "journal";
# Log this user with utmp, letting it show up with commands 'w' and 'who'.
UtmpIdentifier = "tty7";
UtmpMode = "user";
};
environment = {
# We are running without a display manager, so need to provide
# a value for XDG_CURRENT_DESKTOP.
#
# Among other things, this variable influences:
# - visibility of desktop entries with "OnlyShowIn=Phosh;"
# https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-1.5.html#key-onlyshowin
# - the chosen xdg-desktop-portal configuration.
# https://flatpak.github.io/xdg-desktop-portal/docs/portals.conf.html
XDG_CURRENT_DESKTOP = "Phosh:GNOME";
# pam_systemd uses these to identify the session in logind.
# https://www.freedesktop.org/software/systemd/man/latest/pam_systemd.html#desktop=
XDG_SESSION_DESKTOP = "phosh";
XDG_SESSION_TYPE = "wayland";
};
};
environment.systemPackages = [
pkgs.phoc
cfg.package
pkgs.squeekboard
oskItem
];
systemd.packages = [ cfg.package ];
programs.feedbackd.enable = true;
security.pam.services.phosh = { };
services.graphical-desktop.enable = true;
services.gnome.core-shell.enable = true;
services.gnome.core-os-services.enable = true;
services.displayManager.sessionPackages = [ cfg.package ];
environment.etc."phosh/phoc.ini".source =
if builtins.isPath cfg.phocConfig then
cfg.phocConfig
else if builtins.isString cfg.phocConfig then
pkgs.writeText "phoc.ini" cfg.phocConfig
else
pkgs.writeText "phoc.ini" (renderPhocConfig cfg.phocConfig);
};
}

View File

@@ -0,0 +1,48 @@
{
config,
lib,
pkgs,
...
}:
with lib;
let
cfg = config.services.xserver.desktopManager.retroarch;
in
{
options.services.xserver.desktopManager.retroarch = {
enable = mkEnableOption "RetroArch";
package = mkPackageOption pkgs "retroarch" {
example = "retroarch-full";
};
extraArgs = mkOption {
type = types.listOf types.str;
default = [ ];
example = [
"--verbose"
"--host"
];
description = "Extra arguments to pass to RetroArch.";
};
};
config = mkIf cfg.enable {
services.xserver.desktopManager.session = [
{
name = "RetroArch";
start = ''
${cfg.package}/bin/retroarch -f ${escapeShellArgs cfg.extraArgs} &
waitPID=$!
'';
}
];
environment.systemPackages = [ cfg.package ];
};
meta.maintainers = with maintainers; [ j0hax ];
}

View File

@@ -0,0 +1,134 @@
{
config,
lib,
pkgs,
...
}:
with lib;
let
cfg = config.services.xserver.desktopManager.surf-display;
surfDisplayConf = ''
# Surf Kiosk Display: Wrap around surf browser and turn your
# system into a browser screen in KIOSK-mode.
# default download URI for all display screens if not configured individually
DEFAULT_WWW_URI="${cfg.defaultWwwUri}"
# Enforce fixed resolution for all displays (default: not set):
#DEFAULT_RESOLUTION="1920x1080"
# HTTP proxy URL, if needed (default: not set).
#HTTP_PROXY_URL="http://webcache:3128"
# Setting for internal inactivity timer to restart surf-display
# if the user goes inactive/idle.
INACTIVITY_INTERVAL="${builtins.toString cfg.inactivityInterval}"
# log to syslog instead of .xsession-errors
LOG_TO_SYSLOG="yes"
# Launch pulseaudio daemon if not already running.
WITH_PULSEAUDIO="yes"
# screensaver settings, see "man 1 xset" for possible options
SCREENSAVER_SETTINGS="${cfg.screensaverSettings}"
# disable right and middle pointer device click in browser sessions while keeping
# scrolling wheels' functionality intact... (consider "pointer" subcommand on
# xmodmap man page for details).
POINTER_BUTTON_MAP="${cfg.pointerButtonMap}"
# Hide idle mouse pointer.
HIDE_IDLE_POINTER="${cfg.hideIdlePointer}"
${cfg.extraConfig}
'';
in
{
options = {
services.xserver.desktopManager.surf-display = {
enable = mkEnableOption "surf-display as a kiosk browser session";
defaultWwwUri = mkOption {
type = types.str;
default = "${pkgs.surf-display}/share/surf-display/empty-page.html";
defaultText = literalExpression ''"''${pkgs.surf-display}/share/surf-display/empty-page.html"'';
example = "https://www.example.com/";
description = "Default URI to display.";
};
inactivityInterval = mkOption {
type = types.int;
default = 300;
example = 0;
description = ''
Setting for internal inactivity timer to restart surf-display if the
user goes inactive/idle to get a fresh session for the next user of
the kiosk.
If this value is set to zero, the whole feature of restarting due to
inactivity is disabled.
'';
};
screensaverSettings = mkOption {
type = types.separatedString " ";
default = "";
description = ''
Screensaver settings, see `man 1 xset` for possible options.
'';
};
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
while keeping scrolling wheels' functionality intact. See pointer
subcommand on `man xmodmap` for details.
'';
};
hideIdlePointer = mkOption {
type = types.str;
default = "yes";
example = "no";
description = "Hide idle mouse pointer.";
};
extraConfig = mkOption {
type = types.lines;
default = "";
example = ''
# Enforce fixed resolution for all displays (default: not set):
DEFAULT_RESOLUTION="1920x1080"
# HTTP proxy URL, if needed (default: not set).
HTTP_PROXY_URL="http://webcache:3128"
# Configure individual display screens with host specific parameters:
DISPLAYS['display-host-0']="www_uri=https://www.displayserver.comany.net/display-1/index.html"
DISPLAYS['display-host-1']="www_uri=https://www.displayserver.comany.net/display-2/index.html"
DISPLAYS['display-host-2']="www_uri=https://www.displayserver.comany.net/display-3/index.html|res=1920x1280"
DISPLAYS['display-host-3']="www_uri=https://www.displayserver.comany.net/display-4/index.html"|res=1280x1024"
DISPLAYS['display-host-local-file']="www_uri=file:///usr/share/doc/surf-display/empty-page.html"
'';
description = ''
Extra configuration options to append to `/etc/default/surf-display`.
'';
};
};
};
config = mkIf cfg.enable {
services.displayManager.sessionPackages = [
pkgs.surf-display
];
environment.etc."default/surf-display".text = surfDisplayConf;
};
}

View File

@@ -0,0 +1,249 @@
{
config,
lib,
pkgs,
utils,
...
}:
with lib;
let
cfg = config.services.xserver.desktopManager.xfce;
excludePackages = config.environment.xfce.excludePackages;
in
{
meta = {
maintainers = teams.xfce.members;
};
imports = [
# added 2019-08-18
# needed to preserve some semblance of UI familarity
# with original XFCE module
(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.
(mkRenamedOptionModule
[ "services" "xserver" "desktopManager" "xfce4-14" "enable" ]
[ "services" "xserver" "desktopManager" "xfce" "enable" ]
)
(mkRenamedOptionModule
[ "services" "xserver" "desktopManager" "xfce4-14" "noDesktop" ]
[ "services" "xserver" "desktopManager" "xfce" "noDesktop" ]
)
(mkRenamedOptionModule
[ "services" "xserver" "desktopManager" "xfce4-14" "enableXfwm" ]
[ "services" "xserver" "desktopManager" "xfce" "enableXfwm" ]
)
(mkRenamedOptionModule
[ "services" "xserver" "desktopManager" "xfce" "extraSessionCommands" ]
[ "services" "xserver" "displayManager" "sessionCommands" ]
)
(mkRemovedOptionModule [ "services" "xserver" "desktopManager" "xfce" "screenLock" ] "")
# added 2022-06-26
# thunar has its own module
(mkRenamedOptionModule
[ "services" "xserver" "desktopManager" "xfce" "thunarPlugins" ]
[ "programs" "thunar" "plugins" ]
)
];
options = {
services.xserver.desktopManager.xfce = {
enable = mkOption {
type = types.bool;
default = false;
description = "Enable the Xfce desktop environment.";
};
noDesktop = mkOption {
type = types.bool;
default = false;
description = "Don't install XFCE desktop components (xfdesktop and panel).";
};
enableXfwm = mkOption {
type = types.bool;
default = true;
description = "Enable the XFWM (default) window manager.";
};
enableScreensaver = mkOption {
type = types.bool;
default = true;
description = "Enable the XFCE screensaver.";
};
enableWaylandSession = mkEnableOption "the experimental Xfce Wayland session";
waylandSessionCompositor = mkOption {
type = lib.types.str;
default = "";
example = "wayfire";
description = ''
Command line to run a Wayland compositor, defaults to `labwc --startup`
if not specified. Note that `xfce4-session` will be passed to it as an
argument, see `startxfce4 --help` for details.
Some compositors do not have an option equivalent to labwc's `--startup`
and you might have to add xfce4-session somewhere in their configurations.
'';
};
};
environment.xfce.excludePackages = mkOption {
default = [ ];
example = literalExpression "[ pkgs.xfce.xfce4-volumed-pulse ]";
type = types.listOf types.package;
description = "Which packages XFCE should exclude from the default environment";
};
};
config = mkIf cfg.enable {
environment.systemPackages = utils.removePackagesByName (
with pkgs;
[
glib # for gsettings
gtk3.out # gtk-update-icon-cache
gnome-themes-extra
adwaita-icon-theme
hicolor-icon-theme
tango-icon-theme
xfce.xfce4-icon-theme
desktop-file-utils
shared-mime-info # for update-mime-database
# For a polkit authentication agent
polkit_gnome
# Needed by Xfce's xinitrc script
xdg-user-dirs # Update user dirs as described in https://freedesktop.org/wiki/Software/xdg-user-dirs/
xfce.exo
xfce.garcon
xfce.libxfce4ui
xfce.mousepad
xfce.parole
xfce.ristretto
xfce.xfce4-appfinder
xfce.xfce4-notifyd
xfce.xfce4-screenshooter
xfce.xfce4-session
xfce.xfce4-settings
xfce.xfce4-taskmanager
xfce.xfce4-terminal
]
# TODO: NetworkManager doesn't belong here
++ lib.optional config.networking.networkmanager.enable networkmanagerapplet
++ lib.optional config.powerManagement.enable xfce.xfce4-power-manager
++ lib.optionals (config.services.pulseaudio.enable || config.services.pipewire.pulse.enable) [
pavucontrol
# volume up/down keys support:
# xfce4-pulseaudio-plugin includes all the functionalities of xfce4-volumed-pulse
# but can only be used with xfce4-panel, so for no-desktop usage we still include
# xfce4-volumed-pulse
(if cfg.noDesktop then xfce.xfce4-volumed-pulse else xfce.xfce4-pulseaudio-plugin)
]
++ lib.optionals cfg.enableXfwm [
xfce.xfwm4
xfce.xfwm4-themes
]
++ lib.optionals (!cfg.noDesktop) [
xfce.xfce4-panel
xfce.xfdesktop
]
++ lib.optional cfg.enableScreensaver xfce.xfce4-screensaver
) excludePackages;
programs.gnupg.agent.pinentryPackage = mkDefault pkgs.pinentry-gtk2;
programs.xfconf.enable = true;
programs.thunar.enable = true;
programs.labwc.enable = mkDefault (
cfg.enableWaylandSession
&& (cfg.waylandSessionCompositor == "" || lib.substring 0 5 cfg.waylandSessionCompositor == "labwc")
);
environment.pathsToLink = [
"/share/xfce4"
"/lib/xfce4"
"/share/gtksourceview-3.0"
"/share/gtksourceview-4.0"
];
services.xserver.desktopManager.session = [
{
name = "xfce";
prettyName = "Xfce Session";
desktopNames = [ "XFCE" ];
bgSupport = !cfg.noDesktop;
start = ''
${pkgs.runtimeShell} ${pkgs.xfce.xfce4-session.xinitrc} &
waitPID=$!
'';
}
];
# 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 = optionals cfg.enableWaylandSession [
(
(pkgs.writeTextDir "share/wayland-sessions/xfce-wayland.desktop" ''
[Desktop Entry]
Version=1.0
Name=Xfce Session (Wayland)
Comment=Use this session to run Xfce as your desktop environment
Exec=startxfce4 --wayland ${cfg.waylandSessionCompositor}
Icon=
Type=Application
DesktopNames=XFCE
Keywords=xfce;wayland;desktop;environment;session;
'').overrideAttrs
(_: {
passthru.providedSessions = [ "xfce-wayland" ];
})
)
];
services.xserver.updateDbusEnvironment = true;
programs.gdk-pixbuf.modulePackages = [ pkgs.librsvg ];
# Enable helpful DBus services.
services.udisks2.enable = true;
security.polkit.enable = true;
services.accounts-daemon.enable = true;
services.upower.enable = config.powerManagement.enable;
services.gnome.glib-networking.enable = true;
services.gvfs.enable = true;
services.tumbler.enable = 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 = mkDefault true;
programs.zsh.vteIntegration = mkDefault true;
# Systemd services
systemd.packages = utils.removePackagesByName (with pkgs.xfce; [
xfce4-notifyd
]) excludePackages;
security.pam.services.xfce4-screensaver.unixAuth = cfg.enableScreensaver;
xdg.portal.configPackages = mkDefault [ pkgs.xfce.xfce4-session ];
};
}

View File

@@ -0,0 +1,43 @@
{
config,
lib,
pkgs,
...
}:
with lib;
let
cfg = config.services.xserver.desktopManager.xterm;
xSessionEnabled = config.services.xserver.enable;
in
{
options = {
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 = mkIf cfg.enable {
services.xserver.desktopManager.session = singleton {
name = "xterm";
start = ''
${pkgs.xterm}/bin/xterm -ls &
waitPID=$!
'';
};
environment.systemPackages = [ pkgs.xterm ];
};
}