From 311ff6c8e706c47d17cb417432060d1db79c7401 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 20 Feb 2009 16:31:42 +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/trunk/; revision=14148 --- etc/bashrc.sh | 10 +++++++++- system/options.nix | 2 +- system/system.nix | 17 +++++++++++++---- upstart-jobs/xserver.nix | 5 ++--- 4 files changed, 25 insertions(+), 9 deletions(-) diff --git a/etc/bashrc.sh b/etc/bashrc.sh index 4ec3b4ab415..baaed726ee1 100644 --- a/etc/bashrc.sh +++ b/etc/bashrc.sh @@ -15,6 +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 @@ -41,7 +44,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 +53,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 2a6498ed80a..a2952b4a325 100644 --- a/system/options.nix +++ b/system/options.nix @@ -2959,7 +2959,7 @@ root ALL=(ALL) SETENV: ALL 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.nix b/system/system.nix index 7d814993844..913913db9af 100644 --- a/system/system.nix +++ b/system/system.nix @@ -266,6 +266,15 @@ rec { inherit (config.environment) pathsToLink; ignoreCollisions = true; + + postBuild = + if config.services.xserver.sessionType == "kde4" 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 ""; }; @@ -301,10 +310,10 @@ rec { inherit (usersGroups) createUsersGroups usersList groupsList; path = [ - pkgs.coreutils pkgs.gnugrep pkgs.findutils - pkgs.glibc # needed for getent - pkgs.pwdutils - ]; + pkgs.coreutils pkgs.gnugrep pkgs.findutils + pkgs.glibc # needed for getent + pkgs.pwdutils + ]; adjustSetuidOwner = pkgs.lib.concatStrings (map (_entry: let entry = { diff --git a/upstart-jobs/xserver.nix b/upstart-jobs/xserver.nix index a2961137d9d..c889c6427a9 100644 --- a/upstart-jobs/xserver.nix +++ b/upstart-jobs/xserver.nix @@ -296,9 +296,6 @@ let '' else if sessionType == "kde4" then '' # 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 '' else '' @@ -398,6 +395,8 @@ rec { 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 ] ++ optional (videoDriver == "nvidia") [