Skip to content

Modules and packages ​

The [nixos] table adds software to the VM. modules selects modules from the LimaNix catalog or your own, and packages installs commands from nixpkgs, the Nix package collection.

toml
[nixos]
modules = ["lmx:docker"]
packages = ["kubectl", "k9s", "unstable:kubernetes-helm"]

Apply a change with limanix update --config limanix.toml; see Changing a VM.

Package or module ​

A package installs a tool that works on its own. Choose a module when a tool needs more than its package:

A moduleFor example
Starts a service, or creates a user or a grouplmx:docker runs Docker Engine as a service
Writes configuration you would otherwise write yourselflmx:posting in the VM's theme
Keeps several versions side by sidelmx:postgres-16 with lmx:postgres-18
Changes a tool's own behaviorlmx:claude turns off its self-updates

The catalog describes each module.

Select modules ​

SelectorSelectsExample
lmx:NAMEA catalog module, at its default line when it has lineslmx:docker
lmx:NAME-VERSIONA specific line of a catalog modulelmx:postgres-16
third-party:NAMEYour own module, imported with limanix modules addthird-party:my-tools

The catalog comes with your limanix client. List what it has on the Mac:

sh
limanix modules list

Each row shows a selector, its kind and a description. modules takes the selectors of kind modules. The shell and toolchains tables choose the other kinds, and a selector of theirs in modules fails with a message that names the table:

text
nixos.modules[0]: lmx:go is a toolchain; choose its version in [toolchains], such as go = "1.27"

An explicit line replaces the module's default line. Several lines of one module work where the module supports them, as PostgreSQL does:

toml
[nixos]
modules = ["lmx:postgres-16", "lmx:postgres-18"]

Modules that allow one line, such as Docker, stop the build when you select two. modules = [] selects no optional modules; the shell, the toolchains and the LimaNix base system remain.

Use your own module ​

Import a folder that has a default.nix at its root, under a name of your choice:

sh
limanix modules add my-tools ./my-tools

Then select it with third-party::

toml
[nixos]
modules = ["lmx:docker", "third-party:my-tools"]

The import is a copy. After you change the module, remove it and add it again, then update each VM that uses it. Your own modules shows how to write and replace one.

Install packages ​

List packages by their attribute path in nixpkgs, such as kubectl or python3Packages.ipython. Find names on search.nixos.org, in the channel of the VM's NixOS release; nixos-version in the VM shows it.

RuleWhat it means
unstable:unstable:NAME takes the package from the catalog's nixos-unstable revision instead, for tools whose release in the VM's NixOS is too old, such as unstable:kubernetes-helm or unstable:codex. Search them in the unstable channel. The revision moves with each catalog release.
Commands, not librariesList packages that bring their own commands. A library such as python3Packages.requests installs but cannot be imported: use the project's environment, such as a venv, or a module.
LicensesNaming a package accepts its license, even an unfree one. The acceptance uses the last part of the name. When the package's own name differs, the build error names it, and your own module can allow it with nixpkgs.config.allowUnfreePackages.
ConflictsWhen a listed package provides a command that another package of the VM also provides, the build fails and names both. The same package is no conflict: jq beside the CLI tools, which install it, is fine.
VersionsOne version of a tool per list. Choose language versions in [toolchains], and several versions of a service with module lines.

With the terminal preset, listing gh or unstable:gh replaces the preset's GitHub CLI.

A name that is not a package, or a conflict, fails limanix create or limanix update before the VM restarts. The output gives the reason, and the VM keeps its current system. Fix the file and run the update again.

To try a tool in one VM without editing the file, see Packages on the fly.

Free and open source under the Apache License 2.0.