at 16.09-beta 1.9 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" ]; 42 QTWEBKIT_PLUGIN_PATH = [ "/lib/mozilla/plugins/" ]; 43 GTK_PATH = [ "/lib/gtk-2.0" "/lib/gtk-3.0" ]; 44 XDG_CONFIG_DIRS = [ "/etc/xdg" ]; 45 XDG_DATA_DIRS = [ "/share" ]; 46 MOZ_PLUGIN_PATH = [ "/lib/mozilla/plugins" ]; 47 LIBEXEC_PATH = [ "/lib/libexec" ]; 48 }; 49 50 environment.extraInit = 51 '' 52 # reset TERM with new TERMINFO available (if any) 53 export TERM=$TERM 54 55 unset ASPELL_CONF 56 for i in ${concatStringsSep " " (reverseList cfg.profiles)} ; do 57 if [ -d "$i/lib/aspell" ]; then 58 export ASPELL_CONF="dict-dir $i/lib/aspell" 59 fi 60 done 61 62 export NIX_USER_PROFILE_DIR="/nix/var/nix/profiles/per-user/$USER" 63 export NIX_PROFILES="${concatStringsSep " " (reverseList cfg.profiles)}" 64 ''; 65 66 }; 67 68}