2014-04-14 15:26:48 +01:00
|
|
|
{ config, lib, pkgs, ... }:
|
2014-02-06 23:37:17 +00:00
|
|
|
|
2014-04-14 15:26:48 +01:00
|
|
|
with lib;
|
2014-02-06 23:37:17 +00:00
|
|
|
|
|
|
|
let
|
|
|
|
cfg = config.services.xserver.desktopManager.gnome3;
|
2014-05-18 23:17:13 +01:00
|
|
|
gnome3 = config.environment.gnome3.packageSet;
|
2014-04-10 23:28:15 +01:00
|
|
|
|
|
|
|
# Remove packages of ys from xs, based on their names
|
|
|
|
removePackagesByName = xs: ys:
|
|
|
|
let
|
|
|
|
pkgName = drv: (builtins.parseDrvName drv.name).name;
|
2014-05-18 23:17:13 +01:00
|
|
|
ysNames = map pkgName ys;
|
2014-04-10 23:28:15 +01:00
|
|
|
res = (filter (x: !(builtins.elem (pkgName x) ysNames)) xs);
|
|
|
|
in
|
|
|
|
filter (x: !(builtins.elem (pkgName x) ysNames)) xs;
|
|
|
|
|
2014-04-19 22:44:49 +01:00
|
|
|
# Prioritize nautilus by default when opening directories
|
|
|
|
mimeAppsList = pkgs.writeTextFile {
|
|
|
|
name = "gnome-mimeapps";
|
|
|
|
destination = "/share/applications/mimeapps.list";
|
|
|
|
text = ''
|
|
|
|
[Default Applications]
|
|
|
|
inode/directory=nautilus.desktop
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2014-02-06 23:37:17 +00:00
|
|
|
in {
|
|
|
|
|
|
|
|
options = {
|
|
|
|
|
|
|
|
services.xserver.desktopManager.gnome3.enable = mkOption {
|
|
|
|
default = false;
|
|
|
|
example = true;
|
|
|
|
description = "Enable Gnome 3 desktop manager.";
|
|
|
|
};
|
|
|
|
|
2014-08-14 20:03:42 +01:00
|
|
|
services.xserver.desktopManager.gnome3.sessionPath = mkOption {
|
|
|
|
default = [];
|
2014-08-27 22:41:15 +01:00
|
|
|
example = literalExample "[ pkgs.gnome3.gpaste ]";
|
2014-08-14 20:03:42 +01:00
|
|
|
description = "Additional list of packages to be added to the session search path.
|
|
|
|
Useful for gnome shell extensions or gsettings-conditionated autostart.";
|
|
|
|
apply = list: list ++ [ gnome3.gnome_shell ];
|
|
|
|
};
|
|
|
|
|
2014-05-18 23:17:13 +01:00
|
|
|
environment.gnome3.packageSet = mkOption {
|
2014-09-23 13:01:25 +01:00
|
|
|
default = null;
|
2014-11-14 21:45:26 +00:00
|
|
|
example = literalExample "pkgs.gnome3_12";
|
|
|
|
description = "Which GNOME 3 package set to use.";
|
2014-09-23 13:01:25 +01:00
|
|
|
apply = p: if p == null then pkgs.gnome3 else p;
|
2014-05-18 23:17:13 +01:00
|
|
|
};
|
|
|
|
|
2014-04-08 23:02:20 +01:00
|
|
|
environment.gnome3.excludePackages = mkOption {
|
|
|
|
default = [];
|
2014-08-27 22:41:15 +01:00
|
|
|
example = literalExample "[ pkgs.gnome3.totem ]";
|
2014-04-08 23:02:20 +01:00
|
|
|
type = types.listOf types.package;
|
|
|
|
description = "Which packages gnome should exclude from the default environment";
|
|
|
|
};
|
|
|
|
|
2014-02-06 23:37:17 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
|
|
|
|
# Enable helpful DBus services.
|
|
|
|
security.polkit.enable = true;
|
|
|
|
services.udisks2.enable = true;
|
2014-04-06 20:20:45 +01:00
|
|
|
services.accounts-daemon.enable = true;
|
2014-04-24 22:32:32 +01:00
|
|
|
services.geoclue2.enable = mkDefault true;
|
2014-04-08 21:44:22 +01:00
|
|
|
services.gnome3.at-spi2-core.enable = true;
|
2014-04-08 12:23:12 +01:00
|
|
|
services.gnome3.evolution-data-server.enable = true;
|
2014-04-20 23:19:00 +01:00
|
|
|
services.gnome3.gnome-documents.enable = mkDefault true;
|
2014-04-10 23:41:51 +01:00
|
|
|
services.gnome3.gnome-keyring.enable = true;
|
2014-04-12 18:45:12 +01:00
|
|
|
services.gnome3.gnome-online-accounts.enable = mkDefault true;
|
2014-04-11 22:13:31 +01:00
|
|
|
services.gnome3.gnome-user-share.enable = mkDefault true;
|
2014-05-25 23:37:36 +01:00
|
|
|
services.gnome3.gvfs.enable = true;
|
2014-04-19 23:47:55 +01:00
|
|
|
services.gnome3.seahorse.enable = mkDefault true;
|
2014-04-10 22:31:37 +01:00
|
|
|
services.gnome3.sushi.enable = mkDefault true;
|
2014-04-09 14:57:02 +01:00
|
|
|
services.gnome3.tracker.enable = mkDefault true;
|
2014-04-16 17:27:19 +01:00
|
|
|
hardware.pulseaudio.enable = mkDefault true;
|
2014-04-10 22:31:37 +01:00
|
|
|
services.telepathy.enable = mkDefault true;
|
2014-09-12 12:49:51 +01:00
|
|
|
networking.networkmanager.enable = mkDefault true;
|
2014-02-06 23:37:17 +00:00
|
|
|
services.upower.enable = config.powerManagement.enable;
|
|
|
|
|
2014-10-24 10:50:35 +01:00
|
|
|
fonts.fonts = [ pkgs.dejavu_fonts pkgs.cantarell_fonts ];
|
2014-02-06 23:37:17 +00:00
|
|
|
|
|
|
|
services.xserver.desktopManager.session = singleton
|
|
|
|
{ name = "gnome3";
|
|
|
|
start = ''
|
|
|
|
# Set GTK_DATA_PREFIX so that GTK+ can find the themes
|
|
|
|
export GTK_DATA_PREFIX=${config.system.path}
|
|
|
|
|
|
|
|
# find theme engines
|
2014-02-19 15:53:08 +00:00
|
|
|
export GTK_PATH=${config.system.path}/lib/gtk-3.0:${config.system.path}/lib/gtk-2.0
|
2014-02-06 23:37:17 +00:00
|
|
|
|
|
|
|
export XDG_MENU_PREFIX=gnome
|
|
|
|
|
2014-08-14 20:03:42 +01: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}
|
|
|
|
|
2014-04-19 22:44:49 +01:00
|
|
|
# Override default mimeapps
|
2014-08-14 20:03:42 +01:00
|
|
|
export XDG_DATA_DIRS=$XDG_DATA_DIRS''${XDG_DATA_DIRS:+:}${mimeAppsList}/share
|
2014-04-11 14:03:32 +01:00
|
|
|
|
2014-04-17 16:31:18 +01:00
|
|
|
# Let gnome-control-center find gnome-shell search providers
|
|
|
|
export GNOME_SEARCH_PROVIDERS_DIR=${config.system.path}/share/gnome-shell/search-providers/
|
|
|
|
|
2014-05-28 16:07:40 +01:00
|
|
|
# Let nautilus find extensions
|
|
|
|
export NAUTILUS_EXTENSION_DIR=${config.system.path}/lib/nautilus/extensions-3.0/
|
|
|
|
|
2014-04-16 14:01:11 +01:00
|
|
|
# Update user dirs as described in http://freedesktop.org/wiki/Software/xdg-user-dirs/
|
|
|
|
${pkgs.xdg-user-dirs}/bin/xdg-user-dirs-update
|
|
|
|
|
2014-02-06 23:37:17 +00:00
|
|
|
${gnome3.gnome_session}/bin/gnome-session&
|
|
|
|
waitPID=$!
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2014-04-04 22:21:38 +01:00
|
|
|
environment.variables.GIO_EXTRA_MODULES = [ "${gnome3.dconf}/lib/gio/modules"
|
2014-05-25 23:37:36 +01:00
|
|
|
"${gnome3.glib_networking}/lib/gio/modules"
|
|
|
|
"${gnome3.gvfs}/lib/gio/modules" ];
|
2014-02-06 23:37:17 +00:00
|
|
|
environment.systemPackages =
|
2014-04-14 16:19:38 +01:00
|
|
|
[ pkgs.desktop_file_utils
|
2014-05-21 10:01:14 +01:00
|
|
|
gnome3.glib_networking
|
|
|
|
gnome3.gtk3 # for gtk-update-icon-cache
|
2014-04-08 23:02:20 +01:00
|
|
|
pkgs.ibus
|
2014-04-14 23:15:20 +01:00
|
|
|
pkgs.shared_mime_info # for update-mime-database
|
2014-05-25 13:13:05 +01:00
|
|
|
gnome3.gvfs
|
2014-04-14 16:19:38 +01:00
|
|
|
gnome3.dconf
|
2014-04-08 23:02:20 +01:00
|
|
|
gnome3.gnome-backgrounds
|
|
|
|
gnome3.gnome_control_center
|
|
|
|
gnome3.gnome_icon_theme
|
2014-04-14 23:15:20 +01:00
|
|
|
gnome3.gnome-menus
|
2014-04-08 23:02:20 +01:00
|
|
|
gnome3.gnome_settings_daemon
|
|
|
|
gnome3.gnome_shell
|
|
|
|
gnome3.gnome_themes_standard
|
2014-08-14 20:03:42 +01:00
|
|
|
] ++ cfg.sessionPath ++ (removePackagesByName [
|
2014-04-08 23:02:20 +01:00
|
|
|
gnome3.baobab
|
2014-04-14 12:25:55 +01:00
|
|
|
gnome3.empathy
|
2014-02-06 23:37:17 +00:00
|
|
|
gnome3.eog
|
2014-02-19 15:38:17 +00:00
|
|
|
gnome3.epiphany
|
2014-04-08 23:02:20 +01:00
|
|
|
gnome3.evince
|
2014-02-19 15:38:17 +00:00
|
|
|
gnome3.gucharmap
|
|
|
|
gnome3.nautilus
|
2014-04-08 23:02:20 +01:00
|
|
|
gnome3.totem
|
|
|
|
gnome3.vino
|
2014-02-19 15:38:17 +00:00
|
|
|
gnome3.yelp
|
2014-04-08 23:02:20 +01:00
|
|
|
gnome3.gnome-calculator
|
|
|
|
gnome3.gnome-contacts
|
|
|
|
gnome3.gnome-font-viewer
|
|
|
|
gnome3.gnome-screenshot
|
2014-04-13 16:22:07 +01:00
|
|
|
gnome3.gnome-shell-extensions
|
2014-04-08 23:02:20 +01:00
|
|
|
gnome3.gnome-system-log
|
|
|
|
gnome3.gnome-system-monitor
|
2014-02-06 23:37:17 +00:00
|
|
|
gnome3.gnome_terminal
|
2014-04-10 21:29:36 +01:00
|
|
|
gnome3.gnome-user-docs
|
2014-04-08 23:02:20 +01:00
|
|
|
|
2014-05-02 16:40:41 +01:00
|
|
|
gnome3.bijiben
|
2014-04-24 16:42:11 +01:00
|
|
|
gnome3.evolution
|
2014-04-08 23:02:20 +01:00
|
|
|
gnome3.file-roller
|
2014-04-18 21:48:15 +01:00
|
|
|
gnome3.gedit
|
2014-04-24 22:33:42 +01:00
|
|
|
gnome3.gnome-clocks
|
2014-04-20 19:42:55 +01:00
|
|
|
gnome3.gnome-music
|
2014-04-13 16:20:40 +01:00
|
|
|
gnome3.gnome-tweak-tool
|
2014-04-24 19:07:01 +01:00
|
|
|
gnome3.gnome-photos
|
2014-05-28 16:26:37 +01:00
|
|
|
gnome3.nautilus-sendto
|
2014-04-08 23:02:20 +01:00
|
|
|
] config.environment.gnome3.excludePackages);
|
2014-04-14 23:15:20 +01:00
|
|
|
|
|
|
|
# Needed for themes and backgrounds
|
|
|
|
environment.pathsToLink = [ "/share" ];
|
|
|
|
|
2014-02-06 23:37:17 +00:00
|
|
|
};
|
|
|
|
|
2014-02-16 20:37:18 +00:00
|
|
|
|
2014-02-06 23:37:17 +00:00
|
|
|
}
|