Micro

Micro

Nix

This guide shows you how to deploy a self-hosted instance of Micro on NixOS.

Prerequisites

You'll need a server with:

Installation

Add Micro to your flake's inputs and import its module:

{
  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
    micro.url = "git+https://codeberg.org/nord-studio/micro";
  };

  outputs = { nixpkgs, micro, ... }: {
    nixosConfigurations.server = nixpkgs.lib.nixosSystem {
      system = "x86_64-linux";
      modules = [
        micro.nixosModules.default
        ./configuration.nix
      ];
    };
  };
}

Create a config.toml next to your configuration.nix:

origin = "http://localhost:3000"

[auth.passkeys]
enabled = true

[assets.local]
enabled = true

Set up the required options for your instance. See Configuration for what each one does.

config.toml is copied into the Nix store. Keep secrets out of it and put them in envFile instead.

Enable Micro in your configuration.nix:

{
  services.micro = {
    enable = true;
    configPath = ./config.toml;
  };
}

Check out the options to configure the module to your liking, like using your own database instead of the bundled PostgreSQL.

Rebuild your system:

sudo nixos-rebuild switch --flake .#server

Micro runs its database migrations on startup.

Go to your server's address on port 3000 to create your account and first workspace.

Options

All options live under services.micro.

Prop

Type

Any of the other environment variables can go in environment or envFile.

Running without NixOS

You can also run Micro straight from the flake on any machine with Nix:

DATABASE_URL=postgresql://... MICRO_CONFIG_PATH=./config.toml MICRO_ASSETS_PATH=./assets nix run git+https://codeberg.org/nord-studio/micro

On this page