Skip to content

API Documentation

The following are all the options that you can use in wrapper-manager.

Main API

wrapperType

Which wrapper type to use by default for all wrappers.

Type
plaintext
one of "shell", "binary"
Default
nix
"binary"
Example
nix
"shell"
Declaration

wrappers

Wrappers to create.

Type
plaintext
attribute set of (submodule)
Example
nix
{
  hello = {
    basePackage = pkgs.hello;
    prependFlags = [
      "-g"
      "Hi"
    ];
  };
}
Declaration

wrappers.<name>.appendFlags

Flags passed after any arguments to the wrapped program. Usually you want to use prependFlags instead.

Type
plaintext
list of (string or anything convertible to it)
Default
nix
[ ]
Example
nix
["--config-file" ./config.toml]
Declaration

wrappers.<name>.basePackage

Program to be wrapped

Type
plaintext
package
Declaration

wrappers.<name>.env

Structured configuration for environment variables.

Type
plaintext
attribute set of (submodule)
Default
nix
{ }
Example
nix
{
  GIT_CONFIG.value = ./gitconfig;
}
Declaration

wrappers.<name>.env.<name>.force

Whether the value should be always set to the specified value. If set to true, the program will not inherit the value of the variable if it's already present in the environment.

Setting it to false when unsetting a variable (value = null) will make the option have no effect.

Type
plaintext
boolean
Default
plaintext
true if `value` is null, otherwise false
Example
nix
true
Declaration

wrappers.<name>.env.<name>.name

Name of the variable.

Type
plaintext
string
Default
nix
"‹name›"
Example
nix
"GIT_CONFIG"
Declaration

wrappers.<name>.env.<name>.value

Value of the variable to be set. Set to null to unset the variable.

Note that any environment variable will be escaped. For example, value = "$HOME" will be converted to the literal $HOME, with its dollar sign.

Type
plaintext
null or (string or anything convertible to it)
Example
nix
./gitconfig
Declaration

wrappers.<name>.extraPackages

Optional extra packages to also wrap

Type
plaintext
list of package
Default
nix
[ ]
Declaration

wrappers.<name>.extraWrapperFlags

Raw flags passed to makeWrapper. You may want to use wrapFlags instead.

Type
plaintext
strings concatenated with " "
Default
nix
""
Example
nix
"--argv0 foo --set BAR value"
Declaration

wrappers.<name>.flags

(Deprecated) Flags passed before any arguments to the wrapped program. Use prependFlags instead

Type
plaintext
list of (string or anything convertible to it)
Default
nix
[ ]
Declaration

wrappers.<name>.overrideAttrs

Function to override attributes from the final package.

Type
plaintext
function that evaluates to a(n) (attribute set)
Default
nix
lib.id
Example
nix
old: {
  pname = "${pname}-with-settings";
}
Declaration

wrappers.<name>.pathAdd

Packages to append to PATH.

Type
plaintext
list of package
Default
nix
[ ]
Example
nix
[ pkgs.starship ]
Declaration

wrappers.<name>.postBuild

Raw commands to execute after the wrapping process has finished

Type
plaintext
string
Default
nix
""
Example
nix
''
  echo "Running sanity check"
  $out/bin/nvim '+q'
''
Declaration

wrappers.<name>.prependFlags

Flags passed before any arguments to the wrapped program.

Type
plaintext
list of (string or anything convertible to it)
Default
nix
[ ]
Example
nix
["--config-file" ./config.toml]
Declaration

wrappers.<name>.wrapFlags

Structured flags passed to makeWrapper.

Type
plaintext
list of (string or anything convertible to it)
Default
nix
[ ]
Example
nix
[
  "--argv0"
  "myprog"
]
Declaration

wrappers.<name>.wrapped

(Read-only) The final wrapped package

Type
plaintext
package
Declaration

wrappers.<name>.wrapperType

Whether to use a binary or a shell wrapper.

