Skip to content

Lxd

virtualisation.lxd.agent.enable

Whether to enable LXD agent. Type: boolean

Default

false

Example

true

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/virtualisation/lxd-agent.nix

virtualisation.lxd.enable

This option enables lxd, a daemon that manages containers. Users in the "lxd" group can interact with the daemon (e.g. to start or stop containers) using the {command}lxc command line tool, among others.

Most of the time, you'll also want to start lxcfs, so that containers can "see" the limits:

virtualisation.lxc.lxcfs.enable = true;

Type: boolean

Default

false

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/virtualisation/lxd.nix

virtualisation.lxd.lxcPackage

The lxc package to use. Type: package

Default

config.virtualisation.lxc.package

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/virtualisation/lxd.nix

virtualisation.lxd.package

The lxd-lts package to use. Type: package

Default

pkgs.lxd-lts

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/virtualisation/lxd.nix

virtualisation.lxd.preseed

Configuration for LXD preseed, see https://documentation.ubuntu.com/lxd/en/latest/howto/initialize/#initialize-preseed for supported values.

Changes to this will be re-applied to LXD which will overwrite existing entities or create missing ones, but entities will not be removed by preseed.

Type: null or (YAML value)

Default

null

Example

{networks = [{name = "lxdbr0";type = "bridge";config = {"ipv4.address" = "10.0.100.1/24";"ipv4.nat" = "true";};}];profiles = [{name = "default";devices = {eth0 = {name = "eth0";network = "lxdbr0";type = "nic";};root = {path = "/";pool = "default";size = "35GiB";type = "disk";};};}];storage_pools = [{name = "default";driver = "dir";config = {source = "/var/lib/lxd/storage-pools/default";};}];}

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/virtualisation/lxd.nix

virtualisation.lxd.recommendedSysctlSettings

Enables various settings to avoid common pitfalls when running containers requiring many file operations. Fixes errors like "Too many open files" or "neighbour: ndisc_cache: neighbor table overflow!". See https://lxd.readthedocs.io/en/latest/production-setup/ for details.

Type: boolean

Default

false

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/virtualisation/lxd.nix

virtualisation.lxd.startTimeout

Time to wait (in seconds) for LXD to become ready to process requests. If LXD does not reply within the configured time, lxd.service will be considered failed and systemd will attempt to restart it.

Type: signed integer

Default

600

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/virtualisation/lxd.nix

virtualisation.lxd.ui.enable

Whether to enable (experimental) LXD UI. Type: boolean

Default

false

Example

true

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/virtualisation/lxd.nix

virtualisation.lxd.ui.package

The lxd-ui package to use. Type: package

Default

pkgs.lxd-ui

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/virtualisation/lxd.nix

virtualisation.lxd.zfsSupport

Enables lxd to use zfs as a storage for containers.

This option is enabled by default if a zfs pool is configured with nixos.

Type: boolean

Default

config.boot.zfs.enabled

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/virtualisation/lxd.nix