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