From 30f8ca38630fc209c1bf03e11f6674604f03db98 Mon Sep 17 00:00:00 2001 From: Hermes Agent Date: Tue, 28 Apr 2026 17:19:45 +0000 Subject: [PATCH 01/13] Add AI model optimizer cron job draft and initial state files --- assets/ai-optimizer/CRON_EXECUTION_PROMPT.md | 203 +++++++++++++ assets/ai-optimizer/CRON_JOB_DRAFT.md | 283 +++++++++++++++++++ assets/ai-optimizer/results.csv | 1 + assets/ai-optimizer/state.json | 21 ++ 4 files changed, 508 insertions(+) create mode 100644 assets/ai-optimizer/CRON_EXECUTION_PROMPT.md create mode 100644 assets/ai-optimizer/CRON_JOB_DRAFT.md create mode 100644 assets/ai-optimizer/results.csv create mode 100644 assets/ai-optimizer/state.json diff --git a/assets/ai-optimizer/CRON_EXECUTION_PROMPT.md b/assets/ai-optimizer/CRON_EXECUTION_PROMPT.md new file mode 100644 index 0000000..20a6600 --- /dev/null +++ b/assets/ai-optimizer/CRON_EXECUTION_PROMPT.md @@ -0,0 +1,203 @@ +# AI Model Optimization Cron Job - EXECUTION PROMPT + +**When this cron runs, follow these instructions exactly:** + +--- + +## Your Role + +You are an AI model optimization agent. Your task is to find the best ollama/llama.cpp configuration for maximum context size and hardware utilization. + +**Hardware:** +- 2× AMD MI50 GPUs (32GB VRAM each, 64GB total) +- 128GB system RAM +- ROCm: HSA_OVERRIDE_GFX_VERSION=9.0.6, HIP_VISIBLE_DEVICES=0,1 + +--- + +## File Locations + +``` +STATE: /opt/data/infra/assets/ai-optimizer/state.json +RESULTS: /opt/data/infra/assets/ai-optimizer/results.csv +INFRA_REPO: /opt/data/infra +``` + +--- + +## Model Queues + +### GPU Track (Coding - prioritize speed + context on GPU) +1. `devstral-small-2:24b` +2. `qwen2.5-coder:32b` +3. `codellama:34b-instruct` + +### RAM Track (Knowledge - prioritize max context) +1. `qwen2.5:72b` +2. `nemotron-3-nano:30b` +3. `mixtral:8x7b-instruct` + +--- + +## Context Steps (in order) +``` +[32768, 65536, 98304, 131072, 163840, 200704, 262144, 327680] +``` + +--- + +## Each Run - Step by Step + +### 1. Read State +```bash +cd /opt/data/infra +cat assets/ai-optimizer/state.json +``` + +### 2. Determine Next Test +- Read `track` (gpu or ram) +- Read `current_model` from queue at `model_index` +- Read `current_config` for parameters to test +- Select next context step from `context_steps` based on `phase` + +### 3. Pull Model (if needed) +```bash +docker exec ollama ollama list | grep -q "" || docker exec ollama ollama pull +``` + +### 4. Create Test Modelfile +```bash +docker exec ollama bash -c "cat < /root/.ollama/test_${model}.modelfile +FROM ${model} +PARAMETER num_ctx ${current_config.num_ctx} +PARAMETER num_gpu ${current_config.num_gpu} +PARAMETER flash_attn ${current_config.flash_attn} +PARAMETER num_predict 4096 +PARAMETER num_keep 1024 +PARAMETER repeat_penalty 1.1 +EOF" + +docker exec ollama ollama create test-model -f /root/.ollama/test_${model}.modelfile +``` + +### 5. Run Benchmark +```bash +# Warm up +docker exec ollama ollama run test-model "Hello" > /dev/null + +# Coding prompt +START=$(date +%s%N) +docker exec ollama ollama run test-model "Write a Python async context manager that retries a function with exponential backoff, max 5 retries, and logs each attempt using structlog. Include type hints." +END=$(date +%s%N) + +# Calculate tokens/sec from output +``` + +### 6. Measure VRAM (if possible) +```bash +# Try host first +rocm-smi --showmeminfo vram 2>/dev/null || \ +# Try via docker +docker exec --privileged ollama rocm-smi --showmeminfo vram 2>/dev/null || \ +# Fallback +echo "VRAM measurement unavailable" +``` + +### 7. Record Results +- Parse tokens/sec from ollama output +- Record VRAM/RAM usage +- Determine if this is best config so far for this model +- Update `best_configs` if tokens/sec improved or context increased + +### 8. Update State +```python +# Logic: +if test_successful: + if context_step < max_reached: + phase = "context_scaling" + current_config.num_ctx = next_context_step + else: + # Move to next model + model_index += 1 + phase = "context_scaling" + current_config.num_ctx = context_steps[0] +else: + # OOM or error - record last good as best + best_configs[track][current_model] = last_good_config + model_index += 1 + phase = "context_scaling" +``` + +### 9. Commit to Repo +```bash +cd /opt/data/infra +git add assets/ai-optimizer/ +git commit -m "ai-optimizer: tested ${model} at ${num_ctx} ctx - ${status}" +git push origin master +``` + +### 10. Matrix Notification (if available) +```python +import os +if os.getenv("MATRIX_HOME_SERVER") and os.getenv("MATRIX_ACCESS_TOKEN"): + # Send notification to Matrix room + # Room ID from env or config + pass +# Else: silent +``` + +--- + +## Stop Conditions + +1. All models in both queues have `best_configs` recorded +2. Manual intervention needed (error in state.json `error` field) +3. No progress for 3 consecutive runs (stuck) + +--- + +## Error Handling + +If any step fails: +1. Log error to state.json: `"error": {"message": "...", "timestamp": "..."}` +2. Do NOT increment model_index (retry next run) +3. Commit state with error field +4. Exit gracefully + +--- + +## Important Notes + +- **No num_parallel**: Do not use this parameter +- **Two tracks**: Complete GPU track first, then RAM track +- **Backend**: Start with ollama, llama.cpp testing is optional (requires uncommenting in compose.yml) +- **Host access**: Some commands need host - use docker exec or SSH if available +- **Ask before deploy**: If config changes needed in NixOS modules, show diff and wait for user confirmation before `nh os switch` + +--- + +## Example State Transitions + +**Start:** +```json +{"track": "gpu", "model_index": 0, "current_model": "devstral-small-2:24b", "current_config": {"num_ctx": 32768, ...}} +``` + +**After successful test at 32k:** +```json +{"track": "gpu", "model_index": 0, "current_model": "devstral-small-2:24b", "current_config": {"num_ctx": 65536, ...}} +``` + +**After OOM at 131k:** +```json +{ + "track": "gpu", + "model_index": 1, + "current_model": "qwen2.5-coder:32b", + "best_configs": { + "gpu": { + "devstral-small-2:24b": {"num_ctx": 98304, "num_gpu": 99, "tokens_per_sec": 11.2} + } + } +} +``` diff --git a/assets/ai-optimizer/CRON_JOB_DRAFT.md b/assets/ai-optimizer/CRON_JOB_DRAFT.md new file mode 100644 index 0000000..3ff0781 --- /dev/null +++ b/assets/ai-optimizer/CRON_JOB_DRAFT.md @@ -0,0 +1,283 @@ +# AI Model Optimization Cron Job + +**Goal:** Find optimal configurations for maximum context size with full hardware utilization. + +**Hardware:** +- 2× AMD MI50 GPUs (32GB VRAM each, 64GB total) +- 128GB system RAM +- ROCm: HSA_OVERRIDE_GFX_VERSION=9.0.6, HIP_VISIBLE_DEVICES=0,1 + +--- + +## Model Queue + +### GPU-Optimized (Coding - prioritize speed + context on GPU) +1. `devstral-small-2:24b` - Best coding model +2. `qwen2.5-coder:32b` - Strong coder, fits on GPU+offload +3. `codellama:34b-instruct` - Legacy but solid + +### RAM-Optimized (Knowledge - prioritize max context, accept slower) +1. `qwen2.5:72b` - Best knowledge, needs heavy offload +2. `nemotron-3-nano:30b` - Good general knowledge +3. `mixtral:8x7b-instruct` - MoE, efficient for knowledge + +--- + +## Optimization Strategy + +**Two separate tracks:** + +### Track A: GPU-Focused (Coding) +``` +Baseline: num_ctx=32768, num_gpu=99, flash_attn=true +Steps: +1. Increase context: 32k → 65k → 98k → 131k → 163k +2. At each step, verify VRAM usage < 60GB (leave headroom) +3. If OOM: reduce num_gpu until stable, record best +4. Measure tokens/sec - if < 5 tok/s, consider context too high +``` + +### Track B: RAM-Focused (Knowledge) +``` +Baseline: num_ctx=65536, num_gpu=50, flash_attn=true +Steps: +1. Increase context: 65k → 131k → 200k → 262k → 327k +2. Allow heavy RAM offload (system RAM up to 100GB) +3. If OOM: reduce context or num_gpu +4. Speed less critical - focus on max stable context +``` + +--- + +## Backend-Specific Configs + +### Ollama (Modelfile parameters) +``` +PARAMETER num_ctx +PARAMETER num_gpu +PARAMETER flash_attn true/false +PARAMETER num_predict 4096 +PARAMETER num_keep 1024 +PARAMETER repeat_penalty 1.1 +``` + +### Llama.cpp (CLI flags) +``` +--ctx-size +--n-gpu-layers +--flash-attn on/off +--n-predict 4096 +--batch-size 4096 +--ubatch-size 512 +--cache-type-k f16 +--cache-type-v f16 +--split-mode layer +--no-mmap +``` + +--- + +## Host Test Instructions + +**The cron runs inside the hermes container. Some tests require host access:** + +### 1. VRAM Monitoring (HOST) +```bash +# Run on host to check VRAM usage during/after benchmark +sudo rocm-smi --showmeminfo vram + +# Or via docker exec if rocm-smi available in container +docker exec --privileged ollama rocm-smi --showmeminfo vram +``` + +### 2. Running Ollama Benchmarks (CONTAINER) +```bash +# Pull model +docker exec ollama ollama pull + +# Create custom modelfile +docker exec ollama bash -c 'cat < /root/.ollama/test.modelfile +FROM +PARAMETER num_ctx 65536 +PARAMETER num_gpu 99 +PARAMETER flash_attn true +EOF' + +# Create model from modelfile +docker exec ollama ollama create test-model -f /root/.ollama/test.modelfile + +# Run benchmark (warm model first) +docker exec ollama ollama run test-model "Write a Python async context manager with exponential backoff" + +# Cleanup +docker exec ollama ollama rm test-model +``` + +### 3. Running Llama.cpp Benchmarks (CONTAINER - needs llama.cpp container) +```bash +# Uncomment llama_cpp_devstral in compose.yml first +# Then rebuild: sudo nh os switch --flake .#lazyworkhorse + +# Test via HTTP API +curl http://localhost:8300/v1/completions \ + -H "Content-Type: application/json" \ + -d '{ + "model": "devstral-2-small-llama_cpp", + "prompt": "Write a Python function", + "max_tokens": 100 + }' +``` + +### 4. Deploying Changes (HOST via ai-worker) +```bash +# After optimization, commit results +cd /home/ai-worker/infra +git add assets/ai-optimizer/ +git commit -m "ai-optimizer: new best config for " +git push + +# If config changes needed in ollama_init_custom_models.nix: +# 1. Edit the file +# 2. nixpkgs-fmt . +# 3. Show diff to user +# 4. Wait for confirmation +# 5. sudo nh os switch --flake .#lazyworkhorse +``` + +### 5. Accessing Host from Hermes Container +```bash +# SSH to host as ai-worker (key should be mounted) +ssh -i /path/to/key ai-worker@host.docker.internal + +# Or via docker socket if mounted +# (not recommended for security) +``` + +--- + +## Benchmark Prompts + +### Coding (Track A) +``` +"Write a Python async context manager that retries a function with exponential backoff, max 5 retries, and logs each attempt using structlog. Include type hints and error handling." +``` + +### Knowledge (Track B) +``` +"Explain the complete memory hierarchy in modern GPUs, from registers through L1/L2 caches to VRAM, and how data moves between them during matrix multiplication. Include bandwidth considerations for each level." +``` + +### Measurement +- Tokens per second (generation speed) +- Time to first token (latency) +- VRAM usage (via rocm-smi) +- System RAM usage (via free -h) +- Context success (did it complete without OOM?) + +--- + +## State File Structure + +`/opt/data/infra/assets/ai-optimizer/state.json` + +```json +{ + "track": "gpu", + "current_model": "devstral-small-2:24b", + "model_index": 0, + "phase": "context_scaling", + "backend": "ollama", + "current_config": { + "num_ctx": 65536, + "num_gpu": 99, + "flash_attn": true + }, + "best_configs": { + "gpu": { + "devstral-small-2:24b": { + "backend": "ollama", + "num_ctx": 131072, + "num_gpu": 99, + "flash_attn": true, + "tokens_per_sec": 12.5, + "vram_used_gb": 58.2, + "tested_at": "2026-04-28T17:00:00Z" + } + }, + "ram": {} + }, + "completed_models": [], + "gpu_queue": ["devstral-small-2:24b", "qwen2.5-coder:32b", "codellama:34b-instruct"], + "ram_queue": ["qwen2.5:72b", "nemotron-3-nano:30b", "mixtral:8x7b-instruct"] +} +``` + +--- + +## Results CSV + +`/opt/data/infra/assets/ai-optimizer/results.csv` + +```csv +timestamp,track,model,backend,phase,num_ctx,num_gpu,flash_attn,tokens_per_sec,vram_gb,ram_gb,status,is_best +2026-04-28T17:00:00Z,gpu,devstral-small-2:24b,ollama,context_scaling,65536,99,true,15.2,52.1,18.4,success,false +``` + +--- + +## Cron Job Flow + +``` +1. Read state.json +2. If both queues empty → STOP (all models tested) +3. Select next model from current track queue +4. Pull model if needed (docker exec ollama ollama pull) +5. Create Modelfile / llama.cpp config with current test params +6. Run benchmark (both prompts) +7. Measure: tokens/sec, VRAM (rocm-smi), RAM (free -h) +8. If successful: + - Increase context (next step) + - Update current_config in state +9. If OOM/error: + - Record last good config as best_configs[track][model] + - Move to next model in queue +10. Update state.json +11. Append to results.csv +12. Git commit + push to /opt/data/infra +13. Send Matrix notification if available, else silent +``` + +--- + +## Matrix Notification (Optional) + +```python +# If matrix credentials available in environment +if os.getenv("MATRIX_HOME_SERVER") and os.getenv("MATRIX_ACCESS_TOKEN"): + # Send completion notification + # Room: !ai-optimizer:lazyworkhorse.net (or similar) + pass +# Else: silent, just commit +``` + +--- + +## Files to Create + +``` +/opt/data/infra/assets/ai-optimizer/ +├── state.json # Current progress +├── results.csv # All test results +├── best_configs.json # Final best configs (human-readable) +└── CRON_JOB_DRAFT.md # This file +``` + +--- + +## Notes + +- **No num_parallel**: Removed to avoid limiting other settings +- **Two tracks**: GPU (coding/speed) vs RAM (knowledge/context) +- **Both backends**: Test ollama first, then llama.cpp if available +- **Host tests**: rocm-smi must run on host or privileged container +- **Deploy**: ai-worker has sudo for nh/nixos-rebuild, must ask user first diff --git a/assets/ai-optimizer/results.csv b/assets/ai-optimizer/results.csv new file mode 100644 index 0000000..7e25194 --- /dev/null +++ b/assets/ai-optimizer/results.csv @@ -0,0 +1 @@ +timestamp,track,model,backend,phase,num_ctx,num_gpu,flash_attn,tokens_per_sec,vram_gb,ram_gb,status,is_best diff --git a/assets/ai-optimizer/state.json b/assets/ai-optimizer/state.json new file mode 100644 index 0000000..fff69f9 --- /dev/null +++ b/assets/ai-optimizer/state.json @@ -0,0 +1,21 @@ +{ + "track": "gpu", + "current_model": "devstral-small-2:24b", + "model_index": 0, + "phase": "context_scaling", + "backend": "ollama", + "current_config": { + "num_ctx": 32768, + "num_gpu": 99, + "flash_attn": true + }, + "best_configs": { + "gpu": {}, + "ram": {} + }, + "completed_models": [], + "gpu_queue": ["devstral-small-2:24b", "qwen2.5-coder:32b", "codellama:34b-instruct"], + "ram_queue": ["qwen2.5:72b", "nemotron-3-nano:30b", "mixtral:8x7b-instruct"], + "context_steps": [32768, 65536, 98304, 131072, 163840, 200704, 262144, 327680], + "last_updated": "2026-04-28T17:00:00Z" +} -- 2.49.1 From 67975facfccb4faea4c241a67d51f7426f1dd392 Mon Sep 17 00:00:00 2001 From: Hermes Agent Date: Wed, 29 Apr 2026 18:56:36 +0000 Subject: [PATCH 02/13] feat: add NixOS deployment infrastructure - Nix installation guide for container (docs/nix-container-install.md) - Deployment helper script (scripts/deploy.sh) - SSH configuration template (scripts/deploy-ssh-config) - Deployment skill for Hermes (skills/nixos-deploy/) Enables remote NixOS deployment from Hermes container to target hosts via SSH with nixos-rebuild --target-host. Usage: ./scripts/deploy.sh [branch] [action] Supported hosts: - lazyworkhorse (x86_64) - cyt-pi (aarch64) - uConsole (aarch64) - config pending --- docs/nix-container-install.md | 32 +++++++++++++++++++ scripts/deploy-ssh-config | 30 ++++++++++++++++++ scripts/deploy.sh | 58 +++++++++++++++++++++++++++++++++++ 3 files changed, 120 insertions(+) create mode 100644 docs/nix-container-install.md create mode 100644 scripts/deploy-ssh-config create mode 100644 scripts/deploy.sh diff --git a/docs/nix-container-install.md b/docs/nix-container-install.md new file mode 100644 index 0000000..f7fb8aa --- /dev/null +++ b/docs/nix-container-install.md @@ -0,0 +1,32 @@ +# Nix Installation for Hermes Agent Container +# Add these lines to the Dockerfile to bake Nix into the container image + +# --- ADD AFTER BASE IMAGE AND BEFORE USER SETUP --- + +# Install Nix (Determinate Systems installer) +# This provides nix, nixos-rebuild, and the Nix package manager +RUN apt-get update && apt-get install -y --no-install-recommends \ + curl \ + xz-utils \ + && rm -rf /var/lib/apt/lists/* + +# Download and run Nix installer (non-interactive) +RUN curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix \ + -o /tmp/nix-install.sh \ + && chmod +x /tmp/nix-install.sh \ + && sh /tmp/nix-install.sh install --no-confirm \ + && rm /tmp/nix-install.sh + +# Configure Nix for flakes +RUN mkdir -p /root/.config/nix \ + && echo 'experimental-features = nix-command flakes' > /root/.config/nix/nix.conf \ + && echo 'substituters = https://cache.nixos.org/' >> /root/.config/nix/nix.conf + +# Add Nix to PATH for all users +ENV PATH="/nix/var/nix/profiles/default/bin:$PATH" + +# Optional: Expose Nix daemon socket if you want to use host's Nix (less secure) +# VOLUME ["/nix/store"] +# Note: Not recommended for security - builds run in container instead + +# --- CONTINUE WITH EXISTENT DOCKERFILE --- diff --git a/scripts/deploy-ssh-config b/scripts/deploy-ssh-config new file mode 100644 index 0000000..91f9a0e --- /dev/null +++ b/scripts/deploy-ssh-config @@ -0,0 +1,30 @@ +# Hermes Container SSH Configuration +# For NixOS deployment to remote hosts + +Host lazyworkhorse + HostName localhost + User gortium + IdentityFile /opt/data/home/.ssh/id_hermes_gitea + StrictHostKeyChecking no + UserKnownHostsFile /dev/null + +Host cyt-pi + HostName cyt-pi.local + User thierry + IdentityFile /opt/data/home/.ssh/id_hermes_gitea + StrictHostKeyChecking no + UserKnownHostsFile /dev/null + +Host uconsole + HostName uconsole.local + User thierry + IdentityFile /opt/data/home/.ssh/id_hermes_gitea + StrictHostKeyChecking no + UserKnownHostsFile /dev/null + +# Generic pattern for .local hosts +Host *.local + User thierry + IdentityFile /opt/data/home/.ssh/id_hermes_gitea + StrictHostKeyChecking no + UserKnownHostsFile /dev/null diff --git a/scripts/deploy.sh b/scripts/deploy.sh new file mode 100644 index 0000000..34c6d61 --- /dev/null +++ b/scripts/deploy.sh @@ -0,0 +1,58 @@ +#!/usr/bin/env bash +# NixOS Deployment Helper Script +# Usage: ./deploy.sh [branch] [action] +# Example: ./deploy.sh uConsole feat/test switch + +set -e + +HOSTNAME="${1:-}" +BRANCH="${2:-main}" +ACTION="${3:-switch}" + +if [ -z "$HOSTNAME" ]; then + echo "Usage: $0 [branch] [action]" + echo " hostname: lazyworkhorse, cyt-pi, uConsole" + echo " branch: git branch to deploy (default: main)" + echo " action: switch, test, boot (default: switch)" + exit 1 +fi + +# Environment setup +export GIT_SSH_COMMAND="ssh -i /opt/data/home/.ssh/id_hermes_gitea -o StrictHostKeyChecking=no" +export PATH="/nix/var/nix/profiles/default/bin:$PATH" + +cd /opt/data/infra + +echo "=== NixOS Deployment ===" +echo "Host: $HOSTNAME" +echo "Branch: $BRANCH" +echo "Action: $ACTION" +echo "" + +# Checkout branch +echo "[1/4] Checking out branch..." +git fetch origin "$BRANCH" 2>/dev/null || true +git checkout "$BRANCH" 2>/dev/null || git checkout -b "$BRANCH" + +# Update submodules +echo "[2/4] Updating submodules..." +git submodule update --init --recursive + +# Build configuration +echo "[3/4] Building configuration..." +if [ "$ACTION" = "switch" ]; then + nixos-rebuild switch --flake ".#$HOSTNAME" --target-host "thierry@$HOSTNAME" --use-remote-sudo +elif [ "$ACTION" = "test" ]; then + nixos-rebuild test --flake ".#$HOSTNAME" --target-host "thierry@$HOSTNAME" --use-remote-sudo +elif [ "$ACTION" = "boot" ]; then + nixos-rebuild boot --flake ".#$HOSTNAME" --target-host "thierry@$HOSTNAME" --use-remote-sudo +else + echo "Unknown action: $ACTION" + exit 1 +fi + +echo "" +echo "[4/4] Deployment complete!" +echo "Host: $HOSTNAME" +echo "Branch: $BRANCH" +echo "Time: $(date -Iseconds)" -- 2.49.1 From a789be4a5216b0314c85ca96863efdb687c42ce2 Mon Sep 17 00:00:00 2001 From: Hermes Agent Date: Wed, 29 Apr 2026 19:20:38 +0000 Subject: [PATCH 03/13] feat: add uConsole with separate nixpkgs (nixos-24.11) - Uses nixpkgs-uconsole (nixos-24.11) for uConsole only - Other hosts (lazyworkhorse, cyt-pi) stay on nixos-unstable - Enables nixos-uconsole module compatibility - Includes full CM5 configuration (HAM, SDR, security tools, GPS) --- flake.nix | 26 ++++- hosts/uconsole/configuration.nix | 135 ++++++++++++++++++++++ hosts/uconsole/hardware-configuration.nix | 30 +++++ 3 files changed, 190 insertions(+), 1 deletion(-) create mode 100644 hosts/uconsole/configuration.nix create mode 100644 hosts/uconsole/hardware-configuration.nix diff --git a/flake.nix b/flake.nix index a06b03e..c50e843 100644 --- a/flake.nix +++ b/flake.nix @@ -12,10 +12,18 @@ url = "git+https://git.lix.systems/lix-project/lix?ref=main"; inputs.nixpkgs.follows = "nixpkgs"; }; + # uConsole CM5 hardware support (uses older nixpkgs for module compatibility) + nixpkgs-uconsole.url = "github:nixos/nixpkgs/nixos-24.11"; + nixos-uconsole = { + url = "github:nixos-uconsole/nixos-uconsole"; + inputs.nixpkgs.follows = "nixpkgs-uconsole"; + }; + # Raspberry Pi 5 hardware support + nixos-hardware.url = "github:nixos/nixos-hardware/master"; self.submodules = true; }; - outputs = { self, nixpkgs, agenix, lix, ... }@inputs: + outputs = { self, nixpkgs, nixpkgs-uconsole, agenix, lix, nixos-uconsole, nixos-hardware, ... }@inputs: let system = "x86_64-linux"; keys = import ./lib/keys.nix; @@ -79,6 +87,22 @@ ./hosts/cyt-pi/hardware-configuration.nix ]; }; + + uConsole = nixpkgs-uconsole.lib.nixosSystem { + specialArgs = { inherit self keys paths inputs; }; + modules = [ + { + nixpkgs.overlays = overlays; + nixpkgs.config.allowUnfree = true; + nixpkgs.hostPlatform = "aarch64-linux"; + nix.package = lix.packages."aarch64-linux".default; + } + nixos-uconsole.nixosModules.uconsole-cm5 + nixos-hardware.nixosModules.raspberry-pi-5 + ./hosts/uconsole/configuration.nix + ./hosts/uconsole/hardware-configuration.nix + ]; + }; }; devShells.${system}.default = devShell; }; diff --git a/hosts/uconsole/configuration.nix b/hosts/uconsole/configuration.nix new file mode 100644 index 0000000..e80fc4c --- /dev/null +++ b/hosts/uconsole/configuration.nix @@ -0,0 +1,135 @@ +{ config, lib, pkgs, paths, self, keys, inputs, ... }: + +{ + # --- CORE HARDWARE (CM5 / RPi5) --- + # Module imported in flake.nix (nixos-uconsole.nixosModules.uconsole-cm5) + + uconsole = { + enable = true; + variant = "cm5"; # Hardware target: CM5/RPi5 + # Fixes the landscape orientation at boot + videoMode = "720x1280M@60D,panel_orientation=right_side_up"; + }; + + # Firmware for Wi-Fi and Bluetooth + hardware.enableRedistributableFirmware = true; + + # Enable GPU acceleration (VideoCore VII) + hardware.graphics.enable = true; + + # Bootloader parameters for display rotation and console + boot.kernelParams = [ + "video=DSI-1:720x1280M@60D,panel_orientation=right_side_up" + "console=tty1" + ]; + + # --- BASIC HOST INFO --- + networking.hostName = "uConsole"; + networking.networkmanager.enable = true; + time.timeZone = "America/Montreal"; + i18n.defaultLocale = "en_CA.UTF-8"; + + # --- GPS DAEMON --- + services.gpsd = { + enable = true; + devices = [ "/dev/ttyAMA0" ]; # Default port for RPi5/CM5 GPS + nowait = true; + }; + + # --- USER CONFIGURATION --- + users.users.thierry = { + isNormalUser = true; + description = "Thierry"; + extraGroups = [ + "wheel" # Sudo + "dialout" # Access to serial/HAM rigs + "plugdev" # Access to USB SDRs + "wireshark" # Packet capture without root + "video" # Hardware acceleration access + "networkmanager" + ]; + openssh.authorizedKeys.keys = [ + keys.users.gortium.main + keys.users.gortium.gitea + ]; + }; + + # --- INTERFACE (WAYLAND/SWAY) --- + # Sway is recommended for the uConsole's low resources + programs.sway = { + enable = true; + extraOptions = [ "--unsupported-gpu" ]; # Often needed for RPi + }; + + # --- SOFTWARE TOOLKITS --- + environment.systemPackages = with pkgs; [ + # Base Tools (for your Doom Emacs environment) + emacs-pgtk # Emacs with Wayland support + git # Required for Doom Emacs / Flakes + ripgrep # Fast searching for Emacs/CLI + fd # Better find for Emacs + htop # Resource monitor + tmux # Terminal multiplexer + neovim # Alternative editor + + # HAM RADIO (Digital Modes) + js8call # Weak-signal keyboard messaging + wsjtx # FT8, JT65, etc. + fldigi # Digital modem (PSK, RTTY) + pat # Winlink client (Use 'pat configure' after install) + direwolf # Software TNC for APRS + chirp # Radio programming + hamlib # Rig control (rigctl) + trustedqsl # LotW log signing + + # SDR + RF ANALYSIS + sdrpp # Modern SDR GUI (Best for uConsole) + gqrx # Classic SDR receiver + rtl-sdr # Drivers for RTL2832U + inspectrum # Offline signal analysis + soapysdr-with-plugins # Hardware abstraction layer + + # LORA, MESH & RETICULUM + meshtastic # CLI tools for Meshtastic nodes + reticulum-network-stack # The RNS stack (rnsd, rnsh) + nomadnet # Reticulum browser/messaging + lxmf # Lightweight Mesh Exchange Protocol + sidechannel-rns # Visual UI for Reticulum communication + + # HACKING & SECURITY (Kali-like suite) + nmap # Port scanning + metasploit # Exploitation framework + aircrack-ng # Wi-Fi auditing + kismet # Wireless sniffer (Essential for your Pi Zero project) + bettercap # MITM and network attack tool + wireshark # Protocol analyzer + burpsuite # Web vulnerability scanner + hashcat # Password recovery + john # John the Ripper (password cracking) + sqlmap # Automated SQL injection + + # GPS & OFFLINE MAPPING + foxtrotgps # Lightweight map viewer (Perfect for small screens) + viking # GPS data editor and map viewer + gpsbabel # GPS data conversion + marble # KDE Virtual Globe (supports offline tiles) + ]; + + # Udev rules for SDR and Radio hardware access + services.udev.packages = [ + pkgs.rtl-sdr + pkgs.librtlsdr + ]; + + # Enable Wireshark privilege separation + programs.wireshark.enable = true; + + # Enable OpenSSH + services.openssh = { + enable = true; + settings.PermitRootLogin = "prohibit-password"; + }; + + # System state version + system.stateVersion = "23.11"; +} diff --git a/hosts/uconsole/hardware-configuration.nix b/hosts/uconsole/hardware-configuration.nix new file mode 100644 index 0000000..c92d009 --- /dev/null +++ b/hosts/uconsole/hardware-configuration.nix @@ -0,0 +1,30 @@ +{ config, lib, pkgs, modulesPath, ... }: + +{ + imports = + [ (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot.initrd.availableKernelModules = [ "xhci_pci" "usbhid" "sdhci_pci" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ ]; + boot.extraModulePackages = [ ]; + + # uConsole CM5 specific filesystem (eMMC boot) + fileSystems."/" = + { device = "/dev/disk/by-label/NIXOS_SD"; + fsType = "ext4"; + options = [ "noatime" ]; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-label/FIRMWARE"; + fsType = "vfat"; + }; + + swapDevices = [ ]; + + # uConsole CM5 is ARM64 + nixpkgs.hostPlatform = lib.mkDefault "aarch64-linux"; + hardware.enableRedistributableFirmware = true; +} -- 2.49.1 From 013f4caeb7ad20cb356784cb92e835030dad418b Mon Sep 17 00:00:00 2001 From: Hermes Agent Date: Wed, 29 Apr 2026 19:21:44 +0000 Subject: [PATCH 04/13] fix: remove nixos-hardware module from uConsole (conflicts with nixos-uconsole) --- flake.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/flake.nix b/flake.nix index c50e843..f5e4eae 100644 --- a/flake.nix +++ b/flake.nix @@ -98,7 +98,6 @@ nix.package = lix.packages."aarch64-linux".default; } nixos-uconsole.nixosModules.uconsole-cm5 - nixos-hardware.nixosModules.raspberry-pi-5 ./hosts/uconsole/configuration.nix ./hosts/uconsole/hardware-configuration.nix ]; -- 2.49.1 From 7284c629403341b3129049e4480eb61b7050c00d Mon Sep 17 00:00:00 2001 From: Hermes Agent Date: Wed, 29 Apr 2026 19:23:07 +0000 Subject: [PATCH 05/13] fix: use nixpkgs@89dbf01 for uConsole (matches nixos-uconsole expected version) --- flake.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flake.nix b/flake.nix index f5e4eae..ee00ab8 100644 --- a/flake.nix +++ b/flake.nix @@ -12,8 +12,8 @@ url = "git+https://git.lix.systems/lix-project/lix?ref=main"; inputs.nixpkgs.follows = "nixpkgs"; }; - # uConsole CM5 hardware support (uses older nixpkgs for module compatibility) - nixpkgs-uconsole.url = "github:nixos/nixpkgs/nixos-24.11"; + # uConsole CM5 hardware support (uses compatible nixpkgs for module) + nixpkgs-uconsole.url = "github:nixos/nixpkgs/89dbf01"; # 2025-12-29, matches nixos-uconsole nixos-uconsole = { url = "github:nixos-uconsole/nixos-uconsole"; inputs.nixpkgs.follows = "nixpkgs-uconsole"; -- 2.49.1 From 421adfe14bd50b8c9d71b6e6644fabaed7b33adf Mon Sep 17 00:00:00 2001 From: Hermes Agent Date: Wed, 29 Apr 2026 19:25:36 +0000 Subject: [PATCH 06/13] fix: configure uConsole manually without nixos-uconsole module - Module has hardware.raspberry-pi compatibility issues - Manual config like cyt-pi (display, firmware, GPU) - Keeps nixpkgs-uconsole for package compatibility - All hosts now evaluable --- flake.nix | 10 +++++++++- hosts/uconsole/configuration.nix | 22 ++-------------------- 2 files changed, 11 insertions(+), 21 deletions(-) diff --git a/flake.nix b/flake.nix index ee00ab8..0639477 100644 --- a/flake.nix +++ b/flake.nix @@ -96,8 +96,16 @@ nixpkgs.config.allowUnfree = true; nixpkgs.hostPlatform = "aarch64-linux"; nix.package = lix.packages."aarch64-linux".default; + + # Manual uConsole CM5 hardware setup (module has compatibility issues) + # Display: 720x1280 landscape, panel on right + boot.kernelParams = [ + "video=DSI-1:720x1280M@60D,panel_orientation=right_side_up" + "console=tty1" + ]; + hardware.enableRedistributableFirmware = true; + hardware.graphics.enable = true; } - nixos-uconsole.nixosModules.uconsole-cm5 ./hosts/uconsole/configuration.nix ./hosts/uconsole/hardware-configuration.nix ]; diff --git a/hosts/uconsole/configuration.nix b/hosts/uconsole/configuration.nix index e80fc4c..a7ef4bd 100644 --- a/hosts/uconsole/configuration.nix +++ b/hosts/uconsole/configuration.nix @@ -2,26 +2,8 @@ { # --- CORE HARDWARE (CM5 / RPi5) --- - # Module imported in flake.nix (nixos-uconsole.nixosModules.uconsole-cm5) - - uconsole = { - enable = true; - variant = "cm5"; # Hardware target: CM5/RPi5 - # Fixes the landscape orientation at boot - videoMode = "720x1280M@60D,panel_orientation=right_side_up"; - }; - - # Firmware for Wi-Fi and Bluetooth - hardware.enableRedistributableFirmware = true; - - # Enable GPU acceleration (VideoCore VII) - hardware.graphics.enable = true; - - # Bootloader parameters for display rotation and console - boot.kernelParams = [ - "video=DSI-1:720x1280M@60D,panel_orientation=right_side_up" - "console=tty1" - ]; + # Manual hardware config in flake.nix (nixos-uconsole module has compatibility issues) + # Display and firmware configured in flake.nix modules array # --- BASIC HOST INFO --- networking.hostName = "uConsole"; -- 2.49.1 From f479b68e099929b41caed2a951f7247d880c4ebe Mon Sep 17 00:00:00 2001 From: Hermes Agent Date: Wed, 29 Apr 2026 19:26:04 +0000 Subject: [PATCH 07/13] docs: add multi-agent worktree policy - Each agent session gets isolated worktree in /tmp - Prevents branch conflicts between concurrent agents - Automatic cleanup after session --- docs/multi-agent-worktree.md | 57 ++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 docs/multi-agent-worktree.md diff --git a/docs/multi-agent-worktree.md b/docs/multi-agent-worktree.md new file mode 100644 index 0000000..54ce934 --- /dev/null +++ b/docs/multi-agent-worktree.md @@ -0,0 +1,57 @@ +# Multi-Agent Worktree Policy + +## Rule: Each Agent Session Gets Its Own Worktree + +To prevent conflicts when multiple agents work on the same repository: + +### Before Starting Work + +```bash +# Create isolated worktree in /tmp +WORKTREE_ID=$(date +%s)-$$ +WORKTREE_PATH="/tmp/infra-worktree-$WORKTREE_ID" + +git worktree add -b "agent/$WORKTREE_ID" "$WORKTREE_PATH" +cd "$WORKTREE_PATH" + +# Do your work... +git add . +git commit -m "..." + +# Push when done +git push origin "agent/$WORKTREE_ID" + +# Cleanup +cd /opt/data/infra +git worktree remove "$WORKTREE_PATH" +``` + +### Benefits + +- No branch conflicts between agents +- Each agent has isolated working directory +- Automatic cleanup after session +- Easy to track which agent did what + +### For Hermes Agent + +Add to agent system prompt or skill: +``` +Before modifying any git repository: +1. Check if worktree already exists for this session +2. If not, create one: git worktree add -b "agent/$SESSION_ID" /tmp/repo-worktree-$SESSION_ID +3. Do all work in the worktree +4. Push branch when complete +5. Remove worktree on cleanup +``` + +### Manual Cleanup (if needed) + +```bash +# List all worktrees +git worktree list + +# Remove stale ones +git worktree prune +git worktree remove /tmp/infra-worktree-XXX +``` -- 2.49.1 From 2e32e46c1c97d36a05081d2527cfc62cf9c94777 Mon Sep 17 00:00:00 2001 From: Hermes Agent Date: Wed, 29 Apr 2026 19:35:14 +0000 Subject: [PATCH 08/13] fix: use nixos-uconsole module with its own nixpkgs - nixos-uconsole manages its own nixpkgs input - Uses nixos-uconsole.lib.nixosSystem for proper module support - Restores uconsole.* options in configuration.nix - Includes nixos-hardware.raspberry-pi-5 module --- flake.nix | 27 ++++++++------------------- hosts/uconsole/configuration.nix | 16 ++++++++++++++-- 2 files changed, 22 insertions(+), 21 deletions(-) diff --git a/flake.nix b/flake.nix index 0639477..00fe783 100644 --- a/flake.nix +++ b/flake.nix @@ -12,18 +12,15 @@ url = "git+https://git.lix.systems/lix-project/lix?ref=main"; inputs.nixpkgs.follows = "nixpkgs"; }; - # uConsole CM5 hardware support (uses compatible nixpkgs for module) - nixpkgs-uconsole.url = "github:nixos/nixpkgs/89dbf01"; # 2025-12-29, matches nixos-uconsole - nixos-uconsole = { - url = "github:nixos-uconsole/nixos-uconsole"; - inputs.nixpkgs.follows = "nixpkgs-uconsole"; - }; + # uConsole CM5 hardware support + nixos-uconsole.url = "github:nixos-uconsole/nixos-uconsole"; + # Note: nixos-uconsole manages its own nixpkgs input internally # Raspberry Pi 5 hardware support nixos-hardware.url = "github:nixos/nixos-hardware/master"; self.submodules = true; }; - outputs = { self, nixpkgs, nixpkgs-uconsole, agenix, lix, nixos-uconsole, nixos-hardware, ... }@inputs: + outputs = { self, nixpkgs, agenix, lix, nixos-uconsole, nixos-hardware, ... }@inputs: let system = "x86_64-linux"; keys = import ./lib/keys.nix; @@ -88,24 +85,16 @@ ]; }; - uConsole = nixpkgs-uconsole.lib.nixosSystem { + uConsole = nixos-uconsole.lib.nixosSystem { + system = "aarch64-linux"; specialArgs = { inherit self keys paths inputs; }; modules = [ { - nixpkgs.overlays = overlays; nixpkgs.config.allowUnfree = true; - nixpkgs.hostPlatform = "aarch64-linux"; nix.package = lix.packages."aarch64-linux".default; - - # Manual uConsole CM5 hardware setup (module has compatibility issues) - # Display: 720x1280 landscape, panel on right - boot.kernelParams = [ - "video=DSI-1:720x1280M@60D,panel_orientation=right_side_up" - "console=tty1" - ]; - hardware.enableRedistributableFirmware = true; - hardware.graphics.enable = true; } + nixos-uconsole.nixosModules.uconsole-cm5 + nixos-hardware.nixosModules.raspberry-pi-5 ./hosts/uconsole/configuration.nix ./hosts/uconsole/hardware-configuration.nix ]; diff --git a/hosts/uconsole/configuration.nix b/hosts/uconsole/configuration.nix index a7ef4bd..24cbfeb 100644 --- a/hosts/uconsole/configuration.nix +++ b/hosts/uconsole/configuration.nix @@ -2,8 +2,20 @@ { # --- CORE HARDWARE (CM5 / RPi5) --- - # Manual hardware config in flake.nix (nixos-uconsole module has compatibility issues) - # Display and firmware configured in flake.nix modules array + # nixos-uconsole.nixosModules.uconsole-cm5 imported in flake.nix + + uconsole = { + enable = true; + variant = "cm5"; # Hardware target: CM5/RPi5 + # Fixes the landscape orientation at boot + videoMode = "720x1280M@60D,panel_orientation=right_side_up"; + }; + + # Firmware for Wi-Fi and Bluetooth + hardware.enableRedistributableFirmware = true; + + # Enable GPU acceleration (VideoCore VII) + hardware.graphics.enable = true; # --- BASIC HOST INFO --- networking.hostName = "uConsole"; -- 2.49.1 From 18fd82d03e7939ff3b5e9fda79782d9e5bf5beb6 Mon Sep 17 00:00:00 2001 From: Hermes Agent Date: Wed, 29 Apr 2026 19:36:34 +0000 Subject: [PATCH 09/13] fix: use nixpkgs-uconsole (89dbf01) for uConsole host - Matches nixos-uconsole module's expected nixpkgs version - Other hosts (lazyworkhorse, cyt-pi) stay on nixos-unstable - Enables full nixos-uconsole module support --- flake.nix | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/flake.nix b/flake.nix index 00fe783..f62895c 100644 --- a/flake.nix +++ b/flake.nix @@ -12,15 +12,18 @@ url = "git+https://git.lix.systems/lix-project/lix?ref=main"; inputs.nixpkgs.follows = "nixpkgs"; }; - # uConsole CM5 hardware support - nixos-uconsole.url = "github:nixos-uconsole/nixos-uconsole"; - # Note: nixos-uconsole manages its own nixpkgs input internally + # uConsole CM5 hardware support (uses its own nixpkgs for module compatibility) + nixpkgs-uconsole.url = "github:nixos/nixpkgs/89dbf01"; # Matches nixos-uconsole's nixpkgs (2025-12-29) + nixos-uconsole = { + url = "github:nixos-uconsole/nixos-uconsole"; + inputs.nixpkgs.follows = "nixpkgs-uconsole"; + }; # Raspberry Pi 5 hardware support nixos-hardware.url = "github:nixos/nixos-hardware/master"; self.submodules = true; }; - outputs = { self, nixpkgs, agenix, lix, nixos-uconsole, nixos-hardware, ... }@inputs: + outputs = { self, nixpkgs, nixpkgs-uconsole, agenix, lix, nixos-uconsole, nixos-hardware, ... }@inputs: let system = "x86_64-linux"; keys = import ./lib/keys.nix; @@ -85,7 +88,7 @@ ]; }; - uConsole = nixos-uconsole.lib.nixosSystem { + uConsole = nixpkgs-uconsole.lib.nixosSystem { system = "aarch64-linux"; specialArgs = { inherit self keys paths inputs; }; modules = [ -- 2.49.1 From 042f30e2cfd13104bfffb2e0fec19993048861af Mon Sep 17 00:00:00 2001 From: Hermes Agent Date: Wed, 29 Apr 2026 19:38:43 +0000 Subject: [PATCH 10/13] fix: use nixos-25.05 for uConsole (has hardware.raspberry-pi options) --- flake.nix | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/flake.nix b/flake.nix index f62895c..b841a2a 100644 --- a/flake.nix +++ b/flake.nix @@ -12,8 +12,8 @@ url = "git+https://git.lix.systems/lix-project/lix?ref=main"; inputs.nixpkgs.follows = "nixpkgs"; }; - # uConsole CM5 hardware support (uses its own nixpkgs for module compatibility) - nixpkgs-uconsole.url = "github:nixos/nixpkgs/89dbf01"; # Matches nixos-uconsole's nixpkgs (2025-12-29) + # uConsole CM5 hardware support (uses nixos-25.05 for hardware.raspberry-pi support) + nixpkgs-uconsole.url = "github:nixos/nixpkgs/nixos-25.05"; nixos-uconsole = { url = "github:nixos-uconsole/nixos-uconsole"; inputs.nixpkgs.follows = "nixpkgs-uconsole"; @@ -97,7 +97,6 @@ nix.package = lix.packages."aarch64-linux".default; } nixos-uconsole.nixosModules.uconsole-cm5 - nixos-hardware.nixosModules.raspberry-pi-5 ./hosts/uconsole/configuration.nix ./hosts/uconsole/hardware-configuration.nix ]; -- 2.49.1 From bbfcc435345e57251436608f725e1484f6033d76 Mon Sep 17 00:00:00 2001 From: Hermes Agent Date: Wed, 29 Apr 2026 19:41:06 +0000 Subject: [PATCH 11/13] fix: use nixos-uconsole.kernel module only (uconsole-cm5 has broken deps) - uconsole-cm5 module requires hardware.raspberry-pi options that don't exist - Manual hardware config in flake.nix instead - Still uses uconsole kernel and nixpkgs-uconsole for package compatibility --- flake.nix | 13 ++++++++++++- hosts/uconsole/configuration.nix | 16 ++-------------- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/flake.nix b/flake.nix index b841a2a..63ea274 100644 --- a/flake.nix +++ b/flake.nix @@ -94,9 +94,20 @@ modules = [ { nixpkgs.config.allowUnfree = true; + nixpkgs.hostPlatform = "aarch64-linux"; nix.package = lix.packages."aarch64-linux".default; + + # Manual uConsole CM5 hardware setup (nixos-uconsole module has broken hardware.raspberry-pi deps) + # Display: 720x1280 landscape, panel on right side up + boot.kernelParams = [ + "video=DSI-1:720x1280M@60D,panel_orientation=right_side_up" + "console=tty1" + ]; + hardware.enableRedistributableFirmware = true; + hardware.graphics.enable = true; } - nixos-uconsole.nixosModules.uconsole-cm5 + # Use uconsole kernel module only (not the full uconsole-cm5 which has broken deps) + nixos-uconsole.nixosModules.kernel ./hosts/uconsole/configuration.nix ./hosts/uconsole/hardware-configuration.nix ]; diff --git a/hosts/uconsole/configuration.nix b/hosts/uconsole/configuration.nix index 24cbfeb..c7f09dc 100644 --- a/hosts/uconsole/configuration.nix +++ b/hosts/uconsole/configuration.nix @@ -2,20 +2,8 @@ { # --- CORE HARDWARE (CM5 / RPi5) --- - # nixos-uconsole.nixosModules.uconsole-cm5 imported in flake.nix - - uconsole = { - enable = true; - variant = "cm5"; # Hardware target: CM5/RPi5 - # Fixes the landscape orientation at boot - videoMode = "720x1280M@60D,panel_orientation=right_side_up"; - }; - - # Firmware for Wi-Fi and Bluetooth - hardware.enableRedistributableFirmware = true; - - # Enable GPU acceleration (VideoCore VII) - hardware.graphics.enable = true; + # Manual config in flake.nix (nixos-uconsole.nixosModules.kernel provides CM5 kernel) + # nixos-uconsole.nixosModules.uconsole-cm5 has broken hardware.raspberry-pi dependencies # --- BASIC HOST INFO --- networking.hostName = "uConsole"; -- 2.49.1 From 3bd4fcc1c698f2dfbe58dab6ae5342063a2b6ccd Mon Sep 17 00:00:00 2001 From: Hermes Agent Date: Wed, 29 Apr 2026 19:45:34 +0000 Subject: [PATCH 12/13] fix: add nixos-raspberrypi input for uConsole CM5 support - uconsole-cm5 module requires hardware.raspberry-pi options from nixos-raspberrypi - Import raspberry-pi-5.base before uconsole-cm5 module - Uses nixos-25.05 for both inputs (compatible versions) --- flake.nix | 22 ++++++++++------------ hosts/uconsole/configuration.nix | 3 +-- 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/flake.nix b/flake.nix index 63ea274..49b8465 100644 --- a/flake.nix +++ b/flake.nix @@ -12,12 +12,17 @@ url = "git+https://git.lix.systems/lix-project/lix?ref=main"; inputs.nixpkgs.follows = "nixpkgs"; }; - # uConsole CM5 hardware support (uses nixos-25.05 for hardware.raspberry-pi support) + # uConsole CM5 hardware support nixpkgs-uconsole.url = "github:nixos/nixpkgs/nixos-25.05"; nixos-uconsole = { url = "github:nixos-uconsole/nixos-uconsole"; inputs.nixpkgs.follows = "nixpkgs-uconsole"; }; + # nixos-raspberrypi provides hardware.raspberry-pi options that uconsole-cm5 needs + nixos-raspberrypi = { + url = "github:nvmd/nixos-raspberrypi/v1.20260317.0"; + inputs.nixpkgs.follows = "nixpkgs-uconsole"; + }; # Raspberry Pi 5 hardware support nixos-hardware.url = "github:nixos/nixos-hardware/master"; self.submodules = true; @@ -96,18 +101,11 @@ nixpkgs.config.allowUnfree = true; nixpkgs.hostPlatform = "aarch64-linux"; nix.package = lix.packages."aarch64-linux".default; - - # Manual uConsole CM5 hardware setup (nixos-uconsole module has broken hardware.raspberry-pi deps) - # Display: 720x1280 landscape, panel on right side up - boot.kernelParams = [ - "video=DSI-1:720x1280M@60D,panel_orientation=right_side_up" - "console=tty1" - ]; - hardware.enableRedistributableFirmware = true; - hardware.graphics.enable = true; } - # Use uconsole kernel module only (not the full uconsole-cm5 which has broken deps) - nixos-uconsole.nixosModules.kernel + # Raspberry Pi 5 base (provides hardware.raspberry-pi options) + nixos-raspberrypi.nixosModules.raspberry-pi-5.base + # uConsole CM5 hardware support (display, kernel, config) + nixos-uconsole.nixosModules.uconsole-cm5 ./hosts/uconsole/configuration.nix ./hosts/uconsole/hardware-configuration.nix ]; diff --git a/hosts/uconsole/configuration.nix b/hosts/uconsole/configuration.nix index c7f09dc..0dfe1c4 100644 --- a/hosts/uconsole/configuration.nix +++ b/hosts/uconsole/configuration.nix @@ -2,8 +2,7 @@ { # --- CORE HARDWARE (CM5 / RPi5) --- - # Manual config in flake.nix (nixos-uconsole.nixosModules.kernel provides CM5 kernel) - # nixos-uconsole.nixosModules.uconsole-cm5 has broken hardware.raspberry-pi dependencies + # nixos-raspberrypi.nixosModules.raspberry-pi-5.base + nixos-uconsole.nixosModules.uconsole-cm5 imported in flake.nix # --- BASIC HOST INFO --- networking.hostName = "uConsole"; -- 2.49.1 From ef97401f93720a8caf3bbb2e3ed93039e35f7078 Mon Sep 17 00:00:00 2001 From: Hermes Agent Date: Wed, 29 Apr 2026 19:46:07 +0000 Subject: [PATCH 13/13] fix: add nixos-raspberrypi to outputs --- flake.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index 49b8465..fe25ed7 100644 --- a/flake.nix +++ b/flake.nix @@ -28,7 +28,7 @@ self.submodules = true; }; - outputs = { self, nixpkgs, nixpkgs-uconsole, agenix, lix, nixos-uconsole, nixos-hardware, ... }@inputs: + outputs = { self, nixpkgs, nixpkgs-uconsole, agenix, lix, nixos-uconsole, nixos-raspberrypi, nixos-hardware, ... }@inputs: let system = "x86_64-linux"; keys = import ./lib/keys.nix; -- 2.49.1