2022-04-15 01:41:22 +00:00
|
|
|
{ config, lib, utils, pkgs, ... }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
|
|
|
|
cfg = config.services.xserver.desktopManager.pantheon;
|
|
|
|
serviceCfg = config.services.pantheon;
|
|
|
|
|
|
|
|
nixos-gsettings-desktop-schemas = pkgs.pantheon.elementary-gsettings-schemas.override {
|
|
|
|
extraGSettingsOverridePackages = cfg.extraGSettingsOverridePackages;
|
|
|
|
extraGSettingsOverrides = cfg.extraGSettingsOverrides;
|
|
|
|
};
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
notExcluded = pkg: (!(lib.elem pkg config.environment.pantheon.excludePackages));
|
2020-04-24 23:36:52 +00:00
|
|
|
in
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
meta = {
|
2023-02-02 18:25:31 +00:00
|
|
|
doc = ./pantheon.md;
|
2021-09-22 15:38:15 +00:00
|
|
|
maintainers = teams.pantheon.members;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
options = {
|
|
|
|
|
|
|
|
services.pantheon = {
|
|
|
|
|
|
|
|
contractor = {
|
2024-04-21 15:54:59 +00:00
|
|
|
enable = mkEnableOption "contractor, a desktop-wide extension service used by Pantheon";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
apps.enable = mkEnableOption "Pantheon default applications";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
services.xserver.desktopManager.pantheon = {
|
|
|
|
enable = mkOption {
|
|
|
|
type = types.bool;
|
|
|
|
default = false;
|
2024-04-21 15:54:59 +00:00
|
|
|
description = "Enable the pantheon desktop manager";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
sessionPath = mkOption {
|
|
|
|
default = [];
|
2021-02-05 17:12:51 +00:00
|
|
|
type = types.listOf types.package;
|
2024-07-27 06:49:29 +00:00
|
|
|
example = literalExpression "[ pkgs.gpaste ]";
|
2024-04-21 15:54:59 +00:00
|
|
|
description = ''
|
2020-04-24 23:36:52 +00:00
|
|
|
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).
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
extraWingpanelIndicators = mkOption {
|
|
|
|
default = null;
|
|
|
|
type = with types; nullOr (listOf package);
|
2024-04-21 15:54:59 +00:00
|
|
|
description = "Indicators to add to Wingpanel.";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
extraSwitchboardPlugs = mkOption {
|
|
|
|
default = null;
|
|
|
|
type = with types; nullOr (listOf package);
|
2024-04-21 15:54:59 +00:00
|
|
|
description = "Plugs to add to Switchboard.";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
extraGSettingsOverrides = mkOption {
|
|
|
|
default = "";
|
|
|
|
type = types.lines;
|
2024-04-21 15:54:59 +00:00
|
|
|
description = "Additional gsettings overrides.";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
extraGSettingsOverridePackages = mkOption {
|
|
|
|
default = [];
|
|
|
|
type = types.listOf types.path;
|
2024-04-21 15:54:59 +00:00
|
|
|
description = "List of packages for which gsettings are overridden.";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
debug = mkEnableOption "gnome-session debug messages";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
environment.pantheon.excludePackages = mkOption {
|
|
|
|
default = [];
|
2021-10-06 13:57:05 +00:00
|
|
|
example = literalExpression "[ pkgs.pantheon.elementary-camera ]";
|
2020-04-24 23:36:52 +00:00
|
|
|
type = types.listOf types.package;
|
2024-04-21 15:54:59 +00:00
|
|
|
description = "Which packages pantheon should exclude from the default environment";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
config = mkMerge [
|
|
|
|
(mkIf cfg.enable {
|
2022-06-16 17:23:12 +00:00
|
|
|
services.xserver.desktopManager.pantheon.sessionPath = utils.removePackagesByName [
|
|
|
|
pkgs.pantheon.pantheon-agent-geoclue2
|
|
|
|
] config.environment.pantheon.excludePackages;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
services.displayManager.sessionPackages = [ pkgs.pantheon.elementary-session-settings ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
# Ensure lightdm is used when Pantheon is enabled
|
|
|
|
# Without it screen locking will be nonfunctional because of the use of lightlocker
|
|
|
|
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 = mkDefault true;
|
|
|
|
|
|
|
|
# Without this, elementary LightDM greeter will pre-select non-existent `default` session
|
|
|
|
# https://github.com/elementary/greeter/issues/368
|
2024-04-21 15:54:59 +00:00
|
|
|
services.displayManager.defaultSession = mkDefault "pantheon";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
services.xserver.displayManager.sessionCommands = ''
|
|
|
|
if test "$XDG_CURRENT_DESKTOP" = "Pantheon"; then
|
2023-07-15 17:15:38 +00:00
|
|
|
true
|
2020-04-24 23:36:52 +00:00
|
|
|
${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}
|
|
|
|
fi
|
|
|
|
'';
|
|
|
|
|
|
|
|
# Default services
|
|
|
|
hardware.bluetooth.enable = mkDefault true;
|
|
|
|
hardware.pulseaudio.enable = mkDefault true;
|
|
|
|
security.polkit.enable = true;
|
|
|
|
services.accounts-daemon.enable = true;
|
|
|
|
services.bamf.enable = true;
|
|
|
|
services.colord.enable = mkDefault true;
|
2021-09-22 15:38:15 +00:00
|
|
|
services.fwupd.enable = mkDefault true;
|
2022-08-21 13:32:41 +00:00
|
|
|
# TODO: Enable once #177946 is resolved
|
|
|
|
# services.packagekit.enable = mkDefault true;
|
2022-06-16 17:23:12 +00:00
|
|
|
services.power-profiles-daemon.enable = mkDefault true;
|
2021-09-22 15:38:15 +00:00
|
|
|
services.touchegg.enable = mkDefault true;
|
|
|
|
services.touchegg.package = pkgs.pantheon.touchegg;
|
2020-04-24 23:36:52 +00:00
|
|
|
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 = mkDefault true;
|
|
|
|
services.pantheon.contractor.enable = mkDefault true;
|
2021-05-20 23:08:51 +00:00
|
|
|
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;
|
2020-04-24 23:36:52 +00:00
|
|
|
services.gvfs.enable = true;
|
2021-05-20 23:08:51 +00:00
|
|
|
services.gnome.rygel.enable = mkDefault true;
|
2020-04-24 23:36:52 +00:00
|
|
|
services.gsignond.enable = mkDefault true;
|
|
|
|
services.gsignond.plugins = with pkgs.gsignondPlugins; [ lastfm mail oauth ];
|
|
|
|
services.udisks2.enable = true;
|
|
|
|
services.upower.enable = config.powerManagement.enable;
|
2024-05-15 15:35:15 +00:00
|
|
|
services.libinput.enable = mkDefault true;
|
2020-04-24 23:36:52 +00:00
|
|
|
services.xserver.updateDbusEnvironment = 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" = {
|
|
|
|
isAllowed = true;
|
|
|
|
isSystem = true;
|
|
|
|
};
|
|
|
|
services.udev.packages = [
|
2022-06-16 17:23:12 +00:00
|
|
|
pkgs.pantheon.gnome-settings-daemon
|
2023-03-04 12:14:45 +00:00
|
|
|
# Force enable KMS modifiers for devices that require them.
|
|
|
|
# https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1443
|
|
|
|
pkgs.pantheon.mutter
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
2024-04-21 15:54:59 +00:00
|
|
|
systemd.packages = with pkgs; [
|
|
|
|
gnome.gnome-session
|
|
|
|
pantheon.gala
|
|
|
|
pantheon.gnome-settings-daemon
|
|
|
|
pantheon.elementary-session-settings
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
programs.dconf.enable = true;
|
|
|
|
networking.networkmanager.enable = mkDefault true;
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
systemd.user.targets."gnome-session-x11-services".wants = [
|
|
|
|
"org.gnome.SettingsDaemon.XSettings.service"
|
|
|
|
];
|
|
|
|
systemd.user.targets."gnome-session-x11-services-ready".wants = [
|
|
|
|
"org.gnome.SettingsDaemon.XSettings.service"
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
# Global environment
|
2022-06-16 17:23:12 +00:00
|
|
|
environment.systemPackages = (with pkgs.pantheon; [
|
|
|
|
elementary-session-settings
|
|
|
|
elementary-settings-daemon
|
|
|
|
gala
|
|
|
|
gnome-settings-daemon
|
|
|
|
(switchboard-with-plugs.override {
|
|
|
|
plugs = cfg.extraSwitchboardPlugs;
|
|
|
|
})
|
|
|
|
(wingpanel-with-indicators.override {
|
|
|
|
indicators = cfg.extraWingpanelIndicators;
|
|
|
|
})
|
|
|
|
]) ++ utils.removePackagesByName ((with pkgs; [
|
2020-04-24 23:36:52 +00:00
|
|
|
desktop-file-utils
|
2022-06-16 17:23:12 +00:00
|
|
|
glib # for gsettings program
|
2020-04-24 23:36:52 +00:00
|
|
|
gnome-menus
|
2024-07-27 06:49:29 +00:00
|
|
|
adwaita-icon-theme
|
2022-06-16 17:23:12 +00:00
|
|
|
gtk3.out # for gtk-launch program
|
2020-04-24 23:36:52 +00:00
|
|
|
onboard
|
2023-08-04 22:07:22 +00:00
|
|
|
orca # elementary/greeter#668
|
2020-04-24 23:36:52 +00:00
|
|
|
sound-theme-freedesktop
|
2023-11-16 04:20:00 +00:00
|
|
|
xdg-user-dirs # Update user dirs as described in https://freedesktop.org/wiki/Software/xdg-user-dirs/
|
2022-06-16 17:23:12 +00:00
|
|
|
]) ++ (with pkgs.pantheon; [
|
2020-04-24 23:36:52 +00:00
|
|
|
# Artwork
|
|
|
|
elementary-gtk-theme
|
|
|
|
elementary-icon-theme
|
|
|
|
elementary-sound-theme
|
|
|
|
elementary-wallpapers
|
|
|
|
|
|
|
|
# Desktop
|
|
|
|
elementary-default-settings
|
|
|
|
elementary-dock
|
|
|
|
elementary-shortcut-overlay
|
|
|
|
|
|
|
|
# Services
|
|
|
|
elementary-capnet-assist
|
|
|
|
elementary-notifications
|
|
|
|
pantheon-agent-geoclue2
|
|
|
|
pantheon-agent-polkit
|
2022-06-16 17:23:12 +00:00
|
|
|
])) config.environment.pantheon.excludePackages;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
# Settings from elementary-default-settings
|
|
|
|
environment.etc."gtk-3.0/settings.ini".source = "${pkgs.pantheon.elementary-default-settings}/etc/gtk-3.0/settings.ini";
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
xdg.mime.enable = true;
|
|
|
|
xdg.icons.enable = true;
|
|
|
|
|
2022-03-30 09:31:56 +00:00
|
|
|
xdg.portal.enable = true;
|
2023-07-15 17:15:38 +00:00
|
|
|
xdg.portal.extraPortals = [
|
|
|
|
pkgs.xdg-desktop-portal-gtk
|
|
|
|
] ++ (with pkgs.pantheon; [
|
2021-12-19 01:06:50 +00:00
|
|
|
elementary-files
|
|
|
|
elementary-settings-daemon
|
2021-10-28 06:52:43 +00:00
|
|
|
xdg-desktop-portal-pantheon
|
2023-07-15 17:15:38 +00:00
|
|
|
]);
|
2021-09-22 15:38:15 +00:00
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
xdg.portal.configPackages = mkDefault [ pkgs.pantheon.elementary-default-settings ];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
# 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 = mkIf cfg.debug "1";
|
|
|
|
|
|
|
|
environment.pathsToLink = [
|
|
|
|
# FIXME: modules should link subdirs of `/share` rather than relying on this
|
|
|
|
"/share"
|
|
|
|
];
|
|
|
|
|
|
|
|
# Otherwise you can't store NetworkManager Secrets with
|
|
|
|
# "Store the password only for this user"
|
|
|
|
programs.nm-applet.enable = true;
|
2020-09-25 04:45:31 +00:00
|
|
|
# Pantheon has its own network indicator
|
|
|
|
programs.nm-applet.indicator = false;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
# Shell integration for VTE terminals
|
|
|
|
programs.bash.vteIntegration = mkDefault true;
|
|
|
|
programs.zsh.vteIntegration = mkDefault true;
|
|
|
|
|
|
|
|
# Default Fonts
|
2023-08-04 22:07:22 +00:00
|
|
|
fonts.packages = with pkgs; [
|
2021-09-22 15:38:15 +00:00
|
|
|
inter
|
|
|
|
open-dyslexic
|
2020-04-24 23:36:52 +00:00
|
|
|
open-sans
|
|
|
|
roboto-mono
|
|
|
|
];
|
|
|
|
|
|
|
|
fonts.fontconfig.defaultFonts = {
|
|
|
|
monospace = [ "Roboto Mono" ];
|
2021-12-06 16:07:01 +00:00
|
|
|
sansSerif = [ "Inter" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
})
|
|
|
|
|
|
|
|
(mkIf serviceCfg.apps.enable {
|
2024-07-27 06:49:29 +00:00
|
|
|
programs.evince.enable = mkDefault (notExcluded pkgs.evince);
|
|
|
|
programs.file-roller.enable = mkDefault (notExcluded pkgs.file-roller);
|
2022-06-16 17:23:12 +00:00
|
|
|
|
|
|
|
environment.systemPackages = utils.removePackagesByName ([
|
2024-07-27 06:49:29 +00:00
|
|
|
pkgs.gnome-font-viewer
|
2022-06-16 17:23:12 +00:00
|
|
|
] ++ (with pkgs.pantheon; [
|
2020-04-24 23:36:52 +00:00
|
|
|
elementary-calculator
|
|
|
|
elementary-calendar
|
|
|
|
elementary-camera
|
|
|
|
elementary-code
|
|
|
|
elementary-files
|
2021-09-22 15:38:15 +00:00
|
|
|
elementary-mail
|
2020-04-24 23:36:52 +00:00
|
|
|
elementary-music
|
|
|
|
elementary-photos
|
2021-09-22 15:38:15 +00:00
|
|
|
elementary-screenshot
|
2023-04-29 16:46:19 +00:00
|
|
|
elementary-tasks
|
2020-04-24 23:36:52 +00:00
|
|
|
elementary-terminal
|
|
|
|
elementary-videos
|
2021-09-22 15:38:15 +00:00
|
|
|
epiphany
|
2022-02-10 20:34:41 +00:00
|
|
|
] ++ lib.optionals config.services.flatpak.enable [
|
|
|
|
# Only install appcenter if flatpak is enabled before
|
|
|
|
# https://github.com/NixOS/nixpkgs/issues/15932 is resolved.
|
|
|
|
appcenter
|
2022-06-16 17:23:12 +00:00
|
|
|
sideload
|
|
|
|
])) config.environment.pantheon.excludePackages;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-09-22 15:38:15 +00:00
|
|
|
# needed by screenshot
|
2023-08-04 22:07:22 +00:00
|
|
|
fonts.packages = [
|
2020-04-24 23:36:52 +00:00
|
|
|
pkgs.pantheon.elementary-redacted-script
|
|
|
|
];
|
|
|
|
})
|
|
|
|
|
|
|
|
(mkIf serviceCfg.contractor.enable {
|
2021-12-06 16:07:01 +00:00
|
|
|
environment.systemPackages = with pkgs.pantheon; [
|
2020-04-24 23:36:52 +00:00
|
|
|
contractor
|
2021-12-06 16:07:01 +00:00
|
|
|
file-roller-contract
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
environment.pathsToLink = [
|
|
|
|
"/share/contractor"
|
|
|
|
];
|
|
|
|
})
|
|
|
|
|
|
|
|
];
|
|
|
|
}
|