1 # This module defines a standard configuration for NixOS global environment.
3 # Most of the stuff here should probably be moved elsewhere sometime.
11 cfg = config.environment;
19 environment.variables =
20 { NIXPKGS_CONFIG = "/etc/nix/nixpkgs-config.nix";
21 # note: many programs exec() this directly, so default options for less must not
22 # be specified here; do so in the default value of programs.less.envVariables instead
23 PAGER = mkDefault "less";
24 EDITOR = mkDefault "nano";
27 # since we set PAGER to this above, make sure it's installed
28 programs.less.enable = true;
30 environment.profiles = mkAfter
31 [ "/nix/var/nix/profiles/default"
32 "/run/current-system/sw"
35 environment.sessionVariables =
37 XDG_CONFIG_DIRS = [ "/etc/xdg" ]; # needs to be before profile-relative paths to allow changes through environment.etc
40 # TODO: move most of these elsewhere
41 environment.profileRelativeSessionVariables =
43 INFOPATH = [ "/info" "/share/info" ];
44 QTWEBKIT_PLUGIN_PATH = [ "/lib/mozilla/plugins/" ];
45 GTK_PATH = [ "/lib/gtk-2.0" "/lib/gtk-3.0" "/lib/gtk-4.0" ];
46 XDG_CONFIG_DIRS = [ "/etc/xdg" ];
47 XDG_DATA_DIRS = [ "/share" ];
48 LIBEXEC_PATH = [ "/lib/libexec" ];
51 environment.pathsToLink = [ "/lib/gtk-2.0" "/lib/gtk-3.0" "/lib/gtk-4.0" ];
53 environment.extraInit =
55 export NIX_USER_PROFILE_DIR="/nix/var/nix/profiles/per-user/$USER"
56 export NIX_PROFILES="${concatStringsSep " " (reverseList cfg.profiles)}"