Nix Flake Deployment
Relevant source files
The following files were used as context for generating this wiki page:
Nix Flake deployment serves as a primary, recommended method for distributing and running the Kaleidux wallpaper daemon. By leveraging Nix flakes, the project ensures reproducible builds and simplified dependency management for complex requirements such as GStreamer, WGPU, and Wayland/X11 headers.
This deployment method allows users to run Kaleidux directly from the GitHub repository or integrate it into a flake.nix configuration for system-wide or user-specific installation on Nix-based systems.
Sources: README.md:46-60, CONTRIBUTING.md:214-220
Deployment Overview
The Nix Flake system provides a declarative way to manage the software's build environment and runtime dependencies. This is particularly relevant for Kaleidux because it relies on specific versions of GStreamer (1.20+) and Vulkan/GPU drivers for hardware acceleration.
Core Components
The deployment infrastructure involves several key files and commands:
- flake.nix: The entry point for the Nix flake, defining inputs and outputs.
- Cargo.toml: Used by Nix builders (such as
naersk) to resolve Rust dependencies. - nix run: Command to execute the daemon immediately without manual installation.
The diagram above shows the high-level flow from the remote repository to the local execution environment using Nix commands.
Sources: README.md:46-51, CONTRIBUTING.md:214-220, Cargo.toml:1-10
Usage and Integration
Direct Execution
Users can run the daemon instantly using the Nix CLI. This method handles all system dependencies automatically, including GStreamer plugins (gst-plugins-good, gst-plugins-bad, etc.) and Vulkan drivers required by WGPU.
# Execute directly from the main branch
nix run github:Mjoyufull/Kaleidux
Sources: README.md:50, CONTRIBUTING.md:26-30
Flake Configuration
For permanent installation or development, Kaleidux can be added as an input to another flake. This is the standard way to integrate the daemon into a NixOS configuration or a Home Manager setup.
| Parameter | Value | Description |
|---|---|---|
| Input URL | github:Mjoyufull/Kaleidux | Source of the flake |
| Default Package | kaleidux-daemon | The core background service |
| Controller | kldctl | CLI utility for IPC communication |
Sources: README.md:54-60, CONTRIBUTING.md:120-130
Build Process and Environment
The flake environment mirrors the manual build requirements. When the flake is evaluated, it ensures the following environment is present:
- Rust Stable: The project requires Rust 1.89+ stable.
- System Headers: Libraries for Wayland-scanner, libX11-devel, and GStreamer.
- WGPU Support: Configuration for Vulkan/GPU drivers.
This sequence illustrates how Nix orchestrates the build process, ensuring system libraries are available before Cargo begins compilation.
Sources: README.md:62-75, CONTRIBUTING.md:20-35, kaleidux-daemon/src/main.rs:250-265
Release and Versioning in Nix
In the Nix Flake deployment model, versioning is tied to the workspace package version and codenames. The current version sequence follows the kneecap codename for the 0.x.x series.
Version Management
Maintainers update version references in flake.nix during the release process. This occurs on a dedicated release branch before being merged into the main branch.
- Codename:
kneecap(current for 0.x.x series) - Primary Branch:
main(contains tagged, production-ready flake updates) - Integration Branch:
dev(where feature flakes are tested)
Sources: PROJECT_STANDARDS.md:31-45, CONTRIBUTING.md:214-225, Cargo.toml:10-12
Conclusion
Nix Flake deployment is the most robust installation method for Kaleidux, abstracting the complexity of Rust toolchains and Linux multimedia libraries. It ensures that the "Kaleidux type shi" (aesthetic excellence and performance) is maintained across different Linux distributions by providing a consistent, reproducible environment.
Sources: CONTRIBUTING.md:185-195, PROJECT_STANDARDS.md:10-20