Skip to content

Binfmt

boot.binfmt.emulatedSystems

List of systems to emulate. Will also configure Nix to support your new systems. Warning: the builder can execute all emulated systems within the same build, which introduces impurities in the case of cross compilation.

Type: list of (one of "aarch64-linux", "aarch64_be-linux", "alpha-linux", "armv6l-linux", "armv7l-linux", "i386-linux", "i486-linux", "i586-linux", "i686-linux", "i686-windows", "loongarch64-linux", "mips-linux", "mips64-linux", "mips64-linuxabin32", "mips64el-linux", "mips64el-linuxabin32", "mipsel-linux", "powerpc-linux", "powerpc64-linux", "powerpc64le-linux", "riscv32-linux", "riscv64-linux", "s390x-linux", "sparc-linux", "sparc64-linux", "wasm32-wasi", "wasm64-wasi", "x86_64-linux", "x86_64-windows")

Default

[ ]

Example

["wasm32-wasi""x86_64-windows""aarch64-linux"]

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/system/boot/binfmt.nix

boot.binfmt.registrations

Extra binary formats to register with the kernel. See https://www.kernel.org/doc/html/latest/admin-guide/binfmt-misc.html for more details.

Type: attribute set of (submodule)

Default

{ }

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/system/boot/binfmt.nix

boot.binfmt.registrations.<name>.fixBinary

Whether to open the interpreter file as soon as the registration is loaded, rather than waiting for a relevant file to be invoked.

See the description of the 'F' flag in the kernel docs for more details.

Type: boolean

Default

false

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/system/boot/binfmt.nix

boot.binfmt.registrations.<name>.interpreter

The interpreter to invoke to run the program.

Note that the actual registration will point to /run/binfmt/${name}, so the kernel interpreter length limit doesn't apply.

Type: path

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/system/boot/binfmt.nix

boot.binfmt.registrations.<name>.magicOrExtension

The magic number or extension to match on. Type: string

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/system/boot/binfmt.nix

boot.binfmt.registrations.<name>.mask

A mask to be ANDed with the byte sequence of the file before matching Type: null or string

Default

null

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/system/boot/binfmt.nix

boot.binfmt.registrations.<name>.matchCredentials

Whether to launch with the credentials and security token of the binary, not the interpreter (e.g. setuid bit).

See the description of the 'C' flag in the kernel docs for more details.

Implies/requires openBinary = true.

Type: boolean

Default

false

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/system/boot/binfmt.nix

boot.binfmt.registrations.<name>.offset

The byte offset of the magic number used for recognition. Type: null or signed integer

Default

null

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/system/boot/binfmt.nix

boot.binfmt.registrations.<name>.openBinary

Whether to pass the binary to the interpreter as an open file descriptor, instead of a path.

Type: boolean

Default

false

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/system/boot/binfmt.nix

boot.binfmt.registrations.<name>.preserveArgvZero

Whether to pass the original argv[0] to the interpreter.

See the description of the 'P' flag in the kernel docs for more details;

Type: boolean

Default

false

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/system/boot/binfmt.nix

boot.binfmt.registrations.<name>.recognitionType

Whether to recognize executables by magic number or extension. Type: one of "magic", "extension"

Default

"magic"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/system/boot/binfmt.nix

boot.binfmt.registrations.<name>.wrapInterpreterInShell

Whether to wrap the interpreter in a shell script.

This allows a shell command to be set as the interpreter.

Type: boolean

Default

true

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/system/boot/binfmt.nix