at 15.09-beta 2.0 kB view raw
1# This module defines a standard configuration for NixOS global environment. 2 3# Most of the stuff here should probably be moved elsewhere sometime. 4 5{ config, lib, pkgs, ... }: 6 7with lib; 8 9let 10 11 cfg = config.environment; 12 13in 14 15{ 16 17 config = { 18 19 environment.variables = 20 { LOCATE_PATH = "/var/cache/locatedb"; 21 NIXPKGS_CONFIG = "/etc/nix/nixpkgs-config.nix"; 22 PAGER = mkDefault "less -R"; 23 EDITOR = mkDefault "nano"; 24 }; 25 26 environment.profiles = 27 [ "$HOME/.nix-profile" 28 "/nix/var/nix/profiles/default" 29 "/run/current-system/sw" 30 ]; 31 32 # TODO: move most of these elsewhere 33 environment.profileRelativeEnvVars = 34 { PATH = [ "/bin" "/sbin" "/lib/kde4/libexec" ]; 35 INFOPATH = [ "/info" "/share/info" ]; 36 PKG_CONFIG_PATH = [ "/lib/pkgconfig" ]; 37 TERMINFO_DIRS = [ "/share/terminfo" ]; 38 PERL5LIB = [ "/lib/perl5/site_perl" ]; 39 KDEDIRS = [ "" ]; 40 STRIGI_PLUGIN_PATH = [ "/lib/strigi/" ]; 41 QT_PLUGIN_PATH = [ "/lib/qt4/plugins" "/lib/kde4/plugins" "/lib/qt5/plugins" ]; 42 QML_IMPORT_PATH = [ "/lib/qt5/imports" ]; 43 QML2_IMPORT_PATH = [ "/lib/qt5/qml" ]; 44 QTWEBKIT_PLUGIN_PATH = [ "/lib/mozilla/plugins/" ]; 45 GTK_PATH = [ "/lib/gtk-2.0" "/lib/gtk-3.0" ]; 46 XDG_CONFIG_DIRS = [ "/etc/xdg" ]; 47 XDG_DATA_DIRS = [ "/share" ]; 48 MOZ_PLUGIN_PATH = [ "/lib/mozilla/plugins" ]; 49 LIBEXEC_PATH = [ "/lib/libexec" ]; 50 }; 51 52 environment.extraInit = 53 '' 54 # reset TERM with new TERMINFO available (if any) 55 export TERM=$TERM 56 57 unset ASPELL_CONF 58 for i in ${concatStringsSep " " (reverseList cfg.profiles)} ; do 59 if [ -d "$i/lib/aspell" ]; then 60 export ASPELL_CONF="dict-dir $i/lib/aspell" 61 fi 62 done 63 64 export NIX_USER_PROFILE_DIR="/nix/var/nix/profiles/per-user/$USER" 65 export NIX_PROFILES="${concatStringsSep " " (reverseList cfg.profiles)}" 66 ''; 67 68 }; 69 70}