Core Principles
The architecture is built on three foundational principles:- Reproducibility: Every build is deterministic and reproducible through Nix
- Modularity: Plugins and packages are independently developed and composed
- Declarative Configuration: Infrastructure and dependencies declared as code
Technology Stack
Nix Flakes
Manages dependencies, builds, and deployment with reproducible guarantees
Gradle 9
Builds Kotlin plugins with dependency management and multi-project support
Kotlin 2.3
Primary language for plugin development on the JVM
Purpur 1.21.8
High-performance Minecraft server implementation
System Architecture
The platform follows a layered architecture:Key Components
Flake Architecture
The rootflake.nix orchestrates the entire build system:
nix/oyasai-scope.nix- Custom package scope and build logicnix/devshells.nix- Development environment configurationnix/docker.nix- Container image generationnix/treefmt.nix- Code formatting rules
Oyasai Scope
The Oyasai scope (nix/oyasai-scope.nix) defines a custom package set with:
- Java toolchain: Temurin JDK/JRE 25
- Build tools: Gradle 9, gradle2nix
- Plugin builders: Batch compilation of all plugins
- Server packages: Multiple server configurations (main, minimal, marzipan)
- Docker support: Layered image builder
Plugin Build System
Plugins are built in batch mode for efficiency:Build Pipeline
The build process follows this flow:- Dependency Resolution: gradle2nix locks all Maven dependencies
- Plugin Compilation: All plugins built together via Gradle
- Server Assembly: Purpur server + plugins wrapped with runtime config
- Docker Packaging: Layered images built for deployment
Package Outputs
The flake exposes these packages:oyasai-minecraft-main
oyasai-minecraft-main
Production server with full plugin set including EssentialsX, LuckPerms, Vault, and custom plugins
oyasai-minecraft-minimal
oyasai-minecraft-minimal
Minimal server configuration for testing
oyasai-minecraft-marzipan
oyasai-minecraft-marzipan
Specialized server configuration for specific use cases
oyasai-plugin-registry
oyasai-plugin-registry
Centralized registry of third-party plugins with version management
oyasai-push-nix-images
oyasai-push-nix-images
Utility for pushing Docker images to registries
Development Environment
The development shell provides:Docker Integration
Docker images are built with layering for efficient caching:- All server packages
- MariaDB database
- Backup utilities
Related Documentation
Monorepo Structure
Explore the project layout and organization
Nix Flakes
Deep dive into the Nix flake system
Plugin System
Learn how plugins are developed and built