Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: d42ae527190d
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 450a1805428d
Choose a head ref
  • 4 commits
  • 2 files changed
  • 1 contributor

Commits on Aug 26, 2019

  1. nixos/gnome3: split up

    This introduces the following options under the services.gnome3 namespace:
    
    * core-os-services.enable
    * core-shell.enable
    * core-utilities.enable
    * games.enable
    
    The first three are all default enabled by gnome3.enable
    and their purpose is to make gnome3 more flexable for users
    usecases. In the case of core-utilities and games, it allows
    users to easily switch on the default gnome3 applications
    and games packages. Previously we had lists in gnome-3/default.nix
    but they weren't visible to the user. By having options we have
    generated documentation and an interface.
    worldofpeace committed Aug 26, 2019

    Verified

    This commit was signed with the committer’s verified signature.
    sikmir Nikolay Korotkiy
    Copy the full SHA
    fca8d35 View commit details
  2. Copy the full SHA
    70e506c View commit details
  3. Copy the full SHA
    bf7bdcd View commit details
  4. Merge pull request #67466 from worldofpeace/gnome3-defaults-cleanup

    nixos/gnome3: split up
    worldofpeace authored Aug 26, 2019
    Copy the full SHA
    450a180 View commit details
Showing with 193 additions and 151 deletions.
  1. +188 −121 nixos/modules/services/x11/desktop-managers/gnome3.nix
  2. +5 −30 pkgs/desktops/gnome-3/default.nix
309 changes: 188 additions & 121 deletions nixos/modules/services/x11/desktop-managers/gnome3.nix
Original file line number Diff line number Diff line change
@@ -3,7 +3,9 @@
with lib;

let

cfg = config.services.xserver.desktopManager.gnome3;
serviceCfg = config.services.gnome3;

