Additional arguments passed to each module in addition to ones
like lib, config,
and pkgs, modulesPath.
This option is also available to all submodules. Submodules do not
inherit args from their parent module, nor do they provide args to
their parent module or sibling submodules. The sole exception to
this is the argument name which is provided by
parent modules to a submodule and contains the attribute name
the submodule is bound to, or a unique generated name if it is
not bound to an attribute.
Some arguments are already passed by default, of which the following cannot be changed with this option:
-
{var}
lib: The nixpkgs library. -
{var}
config: The results of all options after merging the values from all modules together. -
{var}
options: The options declared in all modules. -
{var}
specialArgs: ThespecialArgsargument passed toevalModules. -
All attributes of {var}
specialArgsWhereas option values can generally depend on other option values thanks to laziness, this does not apply to
imports, which must be computed statically before anything else.For this reason, callers of the module system can provide
specialArgswhich are available during import resolution.For NixOS,
specialArgsincludes {var}modulesPath, which allows you to import extra modules from the nixpkgs package tree without having to somehow make the module aware of the location of thenixpkgsor NixOS directories.{ modulesPath, ... }: { imports = [ (modulesPath + "/profiles/minimal.nix") ]; }
For NixOS, the default value for this option includes at least this argument:
- {var}
pkgs: The nixpkgs package set according to the {option}nixpkgs.pkgsoption.
Type: lazy attribute set of raw value
Declared in:
Add commands to the environment.
Default value:
{"_type":"literalExpression","text":"[ ]"}Type: list of ((package or string convertible to it) or (list with two elements of types: [ string (package or string convertible to it) ]) or (flatOptions))
Example value:
{"_type":"literalExpression","text":"[\n {\n help = \"print hello\";\n name = \"hello\";\n command = \"echo hello\";\n }\n\n {\n package = \"nixpkgs-fmt\";\n category = \"formatter\";\n }\n]\n"}Declared in:
A config for a command when the commands option is a list.
Type: (package or string convertible to it) or (list with two elements of types: [ string (package or string convertible to it) ]) or (flatOptions)
Example value:
{"_type":"literalExpression","text":"[\n {\n category = \"scripts\";\n package = \"black\";\n }\n [ \"[package] print hello\" \"hello\" ]\n \"nodePackages.yarn\"\n]\n"}Declared in:
Used to bring in a specific package. This package will be added to the environment.
Default value:
{"_type":"literalExpression","text":"null"}Type: null or (package or string convertible to it) or package
Declared in:
Sets a free text category under which this command is grouped and shown in the devshell menu.
Default value:
{"_type":"literalExpression","text":"\"[general commands]\""}Type: string
Declared in:
If defined, it will add a script with the name of the command, and the content of this value.
By default it generates a bash script, unless a different shebang is provided.
Default value:
{"_type":"literalExpression","text":"null"}Type: null or string
Example value:
{"_type":"literalExpression","text":"''\n #!/usr/bin/env python\n print(\"Hello\")\n''"}Declared in:
When true, the (flatOptions) command
or the (flatOptions) package will be added to the environment.
Otherwise, they will not be added to the environment, but will be printed in the devshell menu.
Default value:
{"_type":"literalExpression","text":"true"}Type: boolean
Declared in:
Describes what the command does in one line of text.
Default value:
{"_type":"literalExpression","text":"null"}Type: null or string
Declared in:
Name of this command.
Defaults to a package (flatOptions) name or pname if present.
The value of this option is required for a command (flatOptions).
Default value:
{"_type":"literalExpression","text":"null"}Type: null or string
Declared in:
Prefix of the command name in the devshell menu.
Default value:
{"_type":"literalExpression","text":"\"\""}Type: string
Declared in:
The set of packages to appear in the project environment.
Those packages come from https://nixos.org/NixOS/nixpkgs and can be searched by going to https://search.nixos.org/packages
Default value:
{"_type":"literalExpression","text":"[ ]"}Type: list of (package or string convertible to it)
Declared in:
Add all the build dependencies from the listed packages to the environment.
Default value:
{"_type":"literalExpression","text":"[ ]"}Type: list of (package or string convertible to it)
Declared in:
A list of other steps that this one depends on.
Default value:
{"_type":"literalExpression","text":"[ ]"}Type: list of string
Declared in:
Script to run.
Type: string
Declared in:
Whether to enable load etc/profiles.d/*.sh in the shell.
Default value:
{"_type":"literalExpression","text":"false"}Type: boolean
Example value:
{"_type":"literalExpression","text":"true"}Declared in:
Metadata, such as 'meta.description'. Can be useful as metadata for downstream tooling.
Default value:
{"_type":"literalExpression","text":"{ }"}Type: attribute set of anything
Declared in:
Message Of The Day.
This is the welcome message that is being printed when the user opens the shell.
You may use any valid ansi color from the 8-bit ansi color table. For example, to use a green color you would use something like {106}. You may also use {bold}, {italic}, {underline}. Use {reset} to turn off all attributes.
Default value:
{"_type":"literalExpression","text":"''\n {202}🔨 Welcome to devshell{reset}\n $(type -p menu &>/dev/null && menu)\n''"}Type: string
Declared in:
Name of the shell environment. It usually maps to the project name.
Default value:
{"_type":"literalExpression","text":"\"devshell\""}Type: string
Declared in:
If IN_NIX_SHELL is nonempty, or DIRENV_IN_ENVRC is set to '1', then PRJ_ROOT is set to the value of PWD.
This option specifies the path to use as the value of PRJ_ROOT in case IN_NIX_SHELL is empty or unset and DIRENV_IN_ENVRC is any value other than '1'.
Set this to null to force PRJ_ROOT to be defined at runtime (except if IN_NIX_SHELL or DIRENV_IN_ENVRC are defined as described above).
Otherwise, you can set this to a string representing the desired default path, or to a submodule of the same type valid in the 'env' options list (except that the 'name' field is ignored).
Default value:
{"_type":"literalExpression","text":"{\n eval = \"$PWD\";\n}"}Type: null or ((submodule) or non-empty string convertible to it)
Example value:
{"_type":"literalExpression","text":"{\n # Use the top-level directory of the working tree\n eval = \"$(git rev-parse --show-toplevel)\";\n};\n"}Declared in:
Like value but not evaluated by Bash. This allows to inject other
variable names or even commands using the $() notation.
Default value:
{"_type":"literalExpression","text":"null"}Type: null or string
Example value:
{"_type":"literalExpression","text":"\"$OTHER_VAR\""}Declared in:
Name of the environment variable
Type: string
Declared in:
Prepend to PATH-like environment variables.
For example name = "PATH"; prefix = "bin"; will expand the path of ./bin and prepend it to the PATH, separated by ':'.
Default value:
{"_type":"literalExpression","text":"null"}Type: null or string
Example value:
{"_type":"literalExpression","text":"\"bin\""}Declared in:
Whether to enable unsets the variable.
Default value:
{"_type":"literalExpression","text":"false"}Type: boolean
Example value:
{"_type":"literalExpression","text":"true"}Declared in:
Shell-escaped value to set
Default value:
{"_type":"literalExpression","text":"null"}Type: null or string or signed integer or boolean or package
Declared in:
A list of other steps that this one depends on.
Default value:
{"_type":"literalExpression","text":"[ ]"}Type: list of string
Declared in:
Script to run.
Type: string
Declared in:
Add environment variables to the shell.
Default value:
{"_type":"literalExpression","text":"[ ]"}Type: list of (submodule)
Example value:
{"_type":"literalExpression","text":"[\n {\n name = \"HTTP_PORT\";\n value = 8080;\n }\n {\n name = \"PATH\";\n prefix = \"bin\";\n }\n {\n name = \"XDG_CACHE_DIR\";\n eval = \"$PRJ_ROOT/.cache\";\n }\n {\n name = \"CARGO_HOME\";\n unset = true;\n }\n]\n"}Declared in:
Like value but not evaluated by Bash. This allows to inject other
variable names or even commands using the $() notation.
Default value:
{"_type":"literalExpression","text":"null"}Type: null or string
Example value:
{"_type":"literalExpression","text":"\"$OTHER_VAR\""}Declared in:
Name of the environment variable
Type: string
Declared in:
Prepend to PATH-like environment variables.
For example name = "PATH"; prefix = "bin"; will expand the path of ./bin and prepend it to the PATH, separated by ':'.
Default value:
{"_type":"literalExpression","text":"null"}Type: null or string
Example value:
{"_type":"literalExpression","text":"\"bin\""}Declared in:
Whether to enable unsets the variable.
Default value:
{"_type":"literalExpression","text":"false"}Type: boolean
Example value:
{"_type":"literalExpression","text":"true"}Declared in:
Shell-escaped value to set
Default value:
{"_type":"literalExpression","text":"null"}Type: null or string or signed integer or boolean or package
Declared in:
Set the glibc locale package that will be used on Linux
Default value:
{"_type":"literalExpression","text":"\"pkgs.glibcLocales\""}Type: package
Declared in:
Set the language of the project
Default value:
{"_type":"literalExpression","text":"null"}Type: null or string
Example value:
{"_type":"literalExpression","text":"\"en_GB.UTF-8\""}Declared in:
Whether to enable install .git/hooks on shell entry.
Default value:
{"_type":"literalExpression","text":"false"}Type: boolean
Example value:
{"_type":"literalExpression","text":"true"}Declared in:
Text of the script to install
Default value:
{"_type":"literalExpression","text":"\"\""}Type: string
Declared in:
Text of the script to install
Default value:
{"_type":"literalExpression","text":"\"\""}Type: string
Declared in:
Text of the script to install
Default value:
{"_type":"literalExpression","text":"\"\""}Type: string
Declared in:
Text of the script to install
Default value:
{"_type":"literalExpression","text":"\"\""}Type: string
Declared in:
Text of the script to install
Default value:
{"_type":"literalExpression","text":"\"\""}Type: string
Declared in:
Text of the script to install
Default value:
{"_type":"literalExpression","text":"\"\""}Type: string
Declared in:
Text of the script to install
Default value:
{"_type":"literalExpression","text":"\"\""}Type: string
Declared in:
Text of the script to install
Default value:
{"_type":"literalExpression","text":"\"\""}Type: string
Declared in:
Text of the script to install
Default value:
{"_type":"literalExpression","text":"\"\""}Type: string
Declared in:
Text of the script to install
Default value:
{"_type":"literalExpression","text":"\"\""}Type: string
Declared in:
Which C compiler to use
Default value:
{"_type":"literalExpression","text":"\"pkgs.clang\""}Type: package or string convertible to it
Declared in:
C dependencies from nixpkgs
Default value:
{"_type":"literalExpression","text":"[ ]"}Type: list of (package or string convertible to it)
Declared in:
Use this when another language dependens on a dynamic library
Default value:
{"_type":"literalExpression","text":"[ ]"}Type: list of (package or string convertible to it)
Declared in:
Which go package to use
Default value:
{"_type":"literalExpression","text":"<derivation go-1.21.5>"}Type: package or string convertible to it
Example value:
{"_type":"literalExpression","text":"pkgs.go"}Declared in:
Enable Go modules
Default value:
{"_type":"literalExpression","text":"\"on\""}Type: one of "on", "off", "auto"
Declared in:
Which Perl package to use
Default value:
{"_type":"literalExpression","text":"<derivation perl-5.38.2>"}Type: package or string convertible to it
Example value:
{"_type":"literalExpression","text":"pkgs.perl538"}Declared in:
List of extra packages (coming from perl5XXPackages) to add
Default value:
{"_type":"literalExpression","text":"[ ]"}Type: list of (package or string convertible to it)
Example value:
{"_type":"literalExpression","text":"[ perl538Packages.FileNext ]"}Declared in:
List of paths to add to PERL5LIB
Default value:
{"_type":"literalExpression","text":"[ ]"}Type: list of string
Example value:
{"_type":"literalExpression","text":"[ ./lib ]"}Declared in:
Ruby version used by your project
Default value:
{"_type":"literalExpression","text":"\"pkgs.ruby_3_2\""}Type: package or string convertible to it
Declared in:
Use this when your gems depend on a dynamic library
Default value:
{"_type":"literalExpression","text":"[ ]"}Type: list of (package or string convertible to it)
Declared in:
Enable the default rust toolchain coming from nixpkgs
Default value:
{"_type":"literalExpression","text":"\"true\""}Type: boolean
Declared in:
Which rust package set to use
Default value:
{"_type":"literalExpression","text":"\"pkgs.rustPlatform\""}Type: attribute set
Declared in:
Which rust tools to pull from the platform package set
Default value:
{"_type":"literalExpression","text":"[\n \"rustc\"\n \"cargo\"\n \"clippy\"\n \"rustfmt\"\n]"}Type: list of string
Declared in:
Add services to the environment. Services can be used to group long-running processes.
Default value:
{"_type":"literalExpression","text":"{ }"}Type: attribute set of (submodule)
Declared in:
Short description of the service group, shown in generated commands
Default value:
{"_type":"literalExpression","text":"null"}Type: null or string
Declared in:
Name of the service group. Defaults to attribute name in groups.
Default value:
{"_type":"literalExpression","text":"null"}Type: null or string
Declared in:
Attrset of services that should be run in this group.
Default value:
{"_type":"literalExpression","text":"{ }"}Type: attribute set of (submodule)
Declared in:
Command to execute.
Type: string
Declared in:
Name of this service. Defaults to attribute name in group services.
Default value:
{"_type":"literalExpression","text":"null"}Type: null or string
Declared in:
Which version of postgres to use
Default value:
{"_type":"literalExpression","text":"\"pkgs.postgresql\""}Type: package or string convertible to it
Declared in:
Create a database named like current user on startup.
This option only makes sense when setupPostgresOnStartup is true.
Default value:
{"_type":"literalExpression","text":"true"}Type: boolean
Declared in:
Additional arguments passed to initdb during data dir initialisation.
Default value:
{"_type":"literalExpression","text":"[\n \"--no-locale\"\n]"}Type: list of string
Example value:
{"_type":"literalExpression","text":"[\n \"--data-checksums\"\n \"--allow-group-access\"\n]"}Declared in:
Whether to enable call setup-postgres on startup.
Default value:
{"_type":"literalExpression","text":"false"}Type: boolean
Example value:
{"_type":"literalExpression","text":"true"}Declared in: