diff --git a/etc/bashrc.sh b/etc/bashrc.sh index 4ec3b4ab4158..20b78b21c632 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 babd4cfc1622..34ae64a3c51b 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 b1688cdda805..fdbd57a79f04 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 2694057720be..d7d91812a5da 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 ];