From ac60dc343b63c536a202d1d3794461c6bf6b6f17 Mon Sep 17 00:00:00 2001 From: moons Date: Sat, 12 Sep 2026 19:29:27 +0900 Subject: [PATCH] nanokvm usb --- AGENTS.md | 3 ++- modules/applications/nanokvm-usb/meta.nix | 5 ++++ modules/applications/nanokvm-usb/nixos.nix | 23 +++++++++++++++++++ modules/profiles/README.md | 5 ++-- .../profiles/workload/network-lab/meta.nix | 7 ++++-- modules/services/nanokvm-usb/nixos.nix | 4 ++++ 6 files changed, 42 insertions(+), 5 deletions(-) create mode 100644 modules/applications/nanokvm-usb/meta.nix create mode 100644 modules/applications/nanokvm-usb/nixos.nix create mode 100644 modules/services/nanokvm-usb/nixos.nix diff --git a/AGENTS.md b/AGENTS.md index 0ebcff8..731349a 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -695,7 +695,8 @@ uses dedicated NixOS partitions, LUKS, Secure Boot, and TPM-backed disk unlock. It selects `workload.photography` for AI-enabled darktable. The application chooses CUDA support from the NVIDIA hardware unit's enable state and keeps the default CUDA targets, including RTX 3060 Ti support, to reuse binary caches. -galleria and x1g13 select `workload.network-lab` for containerlab and Docker. +galleria and x1g13 select `workload.network-lab` for containerlab, Docker, and +the NanoKVM-USB desktop client with serial-port access. m2 is the daily-use macOS development and personal machine with the macOS interface defaults. Keep the desktop sessions independently selectable, and keep the development and personal profiles usable across NixOS and Darwin. diff --git a/modules/applications/nanokvm-usb/meta.nix b/modules/applications/nanokvm-usb/meta.nix new file mode 100644 index 0000000..65a789a --- /dev/null +++ b/modules/applications/nanokvm-usb/meta.nix @@ -0,0 +1,5 @@ +{ + description = "Sipeed NanoKVM-USB desktop client"; + + includes = [ "services.nanokvm-usb" ]; +} diff --git a/modules/applications/nanokvm-usb/nixos.nix b/modules/applications/nanokvm-usb/nixos.nix new file mode 100644 index 0000000..446a725 --- /dev/null +++ b/modules/applications/nanokvm-usb/nixos.nix @@ -0,0 +1,23 @@ +{ pkgs, ... }: +let + nanokvm-usb = pkgs.appimageTools.wrapType2 rec { + pname = "nanokvm-usb"; + version = "1.1.4"; + + src = pkgs.fetchurl { + url = "https://github.com/sipeed/NanoKVM-USB/releases/download/v${version}/NanoKVM-USB-${version}-linux-x86_64.AppImage"; + hash = "sha256-00MT4U2afv0qt3xFVhLr0SSmS2cLrKBlmfzqYEFuaVc="; + }; + + meta = { + description = "Sipeed NanoKVM-USB desktop client"; + homepage = "https://github.com/sipeed/NanoKVM-USB"; + license = pkgs.lib.licenses.gpl3Only; + platforms = [ "x86_64-linux" ]; + mainProgram = "nanokvm-usb"; + }; + }; +in +{ + environment.systemPackages = [ nanokvm-usb ]; +} diff --git a/modules/profiles/README.md b/modules/profiles/README.md index f46bd93..ca5e404 100644 --- a/modules/profiles/README.md +++ b/modules/profiles/README.md @@ -75,8 +75,9 @@ Neovim, Yazi, and the remaining interactive command-line tools. `workload.machine-learning` provides the Hugging Face Hub CLI for hosts used to download and publish machine learning models and datasets. -`workload.network-lab` provides containerlab using its upstream NixOS module -and the Docker service. It is selected by galleria and x1g13. +`workload.network-lab` provides containerlab using its upstream NixOS module, +the Docker service, and the NanoKVM-USB desktop client with serial-port access. +It is selected by galleria and x1g13. `workload.photography` provides darktable with AI support from the locked unstable package set. Its ONNX Runtime uses CUDA when the NVIDIA hardware unit diff --git a/modules/profiles/workload/network-lab/meta.nix b/modules/profiles/workload/network-lab/meta.nix index 7264d6d..731b913 100644 --- a/modules/profiles/workload/network-lab/meta.nix +++ b/modules/profiles/workload/network-lab/meta.nix @@ -1,5 +1,8 @@ { - description = "Container-based network lab environment"; + description = "Network lab and hardware console environment"; - includes = [ "applications.containerlab" ]; + includes = [ + "applications.containerlab" + "applications.nanokvm-usb" + ]; } diff --git a/modules/services/nanokvm-usb/nixos.nix b/modules/services/nanokvm-usb/nixos.nix new file mode 100644 index 0000000..9cfd8e8 --- /dev/null +++ b/modules/services/nanokvm-usb/nixos.nix @@ -0,0 +1,4 @@ +{ primaryUser, ... }: +{ + users.users.${primaryUser}.extraGroups = [ "dialout" ]; +}