Ghaf Packages
December 2, 2025 ยท View on GitHub
This repository contains packages used in the Ghaf framework - a hardened virtualization platform for edge computing.
๐ Quick Start
# Clone the repository
git clone https://github.com/tiiuae/ghafpkgs.git
cd ghafpkgs
# Enter development environment
nix develop
# Build a package
nix build .#ghaf-audio-control
# Update all package dependencies
update-deps
# Update with source upgrades (potentially breaking)
update-deps --upgrade
๐ฆ Package Categories
๐จ Art & Themes (packages/art/)
Visual assets and themes for Ghaf systems.
ghaf-artwork- Ghaf branding and artwork assetsghaf-theme- GTK4 theme for Ghaf desktop environmentghaf-wallpapers- Default wallpapers collection
๐ Python (packages/python/)
Python applications and utilities, all modernized with pyproject.toml + uv.
ghaf-usb-applet- USB panel applet for COSMIC (GTK4) with system tray integrationgps-websock- GPS endpoint exposed over WebSocket for real-time location dataldap-query- LDAP/Active Directory query tool with GSSAPI authvinotify- VM file system notification service using inotify
๐ฆ Rust (packages/rust/)
High-performance system utilities written in Rust.
ghaf-kill-switch-app- GUI Application for kill switchghaf-mem-manager- Memory management utilitiesghaf-nw-packet-forwarder- Network packet forwarding service
๐ต Go (packages/go/)
Go-based system services and utilities.
swtmp-proxy-shim- Software TPM proxy shim
โก C++ (packages/cpp/)
C++ applications with desktop integration.
ghaf-audio-control- Audio control application with Qt6 GUIdbus-proxy- Proxy connecting DBuses between two separate VMsvsockproxy- VM Sockets proxy for guest-to-guest communication
๐ ๏ธ Development Tools (packages/update-deps/)
Repository maintenance and development utilities.
update-deps- Automatic dependency updater for all package types
๐ง Development
Development Environment
# Enter development shell with all tools
nix develop
# Available tools in devshell:
# - update-deps (dependency management)
# - reuse (license compliance)
# - cargo (Rust development)
# - go (Go development)
# - nix-fast-build (efficient Nix builds)
# - All package-specific build tools
Building Packages
# Build specific packages
nix build .#ghaf-audio-control
nix build .#ghaf-mem-manager
nix build .#ghaf-kill-switch-app
nix build .#ghaf-usb-applet
nix build .#gps-websock
nix build .#vsockproxy
# Build all packages
nix flake check
# Fast parallel builds
nix-fast-build
Dependency Management
The repository includes an automated dependency updater that supports all package types:
# Safe updates (lock files only)
update-deps
# Full upgrades (potentially breaking)
update-deps --upgrade
# Show help
update-deps --help
Supported Package Managers:
- Rust:
cargo update/cargo upgrade - Go:
go get -u=patch/go get -u - Python:
uv sync/uv add --upgrade - Node.js:
npm update/npm upgrade
Package Development
Adding New Packages
- Choose appropriate category (
art/,python/,rust/,go/,cpp/) - Create package directory with
default.nixorpackage.nix - Add to category's
default.nixexport list - Use modern packaging standards:
- Python:
pyproject.tomlwithuvandhatchling - Rust:
Cargo.tomlwith workspace support - Go:
go.modwith proper module structure
- Python:
Python Package Standards
All Python packages use modern tooling:
# pyproject.toml example
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "package-name"
version = "1.0.0"
dependencies = ["dep1>=1.0", "dep2>=2.0"]
[project.scripts]
command-name = "module.main:main"
Package.nix Structure
# For Python packages
{
buildPythonApplication,
hatchling,
uv,
# dependencies...
}:
buildPythonApplication {
pname = "package-name";
version = "1.0.0";
build-system = [ hatchling uv ];
propagatedBuildInputs = [ /* runtime deps */ ];
src = ./package-source;
pyproject = true;
doCheck = false;
meta = {
description = "Package description";
license = lib.licenses.asl20;
platforms = platforms.linux;
};
}
๐๏ธ Architecture
Repository Structure
ghafpkgs/
โโโ packages/
โ โโโ art/ # Visual assets and themes
โ โโโ cpp/ # C++ applications
โ โโโ go/ # Go services
โ โโโ python/ # Python applications
โ โโโ rust/ # Rust utilities
โ โโโ update-deps/ # Development tools
โ โโโ flake-module.nix
โโโ nix/
โ โโโ devshell.nix # Development environment
โโโ flake.nix # Main flake configuration
โโโ README.md # This file
Build System
- Nix Flakes for reproducible builds and dependency management
- Category-based organization with dedicated
default.nixin each category - Modern package managers: uv (Python), cargo (Rust), go modules (Go)
- Automated dependency management with
update-depstool
Integration Points
Packages are designed to integrate with:
- Ghaf Framework - Main virtualization platform
- NixOS configurations - System-level integration
- Development workflows - CI/CD and testing
- Security frameworks - Hardened virtualization context
๐ Maintenance
Regular Maintenance
# Weekly dependency updates (safe)
update-deps
nix flake check
git commit -am "chore: update dependency lock files"
# License compliance check
reuse lint
# Code formatting
nix fmt
Major Updates
# Quarterly dependency upgrades (potentially breaking)
update-deps --upgrade
nix flake check
# Review and fix any breaking changes
git commit -am "feat: upgrade dependencies to latest versions"
Release Process
- Update dependencies:
update-deps --upgrade - Run full tests:
nix flake check - Update documentation if needed
- Tag release: Follow semantic versioning
- Update Ghaf framework integration
๐ค Contributing
Development Workflow
- Fork the repository
- Create feature branch:
git checkout -b feature/new-package - Enter dev environment:
nix develop - Make changes following the patterns in existing packages
- Test thoroughly:
nix build .#your-package - Update dependencies:
update-deps - Run checks:
nix flake check && reuse lint - Submit pull request
Code Standards
- License compliance: All files must have SPDX headers (
reuse lint) - Modern packaging: Use latest standards (pyproject.toml, Cargo.toml, go.mod)
- Documentation: Include README.md for complex packages
- Testing: Ensure packages build successfully with
nix flake check
๐ License
Licensed under Apache-2.0. See LICENSES/Apache-2.0.txt for details.
This project follows the REUSE specification for license compliance.
๐ Related Projects
- Ghaf Framework - Main virtualization platform
- Ghaf Documentation - Project documentation and guides
- TII Open Source - Technology Innovation Institute projects
๐ Support
- Documentation: ghaf.dev
- Issues: GitHub Issues
- Community: Ghaf Community
Ghaf Packages - Hardened virtualization platform components ๐ก๏ธ Security-focused โข ๐ Edge-optimized โข ๐ง Developer-friendly