Using the Nix language module
The Nix language module allows you to write Nix expressions to configure devices directly in Thymis. This is particularly useful when you are testing options or want to quickly prototype a configuration without creating a full Thymis module.
Start by adding a “Custom Module” to your device or tag. You can do this by clicking the Plus button in the Modules section of the device or tag configuration page.
Once added, select the Custom Module from the list of loaded modules. In the configuration section, you will find a text area where you can write your Nix expressions.
The configuration you write here will be placed in the body of a NixOS module, which is then applied to the device when it is deployed.
The exact template used is:
{ pkgs, lib, inputs, config, ... }:
{
# Your NixOS module configuration goes here
}
For example, to install vim on the device:
environment.systemPackages = with pkgs; [ vim ];
Like this:
For guidance on how to write NixOS modules, see Nix 101 - Configuring Devices with Nix.
You can consult resources online, such as the NixOS wiki or the NixOS manual to learn more about how to write NixOS modules and what options are available.
We recommend using the Nixpkgs search to find available packages and the NixOS options search to find available configuration options.
Tip: Want to run Python code on your devices? See Using the Python language module (coming soon) for a workaround using pkgs.writers.writePython3
.