wsl.enable

Whether to enable support for running NixOS as a WSL distribution.

Type: boolean

Default: false

Example: true

Declared by:

wsl.defaultUser

The name of the default user

Type: string

Default: "nixos"

Declared by:

wsl.docker-desktop.enable

Whether to enable Docker Desktop integration.

Type: boolean

Default: false

Example: true

Declared by:

wsl.extraBin

Additional files to be added to /bin

Type: list of (submodule)

Declared by:

wsl.extraBin.*.copy

Whether or not the file should be copied instead of symlinked

Type: boolean

Default: false

Declared by:

wsl.extraBin.*.name

The name the file should be created as in /bin

Type: string

Default: baseNameOf src

Declared by:

wsl.extraBin.*.src

Path of the file that should be added

Type: string

Declared by:

wsl.interop.includePath

Include Windows PATH in WSL PATH

Type: boolean

Default: true

Declared by:

wsl.interop.register

Explicitly register the binfmt_misc handler for Windows executables

Type: boolean

Default: false

Declared by:

wsl.nativeSystemd

Use native WSL systemd support

Type: boolean

Default: true

Declared by:

wsl.startMenuLaunchers

Whether to enable shortcuts for GUI applications in the windows start menu.

Type: boolean

Default: false

Example: true

Declared by:

wsl.tarball.configPath

Path to system configuration which is copied into the tarball

Type: null or path

Default: null

Declared by:

wsl.usbip.enable

Whether to enable USB/IP integration.

Type: boolean

Default: false

Example: true

Declared by:

wsl.usbip.autoAttach

Auto attach devices with provided Bus IDs.

Type: list of string

Default: [ ]

Example:

[
  "4-1"
]

Declared by:

wsl.usbip.snippetIpAddress

This snippet is used to obtain the address of the Windows host where Usbipd is running. It can also be a plain IP address in case networkingMode=mirrored or wsl-vpnkit is used.

Type: string

Default: "$(ip route list | sed -nE 's/(default)? via (.*) dev eth0 .*/\\2/p' | head -n1)"

Example: "127.0.0.1"

Declared by:

wsl.useWindowsDriver

Whether to enable OpenGL driver from the Windows host.

Type: boolean

Default: false

Example: true

Declared by:

wsl.wrapBinSh

Wrap /bin/sh with a script that sets the correct environment variables (like the user shells). Only takes effect when using native systemd

Type: boolean

Default: true

Declared by:

wsl.wslConf

Configuration values for /etc/wsl.conf. See https://learn.microsoft.com/en-us/windows/wsl/wsl-config#configuration-settings-for-wslconf for all options supported by WSL.

Type: attribute set of section of an INI file (attrs of INI atom (null, bool, int, float or string))

Default: { }

Declared by:

wsl.wslConf.automount.enabled

Automatically mount windows drives under /mnt

Type: boolean

Default: true

Declared by:

wsl.wslConf.automount.ldconfig

Wether to modify /etc/ld.so.conf.d/ld.wsl.conf to load OpenGL drivers provided by the Windows host in /usr/lib/wsl/lib with /sbin/ldconfig. This way of providing OpenGL drivers does not work with NixOS and wsl.useWindowsDriver should be used instead.

Type: boolean

Default: false

Declared by:

wsl.wslConf.automount.mountFsTab

Mount entries from /etc/fstab through WSL. You should probably leave this on false, because systemd will mount those for you.

Type: boolean

Default: false

Declared by:

wsl.wslConf.automount.options

Comma-separated list of mount options that should be used for mounting windows drives.

Type: strings concatenated with “,”

Default: "metadata,uid=1000,gid=100"

Declared by:

wsl.wslConf.automount.root

The directory under which to mount windows drives.

Type: string matching the pattern ^/.*[^/]$

Default: "/mnt"

Declared by:

wsl.wslConf.boot.command

A command to run when the distro is started.

Type: string

Default: ""

Declared by:

wsl.wslConf.boot.systemd

Use systemd as init. There’s no need to enable this manually, use the wsl.nativeSystemd option instead

Type: boolean

Default: false

Declared by:

wsl.wslConf.interop.enabled

Support running Windows binaries from the linux shell.

Type: boolean

Default: true

Declared by:

wsl.wslConf.interop.appendWindowsPath

Include the Windows PATH in the PATH variable

Type: boolean

Default: true

Declared by:

wsl.wslConf.network.generateHosts

Generate /etc/hosts through WSL

Type: boolean

Default: true

Declared by:

wsl.wslConf.network.generateResolvConf

Generate /etc/resolv.conf through WSL

Type: boolean

Default: true

Declared by:

wsl.wslConf.network.hostname

The hostname of the WSL instance

Type: string

Default: "config.networking.hostName"

Declared by:

wsl.wslConf.user.default

Which user to start commands in this WSL distro as

Type: string

Default: "root"

Declared by: