96 lines
2.3 KiB
Markdown
96 lines
2.3 KiB
Markdown
# ColdIron
|
|
|
|
ColdIron is a desktop GUI application built with [Rust](https://www.rust-lang.org/) and the [Iced](https://iced.rs/) GUI framework.
|
|
|
|
## Quick Start
|
|
|
|
### Nix Flakes (Recommended)
|
|
|
|
Enter the reproducible development shell with all Rust tools and Linux GUI runtime dependencies (`wayland`, `libxkbcommon`, `libGL`, `vulkan-loader`, `xorg` libraries):
|
|
|
|
```sh
|
|
nix develop
|
|
# or with direnv:
|
|
direnv allow
|
|
```
|
|
|
|
Then run the application:
|
|
|
|
```sh
|
|
cargo run
|
|
```
|
|
|
|
### Running Tests & Quality Checks
|
|
|
|
```sh
|
|
# Run unit and integration tests
|
|
cargo test
|
|
|
|
# Run linter
|
|
cargo clippy
|
|
|
|
# Format code
|
|
cargo fmt
|
|
```
|
|
|
|
## Nix Packaging & nixpkgs Compatibility
|
|
|
|
`coldIron` provides an idiomatic, `nixpkgs`-compatible package expression in `package.nix` and `flake.nix`.
|
|
|
|
### Build with Nix
|
|
|
|
```sh
|
|
nix build
|
|
./result/bin/ColdIron
|
|
```
|
|
|
|
Or run directly via flake:
|
|
|
|
```sh
|
|
nix run
|
|
```
|
|
|
|
### Contributing to nixpkgs
|
|
|
|
The `package.nix` derivation is designed for direct integration into `nixpkgs` (e.g. under `pkgs/by-name/co/coldiron/package.nix`). It uses `rustPlatform.buildRustPackage`, `makeBinaryWrapper`, and wraps the executable with runtime graphics and windowing libraries (`LD_LIBRARY_PATH`).
|
|
|
|
## Flatpak Packaging
|
|
|
|
ColdIron includes Flatpak packaging configuration for containerized desktop distribution.
|
|
|
|
### Build Flatpak Package
|
|
|
|
1. Enter the dev shell (`nix develop`) which includes `flatpak` and `flatpak-builder`.
|
|
2. Run:
|
|
|
|
```bash
|
|
make flatpak-build
|
|
```
|
|
|
|
This uses the manifest in `flatpak/app.flatpak.json` (Application ID: `io.github.gooba42.coldiron`) to build the application into `build-flatpak/`.
|
|
|
|
## Legacy Nix Shell
|
|
|
|
If you are not using Nix flakes, you can enter the development environment using:
|
|
|
|
```sh
|
|
nix-shell
|
|
```
|
|
|
|
## Project Structure
|
|
|
|
```
|
|
ColdIron/
|
|
├── Cargo.toml # Rust package manifest
|
|
├── Cargo.lock # Exact dependency lockfile
|
|
├── flake.nix # Nix flake for devShell, packages, and apps
|
|
├── package.nix # Nixpkgs-compatible buildRustPackage derivation
|
|
├── default.nix # nix-build entrypoint calling package.nix
|
|
├── shell.nix # Legacy nix-shell configuration
|
|
├── flatpak/
|
|
│ └── app.flatpak.json # Flatpak application manifest
|
|
├── src/
|
|
│ └── main.rs # Iced application entrypoint and UI
|
|
└── tests/ # Integration tests
|
|
```
|