From 357ca60ed78854a6f9f550bb493e16a78bdb38ea Mon Sep 17 00:00:00 2001 From: Nicolas Pierron Date: Sun, 22 Feb 2009 16:09:14 +0000 Subject: [PATCH] * Set KDEDIRS, XDG_CONFIG_DIRS and XDG_DATA_DIRS in bashrc. This has the advantage that KDE applications work when logging in via ssh, and that you don't need to logout to have KDE upgrades take effect. On the downside, since the various KDE packages and shared-mime-info all have their own MIME databases, if we put them in one symlink tree (systemPath), we need to rerun update-mime-database on the symlink tree. Also, systemPath is getting very large. svn path=/nixos/branches/fix-style/; revision=14191 --- etc/bashrc.sh | 11 +++++++++-- system/options.nix | 2 +- system/system-options.nix | 10 ++++++++++ upstart-jobs/xserver/desktopManager/kde4.nix | 5 ++--- 4 files changed, 22 insertions(+), 6 deletions(-) diff --git a/etc/bashrc.sh b/etc/bashrc.sh index 4ec3b4ab415..20b78b21c63 100644 --- a/etc/bashrc.sh +++ b/etc/bashrc.sh @@ -15,7 +15,9 @@ export LANG=@defaultLocale@ export EDITOR=nano export INFOPATH=/var/run/current-system/sw/info:/var/run/current-system/sw/share/info export LOCATE_PATH=/var/cache/locatedb - +export KDEDIRS=/var/run/current-system/sw +export XDG_CONFIG_DIRS=/var/run/current-system/sw/etc/xdg +export XDG_DATA_DIRS=/var/run/current-system/sw/share # Set up secure multi-user builds: non-root users build through the # Nix daemon. @@ -41,7 +43,7 @@ for i in $NIX_PROFILES; do # !!! reverse export PKG_CONFIG_PATH="$i/lib/pkgconfig:$PKG_CONFIG_PATH" # Automake's `aclocal' bails out if it finds non-existent directories - # in its path. + # in its path. !!! We should fix aclocal instead. if [ -d "$i/share/aclocal" ] then export ACLOCAL_PATH="$i/share/aclocal:$ACLOCAL_PATH" @@ -50,6 +52,11 @@ for i in $NIX_PROFILES; do # !!! reverse # GStreamer. export GST_PLUGIN_PATH="$i/lib/gstreamer-0.10:$GST_PLUGIN_PATH" + + # KDE/Gnome stuff. + export KDEDIRS=$i:$KDEDIRS + export XDG_CONFIG_DIRS=$i/etc/xdg:$XDG_CONFIG_DIRS + export XDG_DATA_DIRS=$i/share:$XDG_DATA_DIRS done diff --git a/system/options.nix b/system/options.nix index babd4cfc162..34ae64a3c51 100644 --- a/system/options.nix +++ b/system/options.nix @@ -2127,7 +2127,7 @@ in environment = { pathsToLink = mkOption { - default = ["/bin" "/sbin" "/lib" "/share" "/man" "/info"]; + default = ["/bin" "/sbin" "/lib" "/share" "/man" "/info" "/etc"]; example = ["/"]; description = " Lists directories to be symlinked in `/var/run/current-system/sw'. diff --git a/system/system-options.nix b/system/system-options.nix index b1688cdda80..fdbd57a79f0 100644 --- a/system/system-options.nix +++ b/system/system-options.nix @@ -64,6 +64,16 @@ let inherit (config.environment) pathsToLink; ignoreCollisions = true; + + # TODO: move this to upstart-jobs/xserver/desktopManager/kde4.nix + postBuild = + if config.services.xserver.desktopManager.kde4.enable then + # Rebuild the MIME database. Otherwise KDE won't be able to + # find many MIME types. + '' + ${pkgs.shared_mime_info}/bin/update-mime-database $out/share/mime + '' + else ""; }; }; diff --git a/upstart-jobs/xserver/desktopManager/kde4.nix b/upstart-jobs/xserver/desktopManager/kde4.nix index 2694057720b..d7d91812a5d 100644 --- a/upstart-jobs/xserver/desktopManager/kde4.nix +++ b/upstart-jobs/xserver/desktopManager/kde4.nix @@ -29,9 +29,6 @@ mkIf cfg.enable { name = "kde4"; start = '' # Start KDE. - export KDEDIRS=$HOME/.nix-profile:/nix/var/nix/profiles/default:${pkgs.kde42.kdelibs}:${pkgs.kde42.kdebase}:${pkgs.kde42.kdebase_runtime}:${pkgs.kde42.kdebase_workspace} - export XDG_CONFIG_DIRS=${pkgs.kde42.kdelibs}/etc/xdg:${pkgs.kde42.kdebase_runtime}/etc/xdg:${pkgs.kde42.kdebase_workspace}/etc/xdg - export XDG_DATA_DIRS=${pkgs.kde42.kdelibs}/share:${pkgs.kde42.kdebase}/share:${pkgs.kde42.kdebase_runtime}/share:${pkgs.kde42.kdebase_workspace}/share:${pkgs.shared_mime_info}/share exec ${pkgs.kde42.kdebase_workspace}/bin/startkde ''; }]; @@ -54,6 +51,8 @@ mkIf cfg.enable { pkgs.kde42.kdebase pkgs.kde42.kdebase_runtime pkgs.kde42.kdebase_workspace + pkgs.kde42.kdegames + pkgs.shared_mime_info xorg.xset # used by startkde, non-essential ];