Documentation

menu
ModulesNodejsHaskellRustPostgreSQLUserHostingIntroductionBranch HostingPull-request DeploymentsSecretsPersistenceDebuggingMultiple ServersCustom DomainsExample: Typescript & GoExample: JitsiExample: RSS BridgeExample: Tiny Tiny RSSExample: SearxInstalling Nixyaml configNix FlakesWhat Garnix CI doesIncremental BuildsUsing Private InputsCachingGitHub Actions IntegrationBadgesGarn

How modules workshare

You don't need to read this section to use modules; it is instead meant for the curious, or for those who would like to write their own modules.

At a high level, garnix modules are bits of functionality for building projects with Nix, with parameters that you can set or tweak to suit your project. Those parameters are described in a schema (a lot like NixOS modules, if you're familiar with that).

That schema is what allows us to generate a form so you can configure your project in our web UI. After you configure your project in the web UI, we generate a flake.nix file which corresponds to your selection. You can create a pull request to your repository with this file. But you can skip the UI altogether if you prefer, and just write the file directly yourself, once you are more familiar with how things work.

The flake.nix file is a standardized format for Nix flakes.

Even more (for Nix users)share

If you're Nix-savvy, a small example module here can help make sense of things. As you can see there, garnix modules are modules over flake configurations: you can set various attributes of the resulting flake in your config.

In general for now we expect modules to set the nixosConfiguration called default, as that's the configuration we deploy. Multiple modules can write to that attribute, however.

If you are thinking of writing a module, get in touch! The easiest option is to join our Discord.