Environment
Environment
environment.budgie.excludePackages
Which packages Budgie should exclude from the default environment.
Type: list of package
Default
[ ]
Example
[ pkgs.mate-terminal ]
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/x11/desktop-managers/budgie.nix
environment.cinnamon.excludePackages
Which packages cinnamon should exclude from the default environment
Type: list of package
Default
[ ]
Example
[ pkgs.cinnamon.blueberry ]
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/x11/desktop-managers/cinnamon.nix
environment.deepin.excludePackages
List of default packages to exclude from the configuration
Type: list of package
Default
[ ]
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/x11/desktop-managers/deepin.nix
environment.defaultPackages
Set of default packages that aren't strictly necessary for a running system, entries can be removed for a more minimal NixOS installation.
Like with systemPackages, packages are installed to
{file}/run/current-system/sw
. They are
automatically available to all users, and are
automatically updated every time you rebuild the system
configuration.
Type: list of package
Default
these packages, with their meta.priority
numerically increased
(thus lowering their installation priority):
[ pkgs.perl pkgs.rsync pkgs.strace ]
Example
[ ]
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/config/system-path.nix
environment.enableAllTerminfo
Whether to install all terminfo outputs
Type: boolean
Default
false
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/config/terminfo.nix
environment.enableDebugInfo
Some NixOS packages provide debug symbols. However, these are
not included in the system closure by default to save disk
space. Enabling this option causes the debug symbols to appear
in {file}/run/current-system/sw/lib/debug/.build-id
,
where tools such as {command}gdb
can find them.
If you need debug symbols for a package that doesn't
provide them by default, you can enable them as follows:
nixpkgs.config.packageOverrides = pkgs: {
hello = pkgs.hello.overrideAttrs (oldAttrs: {
separateDebugInfo = true;
});
};
Type: boolean
Default
false
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/config/debug-info.nix
environment.etc
Set of files that have to be linked in {file}/etc
.
Type: attribute set of (submodule)
Default
{ }
Example
{ example-configuration-file ={ source = "/nix/store/.../etc/dir/file.conf.example";mode = "0440";};"default/useradd".text = "GROUP=100 ...";}
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/system/etc/etc.nix
environment.etc.<name>.enable
Whether this /etc file should be generated. This option allows specific /etc files to be disabled.
Type: boolean
Default
true
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/system/etc/etc.nix
environment.etc.<name>.gid
GID of created file. Only takes effect when the file is copied (that is, the mode is not 'symlink').
Type: signed integer
Default
0
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/system/etc/etc.nix
environment.etc.<name>.group
Group name of created file.
Only takes effect when the file is copied (that is, the mode is not 'symlink').
Changing this option takes precedence over gid
.
Type: string
Default
"+0"
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/system/etc/etc.nix
environment.etc.<name>.mode
If set to something else than symlink
,
the file is copied instead of symlinked, with the given
file mode.
Type: string
Default
"symlink"
Example
"0600"
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/system/etc/etc.nix
environment.etc.<name>.source
Path of the source file.
Type: path
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/system/etc/etc.nix
environment.etc.<name>.target
Name of symlink (relative to
{file}/etc
). Defaults to the attribute
name.
Type: string
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/system/etc/etc.nix
environment.etc.<name>.text
Text of the file.
Type: null or strings concatenated with "\n"
Default
null
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/system/etc/etc.nix
environment.etc.<name>.uid
UID of created file. Only takes effect when the file is copied (that is, the mode is not 'symlink').
Type: signed integer
Default
0
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/system/etc/etc.nix
environment.etc.<name>.user
User name of created file.
Only takes effect when the file is copied (that is, the mode is not 'symlink').
Changing this option takes precedence over uid
.
Type: string
Default
"+0"
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/system/etc/etc.nix
environment.extraInit
Shell script code called during global environment initialisation after all variables and profileVariables have been set. This code is assumed to be shell-independent, which means you should stick to pure sh without sh word split.
Type: strings concatenated with "\n"
Default
""
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/config/shells-environment.nix
environment.extraOutputsToInstall
Entries listed here will be appended to the meta.outputsToInstall
attribute for each package in environment.systemPackages
, and the files from the corresponding derivation outputs symlinked into {file}/run/current-system/sw
.
For example, this can be used to install the dev
and info
outputs for all packages in the system environment, if they are available.
To use specific outputs instead of configuring them globally, select the corresponding attribute on the package derivation, e.g. libxml2.dev
or coreutils.info
.
Type: list of string
Default
[ ]
Example
["dev""info"]
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/config/system-path.nix
environment.extraSetup
Shell fragments to be run after the system environment has been created. This should only be used for things that need to modify the internals of the environment, e.g. generating MIME caches. The environment being built can be accessed at $out.
Type: strings concatenated with "\n"
Default
""
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/config/system-path.nix
environment.freetds
Configure freetds database entries. Each attribute denotes a section within freetds.conf, and the value (a string) is the config content for that section. When at least one entry is configured the global environment variables FREETDSCONF, FREETDS and SYBASE will be configured to allow the programs that use freetds to find the library and config.
Type: attribute set of string
Default
{ }
Example
{ MYDATABASE = '' host = 10.0.2.100 port = 1433 tds version = 7.2 '';}
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/programs/freetds.nix
environment.gnome.excludePackages
Which packages gnome should exclude from the default environment
Type: list of package
Default
[ ]
Example
[ pkgs.totem ]
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/x11/desktop-managers/gnome.nix
environment.homeBinInPath
Include ~/bin/ in $PATH.
Type: boolean
Default
false
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/config/shells-environment.nix
environment.interactiveShellInit
Shell script code called during interactive shell initialisation. This code is assumed to be shell-independent, which means you should stick to pure sh without sh word split.
Type: strings concatenated with "\n"
Default
""
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/config/shells-environment.nix
environment.ldso
The executable to link into the normal FHS location of the ELF loader.
Type: null or path
Default
null
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/config/ldso.nix
environment.ldso32
The executable to link into the normal FHS location of the 32-bit ELF loader.
This currently only works on x86_64 architectures.
Type: null or path
Default
null
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/config/ldso.nix
environment.localBinInPath
Add ~/.local/bin/ to $PATH
Type: boolean
Default
false
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/config/shells-environment.nix
environment.loginShellInit
Shell script code called during login shell initialisation. This code is assumed to be shell-independent, which means you should stick to pure sh without sh word split.
Type: strings concatenated with "\n"
Default
""
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/config/shells-environment.nix
environment.lxqt.excludePackages
Which LXQt packages to exclude from the default environment
Type: list of package
Default
[ ]
Example
[ pkgs.lxqt.qterminal ]
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/x11/desktop-managers/lxqt.nix
environment.mate.excludePackages
Which MATE packages to exclude from the default environment
Type: list of package
Default
[ ]
Example
[ pkgs.mate.mate-terminal pkgs.mate.pluma ]
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/x11/desktop-managers/mate.nix
environment.memoryAllocator.provider
The system-wide memory allocator.
Briefly, the system-wide memory allocator providers are:
libc
: the standard allocator provided by libcgraphene-hardened
: Hardened memory allocator coming from GrapheneOS project. The default configuration template has all normal optional security features enabled and is quite aggressive in terms of sacrificing performance and memory usage for security.graphene-hardened-light
: Hardened memory allocator coming from GrapheneOS project. The light configuration template disables the slab quarantines, write after free check, slot randomization and raises the guard slab interval from 1 to 8 but leaves zero-on-free and slab canaries enabled. The light configuration has solid performance and memory usage while still being far more secure than mainstream allocators with much better security properties.jemalloc
: A general purpose allocator that emphasizes fragmentation avoidance and scalable concurrency support.mimalloc
: A compact and fast general purpose allocator, which may optionally be built with mitigations against various heap vulnerabilities.scudo
: A user-mode allocator based on LLVM Sanitizer’s CombinedAllocator, which aims at providing additional mitigations against heap based vulnerabilities, while maintaining good performance.
::: {.warning}
Selecting an alternative allocator (i.e., anything other than
libc
) may result in instability, data loss,
and/or service failure.
:::
Type: one of "libc", "graphene-hardened", "graphene-hardened-light", "jemalloc", "mimalloc", "scudo"
Default
"libc"
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/config/malloc.nix
environment.noXlibs
Switch off the options in the default configuration that require X11 libraries. This includes client-side font configuration and SSH forwarding of X11 authentication in. Thus, you probably do not want to enable this option if you want to run X11 programs on this machine via SSH.
Type: boolean
Default
false
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/config/no-x-libs.nix
environment.pantheon.excludePackages
Which packages pantheon should exclude from the default environment
Type: list of package
Default
[ ]
Example
[ pkgs.pantheon.elementary-camera ]
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/x11/desktop-managers/pantheon.nix
environment.pathsToLink
List of directories to be symlinked in {file}/run/current-system/sw
.
Type: list of string
Default
[ ]
Example
["/"]
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/config/system-path.nix
environment.plasma5.excludePackages
List of default packages to exclude from the configuration
Type: list of package
Default
[ ]
Example
[ pkgs.plasma5Packages.oxygen ]
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/x11/desktop-managers/plasma5.nix
environment.plasma6.excludePackages
List of default packages to exclude from the configuration
Type: list of package
Default
[ ]
Example
[ pkgs.kdePackages.elisa ]
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/desktop-managers/plasma6.nix
environment.profileRelativeEnvVars
Attribute set of environment variable. Each attribute maps to a list
of relative paths. Each relative path is appended to the each profile
of {option}environment.profiles
to form the content of the
corresponding environment variable.
Type: attribute set of list of string
Example
{MANPATH = ["/man""/share/man"];PATH = ["/bin"];}
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/config/shells-environment.nix
environment.profileRelativeSessionVariables
Attribute set of environment variable used in the global environment. These variables will be set by PAM early in the login process.
Variable substitution is available as described in
{manpage}pam_env.conf(5)
.
Each attribute maps to a list of relative paths. Each relative
path is appended to the each profile of
{option}environment.profiles
to form the content of
the corresponding environment variable.
Also, these variables are merged into
and it is
therefore not possible to use PAM style variables such as
@{HOME}
.
Type: attribute set of list of string
Example
{MANPATH = ["/man""/share/man"];PATH = ["/bin"];}
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/config/system-environment.nix
environment.profiles
A list of profiles used to setup the global environment.
Type: list of string
Default
[ ]
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/config/shells-environment.nix
environment.sessionVariables
A set of environment variables used in the global environment. These variables will be set by PAM early in the login process.
The value of each session variable can be either a string or a list of strings. The latter is concatenated, interspersed with colon characters.
Note, due to limitations in the PAM format values may not
contain the "
character.
Also, these variables are merged into
and it is
therefore not possible to use PAM style variables such as
@{HOME}
.
Type: attribute set of ((list of (signed integer or string or path)) or signed integer or string or path)
Default
{ }
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/config/system-environment.nix
environment.shellAliases
An attribute set that maps aliases (the top level attribute names in
this option) to command strings or directly to build outputs. The
aliases are added to all users' shells.
Aliases mapped to null
are ignored.
Type: attribute set of (null or string or path)
Example
{l = null;ll = "ls -l";}
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/config/shells-environment.nix
environment.shellInit
Shell script code called during shell initialisation. This code is assumed to be shell-independent, which means you should stick to pure sh without sh word split.
Type: strings concatenated with "\n"
Default
""
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/config/shells-environment.nix
environment.shells
A list of permissible login shells for user accounts.
No need to mention /bin/sh
here, it is placed into this list implicitly.
Type: list of (package or path)
Default
[ ]
Example
[ pkgs.bashInteractive pkgs.zsh ]
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/config/shells-environment.nix
environment.stub-ld.enable
Install a stub ELF loader to print an informative error message in the event that a user attempts to run an ELF binary not compiled for NixOS.
Type: boolean
Default
true
Example
false
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/config/stub-ld.nix
environment.systemPackages
The set of packages that appear in
/run/current-system/sw. These packages are
automatically available to all users, and are
automatically updated every time you rebuild the system
configuration. (The latter is the main difference with
installing them in the default profile,
{file}/nix/var/nix/profiles/default
.
Type: list of package
Default
[ ]
Example
[ pkgs.firefox pkgs.thunderbird ]
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/config/system-path.nix
environment.unixODBCDrivers
Specifies Unix ODBC drivers to be registered in
{file}/etc/odbcinst.ini
. You may also want to
add pkgs.unixODBC
to the system path to get
a command line client to connect to ODBC databases.
Type: list of package
Default
[ ]
Example
with pkgs.unixODBCDrivers; [ sqlite psql ]
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/config/unix-odbc-drivers.nix
environment.variables
A set of environment variables used in the global environment. These variables will be set on shell initialisation (e.g. in /etc/profile). The value of each variable can be either a string or a list of strings. The latter is concatenated, interspersed with colon characters.
Type: attribute set of ((list of (signed integer or string or path)) or signed integer or string or path)
Default
{ }
Example
{EDITOR = "nvim";VISUAL = "nvim";}
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/config/shells-environment.nix
environment.wordlist.enable
Whether to enable environment variables for lists of words.
Type: boolean
Default
false
Example
true
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/misc/wordlist.nix
environment.wordlist.lists
A set with the key names being the environment variable you'd like to set and the values being a list of paths to text documents containing lists of words. The various files will be merged, sorted, duplicates removed, and extraneous spacing removed.
If you have a handful of words that you want to add to an already
existing wordlist, you may find builtins.toFile
useful for this
task.
Type: attribute set of non-empty (list of path)
Default
{WORDLIST = [ "${pkgs.scowl}/share/dict/words.txt" ];}
Example
{WORDLIST = [ "${pkgs.scowl}/share/dict/words.txt" ];AUGMENTED_WORDLIST = ["${pkgs.scowl}/share/dict/words.txt""${pkgs.scowl}/share/dict/words.variants.txt"(builtins.toFile "extra-words" '' desynchonization oobleck'')];}
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/misc/wordlist.nix
environment.xfce.excludePackages
Which packages XFCE should exclude from the default environment
Type: list of package
Default
[ ]
Example
[ pkgs.xfce.xfce4-volumed-pulse ]
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/x11/desktop-managers/xfce.nix
environment.checkConfigurationOptions
Alias of {option}_module.check
.
Type: boolean
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/rename.nix