From 1ec2b545dd0384de592d4de2743c6afd6c7f523e Mon Sep 17 00:00:00 2001 From: worldofpeace Date: Fri, 20 Dec 2019 09:25:37 -0500 Subject: [PATCH 1/7] nixos/pantheon/files: remove Made nun sense. --- .../services/desktops/pantheon/files.nix | 31 ++----------------- .../x11/desktop-managers/pantheon.nix | 1 - 2 files changed, 3 insertions(+), 29 deletions(-) diff --git a/nixos/modules/services/desktops/pantheon/files.nix b/nixos/modules/services/desktops/pantheon/files.nix index 577aad6c2987..8cee9f42b62f 100644 --- a/nixos/modules/services/desktops/pantheon/files.nix +++ b/nixos/modules/services/desktops/pantheon/files.nix @@ -6,33 +6,8 @@ with lib; { - meta.maintainers = pkgs.pantheon.maintainers; - - ###### interface - - options = { - - services.pantheon.files = { - - enable = mkEnableOption "pantheon files daemon"; - - }; - - }; - - - ###### implementation - - config = mkIf config.services.pantheon.files.enable { - - environment.systemPackages = [ - pkgs.pantheon.elementary-files - ]; - - services.dbus.packages = [ - pkgs.pantheon.elementary-files - ]; - - }; + imports = [ + (mkRemovedOptionModule [ "services" "pantheon" "files" "enable" ] "Use `environment.systemPackages [ pkgs.pantheon.elementary-files ];`") + ]; } diff --git a/nixos/modules/services/x11/desktop-managers/pantheon.nix b/nixos/modules/services/x11/desktop-managers/pantheon.nix index e07d5b5eaad7..7274b49abd7f 100644 --- a/nixos/modules/services/x11/desktop-managers/pantheon.nix +++ b/nixos/modules/services/x11/desktop-managers/pantheon.nix @@ -106,7 +106,6 @@ in services.accounts-daemon.enable = true; services.bamf.enable = true; services.colord.enable = mkDefault true; - services.pantheon.files.enable = 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; [ From ee75a460af8a4c8daf742a8752b5969cbc876347 Mon Sep 17 00:00:00 2001 From: worldofpeace Date: Fri, 20 Dec 2019 09:24:53 -0500 Subject: [PATCH 2/7] nixos/pantheon: move contractor module into xservice --- .../services/desktops/pantheon/contractor.nix | 25 +- .../x11/desktop-managers/pantheon.nix | 268 ++++++++++-------- 2 files changed, 145 insertions(+), 148 deletions(-) diff --git a/nixos/modules/services/desktops/pantheon/contractor.nix b/nixos/modules/services/desktops/pantheon/contractor.nix index 2638a21df733..c76145191a70 100644 --- a/nixos/modules/services/desktops/pantheon/contractor.nix +++ b/nixos/modules/services/desktops/pantheon/contractor.nix @@ -6,35 +6,12 @@ with lib; { - meta.maintainers = pkgs.pantheon.maintainers; - - ###### interface - - options = { - - services.pantheon.contractor = { - - enable = mkEnableOption "contractor, a desktop-wide extension service used by pantheon"; - - }; - - }; - ###### implementation config = mkIf config.services.pantheon.contractor.enable { - environment.systemPackages = with pkgs.pantheon; [ - contractor - extra-elementary-contracts - ]; - - services.dbus.packages = [ pkgs.pantheon.contractor ]; - - environment.pathsToLink = [ - "/share/contractor" - ]; + }; diff --git a/nixos/modules/services/x11/desktop-managers/pantheon.nix b/nixos/modules/services/x11/desktop-managers/pantheon.nix index 7274b49abd7f..53c0458f1943 100644 --- a/nixos/modules/services/x11/desktop-managers/pantheon.nix +++ b/nixos/modules/services/x11/desktop-managers/pantheon.nix @@ -5,6 +5,7 @@ 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; @@ -19,6 +20,14 @@ in options = { + services.pantheon = { + + contractor = { + enable = mkEnableOption "contractor, a desktop-wide extension service used by Pantheon"; + }; + + }; + services.xserver.desktopManager.pantheon = { enable = mkOption { type = types.bool; @@ -67,147 +76,158 @@ in }; - config = mkIf cfg.enable { + config = mkMerge [ + (mkIf cfg.enable { - services.xserver.displayManager.sessionPackages = [ pkgs.pantheon.elementary-session-settings ]; + services.xserver.displayManager.sessionPackages = [ pkgs.pantheon.elementary-session-settings ]; - # Ensure lightdm is used when Pantheon is enabled - # Without it screen locking will be nonfunctional because of the use of lightlocker + # 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. + ''; - 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 + services.xserver.displayManager.defaultSession = "pantheon"; + + services.xserver.displayManager.sessionCommands = '' + if test "$XDG_CURRENT_DESKTOP" = "Pantheon"; then + ${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 ''; - services.xserver.displayManager.lightdm.greeters.pantheon.enable = mkDefault true; + 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; + 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 + ]; + services.pantheon.contractor.enable = mkDefault true; + services.gnome3.at-spi2-core.enable = true; + services.gnome3.evolution-data-server.enable = true; + services.gnome3.glib-networking.enable = true; + # TODO: gnome-keyring's xdg autostarts will still be in the environment (from elementary-session-settings) if disabled forcefully + services.gnome3.gnome-keyring.enable = true; + services.gnome3.gnome-settings-daemon.enable = true; + services.udev.packages = [ pkgs.pantheon.elementary-settings-daemon ]; + services.gvfs.enable = true; + services.gnome3.rygel.enable = mkDefault true; + services.gsignond.enable = mkDefault true; + services.gsignond.plugins = with pkgs.gsignondPlugins; [ lastfm mail oauth ]; + services.udisks2.enable = true; + services.upower.enable = config.powerManagement.enable; + services.xserver.libinput.enable = mkDefault true; + 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; + }; - # Without this, Elementary LightDM greeter will pre-select non-existent `default` session - # https://github.com/elementary/greeter/issues/368 - services.xserver.displayManager.defaultSession = "pantheon"; + programs.dconf.enable = true; + programs.evince.enable = mkDefault true; + programs.file-roller.enable = mkDefault true; + # Otherwise you can't store NetworkManager Secrets with + # "Store the password only for this user" + programs.nm-applet.enable = true; - services.xserver.displayManager.sessionCommands = '' - if test "$XDG_CURRENT_DESKTOP" = "Pantheon"; then - ${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 + # Shell integration for VTE terminals + programs.bash.vteIntegration = mkDefault true; + programs.zsh.vteIntegration = mkDefault true; - 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 - ''; + # Harmonize Qt5 applications under Pantheon + qt5.enable = true; + qt5.platformTheme = "gnome"; + qt5.style = "adwaita"; - 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; - 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 - ]; - services.pantheon.contractor.enable = mkDefault true; - services.gnome3.at-spi2-core.enable = true; - services.gnome3.evolution-data-server.enable = true; - services.gnome3.glib-networking.enable = true; - # TODO: gnome-keyring's xdg autostarts will still be in the environment (from elementary-session-settings) if disabled forcefully - services.gnome3.gnome-keyring.enable = true; - services.gnome3.gnome-settings-daemon.enable = true; - services.udev.packages = [ pkgs.pantheon.elementary-settings-daemon ]; - services.gvfs.enable = true; - services.gnome3.rygel.enable = mkDefault true; - services.gsignond.enable = mkDefault true; - services.gsignond.plugins = with pkgs.gsignondPlugins; [ lastfm mail oauth ]; - services.udisks2.enable = true; - services.upower.enable = config.powerManagement.enable; - services.xserver.libinput.enable = mkDefault true; - 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; - }; + networking.networkmanager.enable = mkDefault true; - programs.dconf.enable = true; - programs.evince.enable = mkDefault true; - programs.file-roller.enable = mkDefault true; - # Otherwise you can't store NetworkManager Secrets with - # "Store the password only for this user" - programs.nm-applet.enable = true; + # Override GSettings schemas + environment.sessionVariables.NIX_GSETTINGS_OVERRIDES_DIR = "${nixos-gsettings-desktop-schemas}/share/gsettings-schemas/nixos-gsettings-overrides/glib-2.0/schemas"; - # Shell integration for VTE terminals - programs.bash.vteIntegration = mkDefault true; - programs.zsh.vteIntegration = mkDefault true; + environment.sessionVariables.GNOME_SESSION_DEBUG = mkIf cfg.debug "1"; - # Harmonize Qt5 applications under Pantheon - qt5.enable = true; - qt5.platformTheme = "gnome"; - qt5.style = "adwaita"; + # Settings from elementary-default-settings + environment.sessionVariables.GTK_CSD = "1"; + environment.sessionVariables.GTK3_MODULES = [ "pantheon-filechooser-module" ]; + environment.etc."gtk-3.0/settings.ini".source = "${pkgs.pantheon.elementary-default-settings}/etc/gtk-3.0/settings.ini"; - networking.networkmanager.enable = mkDefault true; + environment.pathsToLink = [ + # FIXME: modules should link subdirs of `/share` rather than relying on this + "/share" + ]; - # Override GSettings schemas - environment.sessionVariables.NIX_GSETTINGS_OVERRIDES_DIR = "${nixos-gsettings-desktop-schemas}/share/gsettings-schemas/nixos-gsettings-overrides/glib-2.0/schemas"; + environment.systemPackages = + pkgs.pantheon.artwork ++ pkgs.pantheon.desktop ++ pkgs.pantheon.services ++ cfg.sessionPath + ++ (with pkgs; gnome3.removePackagesByName + ([ + gnome3.geary + gnome3.epiphany + gnome3.gnome-font-viewer + ] ++ pantheon.apps) config.environment.pantheon.excludePackages) + ++ (with pkgs; + [ + adwaita-qt + desktop-file-utils + glib + glib-networking + gnome-menus + gnome3.adwaita-icon-theme + gtk3.out + hicolor-icon-theme + lightlocker + onboard + plank + qgnomeplatform + shared-mime-info + sound-theme-freedesktop + xdg-user-dirs + ]); - environment.sessionVariables.GNOME_SESSION_DEBUG = mkIf cfg.debug "1"; + fonts.fonts = with pkgs; [ + open-sans + roboto-mono + pantheon.elementary-redacted-script # needed by screenshot-tool + ]; - # Settings from elementary-default-settings - environment.sessionVariables.GTK_CSD = "1"; - environment.sessionVariables.GTK3_MODULES = [ "pantheon-filechooser-module" ]; - environment.etc."gtk-3.0/settings.ini".source = "${pkgs.pantheon.elementary-default-settings}/etc/gtk-3.0/settings.ini"; + fonts.fontconfig.defaultFonts = { + monospace = [ "Roboto Mono" ]; + sansSerif = [ "Open Sans" ]; + }; + }) - environment.pathsToLink = [ - # FIXME: modules should link subdirs of `/share` rather than relying on this - "/share" - ]; + (mkIf serviceCfg.contractor.enable { + environment.systemPackages = with pkgs.pantheon; [ + contractor + extra-elementary-contracts + ]; - environment.systemPackages = - pkgs.pantheon.artwork ++ pkgs.pantheon.desktop ++ pkgs.pantheon.services ++ cfg.sessionPath - ++ (with pkgs; gnome3.removePackagesByName - ([ - gnome3.geary - gnome3.epiphany - gnome3.gnome-font-viewer - ] ++ pantheon.apps) config.environment.pantheon.excludePackages) - ++ (with pkgs; - [ - adwaita-qt - desktop-file-utils - glib - glib-networking - gnome-menus - gnome3.adwaita-icon-theme - gtk3.out - hicolor-icon-theme - lightlocker - onboard - plank - qgnomeplatform - shared-mime-info - sound-theme-freedesktop - xdg-user-dirs - ]); - - fonts.fonts = with pkgs; [ - open-sans - roboto-mono - pantheon.elementary-redacted-script # needed by screenshot-tool - ]; - - fonts.fontconfig.defaultFonts = { - monospace = [ "Roboto Mono" ]; - sansSerif = [ "Open Sans" ]; - }; - - }; + environment.pathsToLink = [ + "/share/contractor" + ]; + }) + ]; } From 4fb91d10c8e9427f4df178e3aba205d1d353687e Mon Sep 17 00:00:00 2001 From: worldofpeace Date: Fri, 20 Dec 2019 10:36:13 -0500 Subject: [PATCH 3/7] nixos/pantheon: add an apps.enable option --- .../x11/desktop-managers/pantheon.nix | 26 +++++++++++++++++-- pkgs/desktops/pantheon/default.nix | 8 +----- 2 files changed, 25 insertions(+), 9 deletions(-) diff --git a/nixos/modules/services/x11/desktop-managers/pantheon.nix b/nixos/modules/services/x11/desktop-managers/pantheon.nix index 53c0458f1943..6fdcbed70b82 100644 --- a/nixos/modules/services/x11/desktop-managers/pantheon.nix +++ b/nixos/modules/services/x11/desktop-managers/pantheon.nix @@ -26,6 +26,8 @@ in enable = mkEnableOption "contractor, a desktop-wide extension service used by Pantheon"; }; + apps.enable = mkEnableOption "Pantheon default applications"; + }; services.xserver.desktopManager.pantheon = { @@ -121,6 +123,7 @@ in switchboard-plug-power elementary-default-settings ]; + services.pantheon.apps.enable = mkDefault true; services.pantheon.contractor.enable = mkDefault true; services.gnome3.at-spi2-core.enable = true; services.gnome3.evolution-data-server.enable = true; @@ -186,7 +189,7 @@ in gnome3.geary gnome3.epiphany gnome3.gnome-font-viewer - ] ++ pantheon.apps) config.environment.pantheon.excludePackages) + ]) config.environment.pantheon.excludePackages) ++ (with pkgs; [ adwaita-qt @@ -209,7 +212,6 @@ in fonts.fonts = with pkgs; [ open-sans roboto-mono - pantheon.elementary-redacted-script # needed by screenshot-tool ]; fonts.fontconfig.defaultFonts = { @@ -218,6 +220,26 @@ in }; }) + (mkIf serviceCfg.apps.enable { + environment.systemPackages = (with pkgs.pantheon; pkgs.gnome3.removePackagesByName [ + elementary-calculator + elementary-calendar + elementary-camera + elementary-code + elementary-files + elementary-music + elementary-photos + elementary-screenshot-tool + elementary-terminal + elementary-videos + ] config.environment.pantheon.excludePackages); + + # needed by screenshot-tool + fonts.fonts = [ + pkgs.pantheon.elementary-redacted-script + ]; + }) + (mkIf serviceCfg.contractor.enable { environment.systemPackages = with pkgs.pantheon; [ contractor diff --git a/pkgs/desktops/pantheon/default.nix b/pkgs/desktops/pantheon/default.nix index 9e5391243bd1..c91844391bec 100644 --- a/pkgs/desktops/pantheon/default.nix +++ b/pkgs/desktops/pantheon/default.nix @@ -3,13 +3,6 @@ lib.makeScope pkgs.newScope (self: with self; { - apps = [ - elementary-calculator elementary-calendar - elementary-camera elementary-code elementary-files - elementary-music elementary-photos elementary-screenshot-tool - elementary-terminal elementary-videos switchboard-with-plugs - ]; - artwork = [ elementary-gtk-theme elementary-icon-theme @@ -22,6 +15,7 @@ lib.makeScope pkgs.newScope (self: with self; { elementary-session-settings elementary-shortcut-overlay gala + switchboard-with-plugs wingpanel-with-indicators ]; From 4ed65a891c682a85eec5cc6d4f7f5004e52d0fdf Mon Sep 17 00:00:00 2001 From: worldofpeace Date: Fri, 20 Dec 2019 11:09:14 -0500 Subject: [PATCH 4/7] nixos/pantheon: don't abstract default packages to pkgs Also cleanup a bit, we enabled gnome-settings-daemon even when using elementary-settings-daemon. I wanted the nixos module ascribe the defaults, not these lists in pkgs. --- .../x11/desktop-managers/pantheon.nix | 120 +++++++++++------- pkgs/desktops/pantheon/default.nix | 25 ---- 2 files changed, 71 insertions(+), 74 deletions(-) diff --git a/nixos/modules/services/x11/desktop-managers/pantheon.nix b/nixos/modules/services/x11/desktop-managers/pantheon.nix index 6fdcbed70b82..474e7a577337 100644 --- a/nixos/modules/services/x11/desktop-managers/pantheon.nix +++ b/nixos/modules/services/x11/desktop-managers/pantheon.nix @@ -111,6 +111,7 @@ in fi ''; + # Default services hardware.bluetooth.enable = mkDefault true; hardware.pulseaudio.enable = mkDefault true; security.polkit.enable = true; @@ -121,17 +122,14 @@ in services.system-config-printer.enable = (mkIf config.services.printing.enable (mkDefault true)); services.dbus.packages = with pkgs.pantheon; [ switchboard-plug-power - elementary-default-settings + elementary-default-settings # accountsservice extensions ]; services.pantheon.apps.enable = mkDefault true; services.pantheon.contractor.enable = mkDefault true; services.gnome3.at-spi2-core.enable = true; services.gnome3.evolution-data-server.enable = true; services.gnome3.glib-networking.enable = true; - # TODO: gnome-keyring's xdg autostarts will still be in the environment (from elementary-session-settings) if disabled forcefully services.gnome3.gnome-keyring.enable = true; - services.gnome3.gnome-settings-daemon.enable = true; - services.udev.packages = [ pkgs.pantheon.elementary-settings-daemon ]; services.gvfs.enable = true; services.gnome3.rygel.enable = mkDefault true; services.gsignond.enable = mkDefault true; @@ -148,10 +146,77 @@ in isAllowed = true; isSystem = true; }; - + # Use gnome-settings-daemon fork + services.udev.packages = [ + pkgs.pantheon.elementary-settings-daemon + ]; + systemd.packages = [ + pkgs.pantheon.elementary-settings-daemon + ]; programs.dconf.enable = true; + networking.networkmanager.enable = mkDefault true; + + # Global environment + environment.systemPackages = with pkgs; [ + desktop-file-utils + glib + gnome-menus + gnome3.adwaita-icon-theme + gtk3.out + hicolor-icon-theme + lightlocker + onboard + plank + qgnomeplatform + shared-mime-info + sound-theme-freedesktop + xdg-user-dirs + ] ++ (with pkgs.pantheon; [ + # Artwork + elementary-gtk-theme + elementary-icon-theme + elementary-sound-theme + elementary-wallpapers + + # Desktop + elementary-default-settings + elementary-session-settings + elementary-shortcut-overlay + gala + switchboard-with-plugs + wingpanel-with-indicators + + # Services + cerbere + elementary-capnet-assist + elementary-dpms-helper + elementary-settings-daemon + pantheon-agent-geoclue2 + pantheon-agent-polkit + ]) ++ (gnome3.removePackagesByName [ + gnome3.geary + gnome3.epiphany + gnome3.gnome-font-viewer + ] config.environment.pantheon.excludePackages); + programs.evince.enable = mkDefault true; programs.file-roller.enable = mkDefault true; + + # Settings from elementary-default-settings + environment.sessionVariables.GTK_CSD = "1"; + environment.sessionVariables.GTK3_MODULES = [ "pantheon-filechooser-module" ]; + environment.etc."gtk-3.0/settings.ini".source = "${pkgs.pantheon.elementary-default-settings}/etc/gtk-3.0/settings.ini"; + + # 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; @@ -165,50 +230,7 @@ in qt5.platformTheme = "gnome"; qt5.style = "adwaita"; - networking.networkmanager.enable = mkDefault true; - - # 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"; - - # Settings from elementary-default-settings - environment.sessionVariables.GTK_CSD = "1"; - environment.sessionVariables.GTK3_MODULES = [ "pantheon-filechooser-module" ]; - environment.etc."gtk-3.0/settings.ini".source = "${pkgs.pantheon.elementary-default-settings}/etc/gtk-3.0/settings.ini"; - - environment.pathsToLink = [ - # FIXME: modules should link subdirs of `/share` rather than relying on this - "/share" - ]; - - environment.systemPackages = - pkgs.pantheon.artwork ++ pkgs.pantheon.desktop ++ pkgs.pantheon.services ++ cfg.sessionPath - ++ (with pkgs; gnome3.removePackagesByName - ([ - gnome3.geary - gnome3.epiphany - gnome3.gnome-font-viewer - ]) config.environment.pantheon.excludePackages) - ++ (with pkgs; - [ - adwaita-qt - desktop-file-utils - glib - glib-networking - gnome-menus - gnome3.adwaita-icon-theme - gtk3.out - hicolor-icon-theme - lightlocker - onboard - plank - qgnomeplatform - shared-mime-info - sound-theme-freedesktop - xdg-user-dirs - ]); - + # Default Fonts fonts.fonts = with pkgs; [ open-sans roboto-mono diff --git a/pkgs/desktops/pantheon/default.nix b/pkgs/desktops/pantheon/default.nix index c91844391bec..f99d18b6f26f 100644 --- a/pkgs/desktops/pantheon/default.nix +++ b/pkgs/desktops/pantheon/default.nix @@ -3,31 +3,6 @@ lib.makeScope pkgs.newScope (self: with self; { - artwork = [ - elementary-gtk-theme - elementary-icon-theme - elementary-sound-theme - elementary-wallpapers - ]; - - desktop = [ - elementary-default-settings - elementary-session-settings - elementary-shortcut-overlay - gala - switchboard-with-plugs - wingpanel-with-indicators - ]; - - services = [ - cerbere - elementary-capnet-assist - elementary-settings-daemon - elementary-dpms-helper - pantheon-agent-geoclue2 - pantheon-agent-polkit - ]; - switchboardPlugs = [ switchboard-plug-a11y switchboard-plug-about switchboard-plug-applications switchboard-plug-bluetooth From 96e711bcd1c60ec4eabbfc14b5ab3c0fc49799b1 Mon Sep 17 00:00:00 2001 From: worldofpeace Date: Fri, 20 Dec 2019 11:46:15 -0500 Subject: [PATCH 5/7] pantheon.wingpanel-with-indicators: have indicators argument only append to defaults Wingpanel was designed firstly as an indicator renderer, and as such just a container for indicators that are distributed outside itself. Being able to control which and each indicator with `indicators` is confusing, ideally each of the default indicators would be shipped with wingpanel itself. I don't see how this kind of extensibility would be useful to a user so we're going to append to the expected defaults. The `useDefaultIndicators` argument is there to development test a single indicator/s. --- pkgs/desktops/pantheon/desktop/wingpanel/wrapper.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkgs/desktops/pantheon/desktop/wingpanel/wrapper.nix b/pkgs/desktops/pantheon/desktop/wingpanel/wrapper.nix index 253c61b77909..a46a26cc9ea5 100644 --- a/pkgs/desktops/pantheon/desktop/wingpanel/wrapper.nix +++ b/pkgs/desktops/pantheon/desktop/wingpanel/wrapper.nix @@ -6,10 +6,14 @@ , wingpanelIndicators , switchboard-with-plugs , indicators ? null + # Only useful to disable for development testing. +, useDefaultIndicators ? true }: let - selectedIndicators = if indicators == null then wingpanelIndicators else indicators; + selectedIndicators = + if indicators == null then wingpanelIndicators + else indicators ++ (lib.optional useDefaultIndicators wingpanelIndicators); in symlinkJoin { name = "${wingpanel.name}-with-indicators"; From 4f49053ad977e20695a5e27ca163cec0e6e435ed Mon Sep 17 00:00:00 2001 From: worldofpeace Date: Fri, 20 Dec 2019 11:47:03 -0500 Subject: [PATCH 6/7] pantheon.switchboard-with-plugs: have plugs argument only append to defaults Switchboard was designed identically to Wingpanel, so the same justification stands here. --- pkgs/desktops/pantheon/apps/switchboard/wrapper.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkgs/desktops/pantheon/apps/switchboard/wrapper.nix b/pkgs/desktops/pantheon/apps/switchboard/wrapper.nix index c0abb172806b..0abce8098535 100644 --- a/pkgs/desktops/pantheon/apps/switchboard/wrapper.nix +++ b/pkgs/desktops/pantheon/apps/switchboard/wrapper.nix @@ -5,10 +5,14 @@ , switchboard , switchboardPlugs , plugs + # Only useful to disable for development testing. +, useDefaultPlugs ? true }: let - selectedPlugs = if plugs == null then switchboardPlugs else plugs; + selectedPlugs = + if plugs == null then switchboardPlugs + else plugs ++ (lib.optional useDefaultPlugs switchboardPlugs); in symlinkJoin { name = "${switchboard.name}-with-plugs"; From 016c589bb4768cad423b9f33de83b203e236ba74 Mon Sep 17 00:00:00 2001 From: worldofpeace Date: Fri, 20 Dec 2019 12:22:39 -0500 Subject: [PATCH 7/7] nixos/pantheon: options for extra switchboard plugs and wingpanel indicators --- .../x11/desktop-managers/pantheon.nix | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/nixos/modules/services/x11/desktop-managers/pantheon.nix b/nixos/modules/services/x11/desktop-managers/pantheon.nix index 474e7a577337..b46a2d189ef9 100644 --- a/nixos/modules/services/x11/desktop-managers/pantheon.nix +++ b/nixos/modules/services/x11/desktop-managers/pantheon.nix @@ -52,6 +52,18 @@ in ]; }; + extraWingpanelIndicators = mkOption { + default = null; + type = with types; nullOr (listOf package); + description = "Indicators to add to Wingpanel."; + }; + + extraSwitchboardPlugs = mkOption { + default = null; + type = with types; nullOr (listOf package); + description = "Plugs to add to Switchboard."; + }; + extraGSettingsOverrides = mkOption { default = ""; type = types.lines; @@ -183,8 +195,12 @@ in elementary-session-settings elementary-shortcut-overlay gala - switchboard-with-plugs - wingpanel-with-indicators + (switchboard-with-plugs.override { + plugs = cfg.extraSwitchboardPlugs; + }) + (wingpanel-with-indicators.override { + indicators = cfg.extraWingpanelIndicators; + }) # Services cerbere