# Prioritize nautilus by default when opening directories
mimeAppsList = pkgs.writeTextFile {
@@ -45,10 +47,19 @@ let

flashbackEnabled = cfg.flashback.enableMetacity || length cfg.flashback.customSessions > 0;

in {
in

{

options = {

services.gnome3 = {
core-os-services.enable = mkEnableOption "essential services for GNOME3";
core-shell.enable = mkEnableOption "GNOME Shell services";
core-utilities.enable = mkEnableOption "GNOME core utilities";
games.enable = mkEnableOption "GNOME games";
};

services.xserver.desktopManager.gnome3 = {
enable = mkOption {
default = false;
@@ -121,138 +132,194 @@ in {

};

config = mkIf cfg.enable {

# Enable helpful DBus services.
security.polkit.enable = true;
services.udisks2.enable = true;
services.accounts-daemon.enable = true;
services.dleyna-renderer.enable = mkDefault true;
services.dleyna-server.enable = mkDefault true;
services.gnome3.at-spi2-core.enable = true;
services.gnome3.evolution-data-server.enable = true;
services.gnome3.glib-networking.enable = true;
services.gnome3.gnome-keyring.enable = true;
services.gnome3.gnome-online-accounts.enable = mkDefault true;
services.gnome3.gnome-remote-desktop.enable = mkDefault true;
services.gnome3.gnome-settings-daemon.enable = true;
services.gnome3.gnome-user-share.enable = mkDefault true;
services.gvfs.enable = true;
services.gnome3.rygel.enable = mkDefault true;
services.gnome3.seahorse.enable = mkDefault true;
services.gnome3.sushi.enable = mkDefault true;
services.gnome3.tracker.enable = mkDefault true;
services.gnome3.tracker-miners.enable = mkDefault true;
hardware.pulseaudio.enable = mkDefault true;
services.telepathy.enable = mkDefault true;
networking.networkmanager.enable = mkDefault true;
services.upower.enable = config.powerManagement.enable;
services.dbus.packages =
optional config.services.printing.enable pkgs.system-config-printer ++
optional flashbackEnabled pkgs.gnome3.gnome-screensaver;
services.colord.enable = mkDefault true;
services.packagekit.enable = mkDefault true;
hardware.bluetooth.enable = mkDefault true;
services.hardware.bolt.enable = mkDefault true;
services.xserver.libinput.enable = mkDefault true; # for controlling touchpad settings via gnome control center
systemd.packages = [ pkgs.gnome3.vino ];
xdg.portal.enable = true;
xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-gtk ];

# Enable default programs
programs.dconf.enable = true;
programs.evince.enable = mkDefault true;
programs.file-roller.enable = mkDefault true;
programs.gnome-disks.enable = mkDefault true;
programs.gnome-documents.enable = mkDefault true;
programs.gnome-terminal.enable = mkDefault true;

# If gnome3 is installed, build vim for gtk3 too.
nixpkgs.config.vim.gui = "gtk3";

fonts.fonts = [
pkgs.dejavu_fonts pkgs.cantarell-fonts
pkgs.source-sans-pro
pkgs.source-code-pro # Default monospace font in 3.32
];

services.xserver.displayManager.extraSessionFilePackages = [ pkgs.gnome3.gnome-session ]
++ map
(wm: pkgs.gnome3.gnome-flashback.mkSessionForWm {
inherit (wm) wmName wmLabel wmCommand;
}) (optional cfg.flashback.enableMetacity {
wmName = "metacity";
wmLabel = "Metacity";
wmCommand = "${pkgs.gnome3.metacity}/bin/metacity";
} ++ cfg.flashback.customSessions);

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}
'';
config = mkMerge [
(mkIf (cfg.enable || flashbackEnabled) {
services.gnome3.core-os-services.enable = true;
services.gnome3.core-shell.enable = true;
services.gnome3.core-utilities.enable = mkDefault true;

services.xserver.displayManager.extraSessionFilePackages = [ pkgs.gnome3.gnome-session ];

services.geoclue2.enable = mkDefault true;
# GNOME should have its own geoclue agent
services.geoclue2.enableDemoAgent = false;
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
services.geoclue2.appConfig."gnome-datetime-panel" = {
isAllowed = true;
isSystem = true;
};
services.geoclue2.appConfig."gnome-color-panel" = {
isAllowed = true;
isSystem = true;
};
services.geoclue2.appConfig."org.gnome.Shell" = {
isAllowed = true;
isSystem = 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}
'';

environment.variables.GNOME_SESSION_DEBUG = optionalString cfg.debug "1";
environment.systemPackages = cfg.sessionPath;

# Override default mimeapps
environment.variables.XDG_DATA_DIRS = [ "${mimeAppsList}/share" ];
environment.variables.GNOME_SESSION_DEBUG = mkIf cfg.debug "1";

# Override GSettings schemas
environment.variables.NIX_GSETTINGS_OVERRIDES_DIR = "${nixos-gsettings-desktop-schemas}/share/gsettings-schemas/nixos-gsettings-overrides/glib-2.0/schemas";
# Override GSettings schemas
environment.variables.NIX_GSETTINGS_OVERRIDES_DIR = "${nixos-gsettings-desktop-schemas}/share/gsettings-schemas/nixos-gsettings-overrides/glib-2.0/schemas";

# Let nautilus find extensions
# TODO: Create nautilus-with-extensions package
environment.variables.NAUTILUS_EXTENSION_DIR = "${config.system.path}/lib/nautilus/extensions-3.0";
# If gnome3 is installed, build vim for gtk3 too.
nixpkgs.config.vim.gui = "gtk3";
})

services.xserver.updateDbusEnvironment = true;
(mkIf flashbackEnabled {
services.xserver.displayManager.extraSessionFilePackages = map
(wm: pkgs.gnome3.gnome-flashback.mkSessionForWm {
inherit (wm) wmName wmLabel wmCommand;
}) (optional cfg.flashback.enableMetacity {
wmName = "metacity";
wmLabel = "Metacity";
wmCommand = "${pkgs.gnome3.metacity}/bin/metacity";
} ++ cfg.flashback.customSessions);

environment.systemPackages = pkgs.gnome3.corePackages ++ cfg.sessionPath
++ (pkgs.gnome3.removePackagesByName pkgs.gnome3.optionalPackages config.environment.gnome3.excludePackages) ++ [
pkgs.xdg-user-dirs # Update user dirs as described in http://freedesktop.org/wiki/Software/xdg-user-dirs/
];
security.pam.services.gnome-screensaver = {
enableGnomeKeyring = true;
};

# Use the correct gnome3 packageSet
networking.networkmanager.basePackages =
{ inherit (pkgs) networkmanager modemmanager wpa_supplicant crda;
services.dbus.packages = [
pkgs.gnome3.gnome-screensaver
];
})

(mkIf serviceCfg.core-os-services.enable {
hardware.bluetooth.enable = mkDefault true;
hardware.pulseaudio.enable = mkDefault true;
programs.dconf.enable = true;
security.polkit.enable = true;
services.accounts-daemon.enable = true;
services.dleyna-renderer.enable = mkDefault true;
services.dleyna-server.enable = mkDefault true;
services.gnome3.at-spi2-core.enable = true;
services.gnome3.evolution-data-server.enable = true;
services.gnome3.gnome-keyring.enable = true;
services.gnome3.gnome-online-accounts.enable = mkDefault true;
services.gnome3.gnome-online-miners.enable = true;
services.gnome3.tracker-miners.enable = mkDefault true;
services.gnome3.tracker.enable = mkDefault true;
services.hardware.bolt.enable = mkDefault true;
services.packagekit.enable = mkDefault true;
services.udisks2.enable = true;
services.upower.enable = config.powerManagement.enable;
services.xserver.libinput.enable = mkDefault true; # for controlling touchpad settings via gnome control center

xdg.portal.enable = true;
xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-gtk ];

networking.networkmanager.enable = mkDefault true;

# Use the correct gnome3 packageSet
networking.networkmanager.basePackages = {
inherit (pkgs) networkmanager modemmanager wpa_supplicant crda;
inherit (pkgs.gnome3) networkmanager-openvpn networkmanager-vpnc
networkmanager-openconnect networkmanager-fortisslvpn
networkmanager-iodine networkmanager-l2tp; };

# Needed for themes and backgrounds
environment.pathsToLink = [
"/share"
"/share/nautilus-python/extensions"
];
networkmanager-openconnect networkmanager-fortisslvpn
networkmanager-iodine networkmanager-l2tp;
};

security.pam.services.gnome-screensaver = mkIf flashbackEnabled {
enableGnomeKeyring = true;
};
};
services.xserver.updateDbusEnvironment = true;

# Needed for themes and backgrounds
environment.pathsToLink = [
"/share" # TODO: https://github.com/NixOS/nixpkgs/issues/47173
];
})

(mkIf serviceCfg.core-shell.enable {
services.colord.enable = mkDefault true;
services.gnome3.glib-networking.enable = true;
services.gnome3.gnome-remote-desktop.enable = mkDefault true;
services.gnome3.gnome-settings-daemon.enable = true;
services.gnome3.gnome-user-share.enable = mkDefault true;
services.gnome3.rygel.enable = mkDefault true;
services.gvfs.enable = true;
services.telepathy.enable = mkDefault true;
systemd.packages = [ pkgs.gnome3.vino ];
services.dbus.packages =
optional config.services.printing.enable pkgs.system-config-printer;

services.geoclue2.enable = mkDefault true;
services.geoclue2.enableDemoAgent = false; # GNOME has its own geoclue agent

services.geoclue2.appConfig."gnome-datetime-panel" = {
isAllowed = true;
isSystem = true;
};
services.geoclue2.appConfig."gnome-color-panel" = {
isAllowed = true;
isSystem = true;
};
services.geoclue2.appConfig."org.gnome.Shell" = {
isAllowed = true;
isSystem = true;
};

fonts.fonts = with pkgs; [
cantarell-fonts
dejavu_fonts
source-code-pro # Default monospace font in 3.32
source-sans-pro
];

environment.systemPackages = with pkgs.gnome3; [
adwaita-icon-theme
gnome-backgrounds
gnome-bluetooth
gnome-control-center
gnome-getting-started-docs
gnome-shell
gnome-shell-extensions
gnome-themes-extra
gnome-user-docs
pkgs.glib # for gsettings
pkgs.gnome-menus
pkgs.gtk3.out # for gtk-launch
pkgs.hicolor-icon-theme
pkgs.shared-mime-info # for update-mime-database
pkgs.xdg-user-dirs # Update user dirs as described in http://freedesktop.org/wiki/Software/xdg-user-dirs/
vino
];
})

(mkIf serviceCfg.core-utilities.enable {
environment.systemPackages = (with pkgs.gnome3; removePackagesByName [
baobab eog epiphany evince gucharmap nautilus totem yelp gnome-calculator
gnome-contacts gnome-font-viewer gnome-screenshot gnome-system-monitor simple-scan
gnome-terminal evolution file-roller gedit gnome-clocks gnome-music gnome-tweaks
pkgs.gnome-photos nautilus-sendto dconf-editor vinagre gnome-weather gnome-logs
gnome-maps gnome-characters gnome-calendar accerciser gnome-nettool gnome-packagekit
gnome-software gnome-power-manager gnome-todo pkgs.gnome-usage
] config.environment.gnome3.excludePackages);

# Enable default programs
programs.evince.enable = mkDefault true;
programs.file-roller.enable = mkDefault true;
programs.gnome-disks.enable = mkDefault true;
programs.gnome-documents.enable = mkDefault true;
programs.gnome-terminal.enable = mkDefault true;
services.gnome3.seahorse.enable = mkDefault true;
services.gnome3.sushi.enable = mkDefault true;

# Let nautilus find extensions
# TODO: Create nautilus-with-extensions package
environment.variables.NAUTILUS_EXTENSION_DIR = "${config.system.path}/lib/nautilus/extensions-3.0";

# Override default mimeapps for nautilus
environment.variables.XDG_DATA_DIRS = [ "${mimeAppsList}/share" ];

environment.pathsToLink = [
"/share/nautilus-python/extensions"
];
})

(mkIf serviceCfg.games.enable {
environment.systemPackages = (with pkgs.gnome3; removePackagesByName [
aisleriot atomix five-or-more four-in-a-row gnome-chess gnome-klotski
gnome-mahjongg gnome-mines gnome-nibbles gnome-robots gnome-sudoku
gnome-taquin gnome-tetravex hitori iagno lightsoff quadrapassel
swell-foop tali
] config.environment.gnome3.excludePackages);
})
];

}
35 changes: 5 additions & 30 deletions pkgs/desktops/gnome-3/default.nix
Original file line number Diff line number Diff line change
@@ -21,36 +21,6 @@ lib.makeScope pkgs.newScope (self: with self; {

maintainers = with pkgs.lib.maintainers; [ lethalman jtojnar hedning worldofpeace ];

corePackages = with gnome3; [
pkgs.desktop-file-utils
pkgs.shared-mime-info # for update-mime-database
pkgs.glib # for gsettings
pkgs.gtk3.out # for gtk-update-icon-cache
glib-networking gvfs dconf gnome-backgrounds gnome-control-center
pkgs.gnome-menus gnome-settings-daemon gnome-shell
gnome-themes-extra adwaita-icon-theme gnome-shell-extensions
pkgs.hicolor-icon-theme
];

optionalPackages = with gnome3; [ baobab eog epiphany evince
gucharmap nautilus totem vino yelp gnome-bluetooth
gnome-calculator gnome-contacts gnome-font-viewer gnome-screenshot
gnome-system-monitor simple-scan
gnome-terminal gnome-user-docs evolution file-roller gedit
gnome-clocks gnome-music gnome-tweaks pkgs.gnome-photos
nautilus-sendto dconf-editor vinagre gnome-weather gnome-logs
gnome-maps gnome-characters gnome-calendar accerciser gnome-nettool
gnome-getting-started-docs gnome-packagekit gnome-software
gnome-power-manager gnome-todo pkgs.gnome-usage
];

gamesPackages = with gnome3; [ swell-foop lightsoff iagno
tali quadrapassel gnome-sudoku atomix aisleriot five-or-more
four-in-a-row gnome-chess gnome-klotski gnome-mahjongg
gnome-mines gnome-nibbles gnome-robots gnome-tetravex
hitori gnome-taquin
];

libsoup = pkgs.libsoup.override { gnomeSupport = true; };
libchamplain = pkgs.libchamplain.override { libsoup = libsoup; };
gnome3 = self // { recurseForDerivations = false; };
@@ -385,4 +355,9 @@ lib.makeScope pkgs.newScope (self: with self; {
rest = librest;

pidgin-im-gnome-shell-extension = pkgs.gnomeExtensions.pidgin-im-integration; # added 2019-08-01

# added 2019-08-25
corePackages = throw "deprecated 2019-08-25: please use `services.gnome3.core-shell.enable`";
optionalPackages = throw "deprecated 2019-08-25: please use `services.gnome3.core-utilities.enable`";
gamesPackages = throw "deprecated 2019-08-25: please use `services.gnome3.games.enable`";
})