_module.args
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:
-
lib
: The nixpkgs library. -
config
: The results of all options after merging the values from all modules together. -
options
: The options declared in all modules. -
specialArgs
: ThespecialArgs
argument passed toevalModules
. -
All attributes of
specialArgs
Whereas 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
specialArgs
which are available during import resolution.For NixOS,
specialArgs
includesmodulesPath
, which allows you to import extra modules from the nixpkgs package tree without having to somehow make the module aware of the location of thenixpkgs
or NixOS directories.{ modulesPath, ... }: { imports = [ (modulesPath + "/profiles/minimal.nix") ]; }
For NixOS, the default value for this option includes at least this argument:
-
pkgs
: The nixpkgs package set according to thenixpkgs.pkgs
option.
Type: lazy attribute set of raw value
Declared by:
basePackages
Packages to be included in the wrapper package. However, there are differences in behavior when given certain values.
-
When the value is a bare package, the build process will use
$PACKAGE.overrideAttrs
to create the package. This makes it suitable to be used as part ofprograms.<name>.package
typically found on other environments (e.g., NixOS). Take note this means a rebuild of the package. -
When the value is a list of packages, the build process will use
symlinkJoin
as the builder to create the derivation.
Type: package or list of package
Default: [ ]
Example:
with pkgs; [ yt-dlp ]
Declared by:
build.extraPassthru
Set of data to be passed through passthru
of the resulting derivation.
Type: attribute set of anything
Default: { }
Declared by:
build.extraSetup
Additional script for setting up the wrapper script derivation.
Type: strings concatenated with “\n”
Default: ""
Declared by:
build.variant
Indicates the type of wrapper to be made. By default, wrapper-manager sets this to binary
.
Type: one of “binary”, “shell”
Default: "binary"
Example: "shell"
Declared by:
environment.pathAdd
A global list of paths to be added per-wrapper as part of the PATH
environment variable.
Type: list of path
Default: [ ]
Example:
wrapperManagerLib.getBin (with pkgs; [ yt-dlp gallery-dl ])
Declared by:
environment.variables
A global set of environment variables and their actions to be applied per-wrapper.
Type: attribute set of (submodule)
Default: { }
Example:
{ "FOO_TYPE".value = "custom"; "FOO_LOG_STYLE" = { action = "set-default"; value = "systemd"; }; "USELESS_VAR".action = "unset"; }
Declared by:
environment.variables.<name>.action
Sets the appropriate action for the environment variable.
-
unset
… unsets the given variable. -
set-default
only sets the variable with the given value if not already set. -
set
forcibly sets the variable with given value. -
prefix
andsuffix
prepends and appends the environment variable containing a given separator-delimited list of values respectively. It requires thevalue
to be a list of string and aseparator
value.
Type: one of “unset”, “set”, “set-default”, “prefix”, “suffix”
Default: "set"
Example: "unset"
Declared by:
environment.variables.<name>.separator
Separator used to create a character-delimited list of the environment variable holding a list of values.
Only used for |
Type: string
Default: ":"
Example: ";"
Declared by:
environment.variables.<name>.value
The value of the variable that is holding.
It accepts a list of values only for |
Type: (string and select types (numbers, boolean, and path) convertible to it) or list of (string and select types (numbers, boolean, and path) convertible to it)
Example: "HELLO THERE"
Declared by:
files
Extra set of files to be exported within the derivation.
Be careful when placing executables in |
Type: attribute set of (submodule)
Default: { }
Example:
{ "share/example-app/docs".source = ./docs; "etc/xdg".source = ./config; "share/example-app/example-config".text = ''' hello=world location=INSIDE OF YOUR WALLS '''; }
Declared by:
files.<name>.mode
Permissions to be given to the file. By default, it is given with a symlink.
Type: string matching the pattern [0-7]{0,4}
Default: "0644"
Example: "0600"
Declared by:
files.<name>.target
Path of the file relative to the derivation output path.
Type: non-empty string
Default: "‹name›"
Example: "share/applications/org.example.App1.desktop"
Declared by:
files.<name>.text
Text content of the given filesystem path.
Type: null or strings concatenated with “\n”
Default: null
Example:
'' key=value hello=world ''
Declared by:
locale.enable
Whether to enable explicit glibc locale support. This is recommended for Nix-built applications.
Type: boolean
Default: true
Example: false
Declared by:
locale.package
The package containing glibc locales.
Type: package
Default: <derivation glibc-locales-2.39-52>
Declared by:
wrappers
A set of wrappers to be included in the resulting derivation from wrapper-manager evaluation.
Type: attribute set of (submodule)
Default: { }
Example:
{ yt-dlp-audio = { arg0 = lib.getExe' pkgs.yt-dlp "yt-dlp"; prependArgs = [ "--config-location" ./config/yt-dlp/audio.conf ]; }; }
Declared by:
wrappers.<name>.appendArgs
A list of arguments to be appended to the user-given argument for the wrapper script.
Type: list of (string and select types (numbers, boolean, and path) convertible to it)
Default: [ ]
Example:
[ "--name" "doggo" "--location" "Your mom's home" ]
Declared by:
wrappers.<name>.arg0
The first argument of the wrapper script.
Type: string
Example: lib.getExe' pkgs.neofetch "neofetch"
Declared by:
wrappers.<name>.env
A global set of environment variables and their actions to be applied per-wrapper.
Type: attribute set of (submodule)
Default: { }
Example:
{ "FOO_TYPE".value = "custom"; "FOO_LOG_STYLE" = { action = "set-default"; value = "systemd"; }; "USELESS_VAR".action = "unset"; }
Declared by:
wrappers.<name>.env.<name>.action
Sets the appropriate action for the environment variable.
-
unset
… unsets the given variable. -
set-default
only sets the variable with the given value if not already set. -
set
forcibly sets the variable with given value. -
prefix
andsuffix
prepends and appends the environment variable containing a given separator-delimited list of values respectively. It requires thevalue
to be a list of string and aseparator
value.
Type: one of “unset”, “set”, “set-default”, “prefix”, “suffix”
Default: "set"
Example: "unset"
Declared by:
wrappers.<name>.env.<name>.separator
Separator used to create a character-delimited list of the environment variable holding a list of values.
Only used for |
Type: string
Default: ":"
Example: ";"
Declared by:
wrappers.<name>.env.<name>.value
The value of the variable that is holding.
It accepts a list of values only for |
Type: (string and select types (numbers, boolean, and path) convertible to it) or list of (string and select types (numbers, boolean, and path) convertible to it)
Example: "HELLO THERE"
Declared by:
wrappers.<name>.executableName
The name of the executable.
Type: non-empty string
Default: "‹name›"
Example: "custom-name"
Declared by:
wrappers.<name>.locale.enable
Whether to enable locale support for this wrapper. Recommended for Nix-built applications.
Type: boolean
Default: true
Example: false
Declared by:
wrappers.<name>.locale.package
The package containing glibc locales.
Type: package
Default: <derivation glibc-locales-2.39-52>
Declared by:
wrappers.<name>.makeWrapperArgs
A list of extra arguments to be passed as part of makeWrapper
build step.
Type: list of string
Example:
[ "--inherit-argv0" ]
Declared by:
wrappers.<name>.pathAdd
A global list of paths to be added per-wrapper as part of the PATH
environment variable.
Type: list of path
Default: [ ]
Example:
wrapperManagerLib.getBin (with pkgs; [ yt-dlp gallery-dl ])
Declared by:
wrappers.<name>.preScript
Script fragments to run before the main executable.
This option is only used when |
Type: strings concatenated with “\n”
Default: ""
Example:
echo "HELLO WORLD!"
Declared by:
wrappers.<name>.prependArgs
A list of arguments to be prepended to the user-given argument for the wrapper script.
Type: list of (string and select types (numbers, boolean, and path) convertible to it)
Default: [ ]
Example:
[ "--config" ./config.conf ]
Declared by:
wrappers.<name>.xdg.configDirs
A list of paths to be appended as part of the XDG_CONFIG_DIRS
environment to be applied per-wrapper.
Type: list of string
Default: [ ]
Example:
wrapperManagerLib.getXdgConfigDirs (with pkgs; [ yt-dlp neofetch ])
Declared by:
wrappers.<name>.xdg.dataDirs
A list of paths to be appended as part of the XDG_DATA_DIRS
environment to be applied per-wrapper.
Type: list of string
Default: [ ]
Example:
wrapperManagerLib.getXdgDataDirs (with pkgs; [ yt-dlp neofetch ])
Declared by:
wrappers.<name>.xdg.desktopEntry.enable
Whether to enable automatic creation of a desktop entry for the wrapper.
Type: boolean
Default: false
Example: true
Declared by:
wrappers.<name>.xdg.desktopEntry.settings
Settings to be passed to the makeDesktopItem
builder.
Type: attribute set of anything
Example:
{ mimeTypes = [ "text/html" "text/xml" ]; categories = [ "Applications" "Network" ]; }
Declared by:
wrappers.<name>.xdg.desktopEntry.settings.categories
List of categories should the application be shown in a menu.
Type: list of non-empty string
Default: [ ]
Example:
[ "Applications" "Network" ]
Declared by:
wrappers.<name>.xdg.desktopEntry.settings.desktopName
Specific name of the application.
Type: non-empty string
Default: "‹name›"
Example: "Firefox"
Declared by:
wrappers.<name>.xdg.desktopEntry.settings.exec
Program with execute along with its arguments.
Type: null or non-empty string
Default: null
Example: "firefox %U"
Declared by:
wrappers.<name>.xdg.desktopEntry.settings.genericName
Generic name of the application.
Type: null or non-empty string
Default: null
Example: "Web browser"
Declared by:
wrappers.<name>.xdg.desktopEntry.settings.mimeTypes
The MIME types supported by the application.
Type: list of non-empty string
Default: [ ]
Example:
[ "text/html" "text/xml" ]
Declared by:
wrappers.<name>.xdg.desktopEntry.settings.name
The name of the desktop file.
Type: non-empty string
Default: "‹name›"
Example: "firefox"
Declared by:
wrappers.<name>.xdg.desktopEntry.settings.terminal
Whether the program runs in a terminal window.
Type: boolean
Default: false
Example: true
Declared by:
xdg.configDirs
A list of paths to be appended as part of the XDG_CONFIG_DIRS
environment to be applied per-wrapper.
Type: list of string
Default: [ ]
Example:
wrapperManagerLib.getXdgConfigDirs (with pkgs; [ yt-dlp neofetch ])
Declared by:
xdg.dataDirs
A list of paths to be appended as part of the XDG_DATA_DIRS
environment to be applied per-wrapper.
Type: list of string
Default: [ ]
Example:
wrapperManagerLib.getXdgDataDirs (with pkgs; [ yt-dlp neofetch ])
Declared by:
xdg.desktopEntries
A set of desktop entries to be exported along with the wrapped package. The attribute name will be used as the filename of the generated desktop entry file.
Type: attribute set of (attribute set of anything)
Default: { }
Example:
{ firefox = { name = "Firefox"; genericName = "Web browser"; exec = "firefox %u"; terminal = false; categories = [ "Application" "Network" "WebBrowser" ]; mimeTypes = [ "text/html" "text/xml" ]; extraConfig."X-GNOME-Autostart-Phase" = "WindowManager"; keywords = [ "Web" "Browser" ]; startupNotify = false; startupWMClass = "MyOwnClass"; }; }
Declared by:
xdg.desktopEntries.<name>.categories
List of categories should the application be shown in a menu.
Type: list of non-empty string
Default: [ ]
Example:
[ "Applications" "Network" ]
Declared by:
xdg.desktopEntries.<name>.desktopName
Specific name of the application.
Type: non-empty string
Default: "‹name›"
Example: "Firefox"
Declared by:
xdg.desktopEntries.<name>.exec
Program with execute along with its arguments.
Type: null or non-empty string
Default: null
Example: "firefox %U"
Declared by:
xdg.desktopEntries.<name>.genericName
Generic name of the application.
Type: null or non-empty string
Default: null
Example: "Web browser"
Declared by:
xdg.desktopEntries.<name>.mimeTypes
The MIME types supported by the application.
Type: list of non-empty string
Default: [ ]
Example:
[ "text/html" "text/xml" ]
Declared by:
xdg.desktopEntries.<name>.name
The name of the desktop file.
Type: non-empty string
Default: "‹name›"
Example: "firefox"
Declared by: