External repositories/Inputs
External repositories (also called inputs) are how Thymis brings additional Nix expressions, Thymis modules, and other resources into a project. They are implemented using Nix Flakes – the same declarative style that powers NixOS and Nixpkgs – and are managed from the Thymis UI.
In Thymis, an input is a Git repository that satisfies the following conditions:
- It contains a valid
flake.nix
file at its root. - The repository is accessible via a Git URL (HTTPS or SSH).
Inputs can provide Thymis modules if they satisfy the following conditions:
- They contain a
README.md
file at their root that contains the stringcontains thymis modules
. - They contain
python_modules_unique_path/python_module_name.py
files that define Thymis modules by subclassingthymis_controller.modules.modules.Module
.
See your first Thymis module for more information on how to create a Thymis module and structure the files in your repository.
See external repositories for more information on how to set up and use external repositories in your Thymis project.
The repositories added to the project are included as Nix Flake inputs, which means that you can update them using the Update button in the Thymis UI. This will fetch the latest changes from the repository and update the inputs in your project.
Implementation Details
Inputs are implemented as Nix Flakes, which means that they can be used to provide additional Nix expressions, Thymis modules, and other resources to your Thymis project.
Check out the Nix Wiki on Flakes for more information on how to create a Nix flake file and use it in your project.
If you have access to your project repository, as described in Accessing the Thymis project git repository, you can inspect the generated flake.nix
file in your project repository to see how the inputs are defined.
The syntax of the Git URL for the input is described in the Nix Flakes documentation. Examples of valid Git URLs are:
git+https://example.org/my/repo
git+https://example.org/my/repo?dir=subdir
git+ssh://example.org/my/repo?ref=v1.2.3
git+ssh://example.org/my/repo?ref=branch-name&rev=abcd1234