Type
plaintext
one of "shell", "binary"
Default
nix
"binary"
Example
nix
"shell"
Declaration

Program configuration

wrappers.<name>.programs

Wrap specific binaries with specific options. You may use it to skip wrapping some program.

Type
plaintext
attribute set of (submodule)
Default
nix
{ }
Example
nix
{
  supervim = {
    target = "neovim";
  };

  git = {
    env.GIT_CONFIG.value = ./gitconfig;
  };

  # Don't wrap scalar
  scalar = {};
}
Declaration

wrappers.<name>.programs.<name>.appendFlags

Flags passed after any arguments to the wrapped program. Usually you want to use prependFlags instead.

Type
plaintext
list of (string or anything convertible to it)
Default
nix
[ ]
Example
nix
["--config-file" ./config.toml]
Declaration

wrappers.<name>.programs.<name>.env

Structured configuration for environment variables.

Type
plaintext
attribute set of (submodule)
Default
nix
{ }
Example
nix
{
  GIT_CONFIG.value = ./gitconfig;
}
Declaration

wrappers.<name>.programs.<name>.env.<name>.force

Whether the value should be always set to the specified value. If set to true, the program will not inherit the value of the variable if it's already present in the environment.

Setting it to false when unsetting a variable (value = null) will make the option have no effect.

Type
plaintext
boolean
Default
plaintext
true if `value` is null, otherwise false
Example
nix
true
Declaration

wrappers.<name>.programs.<name>.env.<name>.name

Name of the variable.

Type
plaintext
string
Default
nix
"‹name›"
Example
nix
"GIT_CONFIG"
Declaration

wrappers.<name>.programs.<name>.env.<name>.value

Value of the variable to be set. Set to null to unset the variable.

Note that any environment variable will be escaped. For example, value = "$HOME" will be converted to the literal $HOME, with its dollar sign.

Type
plaintext
null or (string or anything convertible to it)
Example
nix
./gitconfig
Declaration

wrappers.<name>.programs.<name>.extraWrapperFlags

Raw flags passed to makeWrapper. You may want to use wrapFlags instead.

Type
plaintext
strings concatenated with " "
Default
nix
""
Example
nix
"--argv0 foo --set BAR value"
Declaration

wrappers.<name>.programs.<name>.flags

(Deprecated) Flags passed before any arguments to the wrapped program. Use prependFlags instead

Type
plaintext
list of (string or anything convertible to it)
Default
nix
[ ]
Declaration

wrappers.<name>.programs.<name>.name

Name of the program

Type
plaintext
string
Default
nix
"‹name›"
Declaration

wrappers.<name>.programs.<name>.pathAdd

Packages to append to PATH.

Type
plaintext
list of package
Default
nix
[ ]
Example
nix
[ pkgs.starship ]
Declaration

wrappers.<name>.programs.<name>.prependFlags

Flags passed before any arguments to the wrapped program.

Type
plaintext
list of (string or anything convertible to it)
Default
nix
[ ]
Example
nix
["--config-file" ./config.toml]
Declaration

wrappers.<name>.programs.<name>.target

Target of the program

Type
plaintext
null or string
Default
nix
null
Declaration

wrappers.<name>.programs.<name>.wrapFlags

Structured flags passed to makeWrapper.

Type
plaintext
list of (string or anything convertible to it)
Default
nix
[ ]
Example
nix
[
  "--argv0"
  "myprog"
]
Declaration

wrappers.<name>.programs.<name>.wrapperType

Whether to use a binary or a shell wrapper.

Type
plaintext
one of "shell", "binary"
Default
nix
"binary"
Example
nix
"shell"
Declaration

Outputs

build.packages

(Read-only) Attribute set of name=pkg, for every wrapper.

Type
plaintext
attribute set of package
Declaration

build.toplevel

(Read-only) Package that merges all the wrappers into a single derivation. You may want to use build.packages instead.

Type
plaintext
package
Declaration