chore(aquamarine): use NixOS's NPU module with nixos-unstable-small (#527)

* chore(aquamarine): take the NPU stack from nixos-unstable-small
* refactor(aquamarine): load the NPU driver via hardware.cpu.intel.npu

Assisted-by: DeepSeek Harness (claude-opus-5-5)
This commit is contained in:
ryan4yin | 二花 authored and GitHub committed 2026-11-11 19:59:51 +08:00
1 parent d5ee0b1699
commit 093f3ad81a
7 files changed
+39 -46

No files matched your search

+4 -7
View File
@@ -3,7 +3,7 @@
mylib,
myvars,
pkgs,
pkgs-npu,
pkgs-small,
...
}:
let
@@ -52,9 +52,9 @@ let
'';
# openvino-genai 2026.4.0.0 fails to compile against the OpenVINO headers in
# nixos-unstable (no matching constructor in continuous_batching); the branch's
# nixpkgs builds it, and the service has to match the NPU stack anyway.
pythonEnv = pkgs-npu.python3.withPackages (ps: [
# nixos-unstable (no matching constructor in continuous_batching); the
# service takes it from the same nixpkgs as the NPU stack.
pythonEnv = pkgs-small.python3.withPackages (ps: [
ps.fastapi
ps.numpy
ps.openvino-genai
@@ -90,9 +90,6 @@ in
# Python block-buffers stdout when it is not a tty, which would hold the
# request log lines back instead of putting them in the journal.
PYTHONUNBUFFERED = "1";
# The stock driver cannot find the NPU compiler; the patched one loads it
# from its own store path.
ZE_ENABLE_ALT_DRIVERS = "${lib.getLib pkgs-npu.intel-npu-driver}/lib/libze_intel_npu.so";
};
# Reads its model, writes its cache, uses the NPU and listens on the LAN.
-9
View File
@@ -1,8 +1,6 @@
{
disko,
myvars,
lib,
pkgs-npu,
...
}:
#############################################################
@@ -71,13 +69,6 @@ in
# profile's rootless Podman (modules/nixos/agent.nix), built from the `~/src`
# checkout that ./preservation.nix keeps.
# Speech recognition runs on the NPU, see ./asr.nix. The driver and the
# compiler it loads come from NixOS/nixpkgs#570230, which is unmerged, so they
# are taken from that branch as `pkgs-npu`; the stock driver cannot find the
# compiler, the patched one loads it from its own store path. The service sets
# this itself -- the session variable is for manual runs.
environment.sessionVariables.ZE_ENABLE_ALT_DRIVERS = "${lib.getLib pkgs-npu.intel-npu-driver}/lib/libze_intel_npu.so";
# The daemons of the hosts that build here (modules/nixos/base/remote-builders.nix).
# Their host keys have no passphrase, so they only get the daemon protocol, as
# nix.sshServe does. `--store daemon` hands builds to the system daemon instead
@@ -1,8 +1,14 @@
{
pkgs,
pkgs-small,
...
}:
{
# The NPU serves ./asr.nix; the driver's compiler lookup is fixed by
# NixOS/nixpkgs#570230, which reached nixos-unstable-small first (WA-037).
hardware.cpu.intel.npu.enable = true;
nixpkgs.overlays = [ (_: _: { inherit (pkgs-small) intel-npu-driver; }) ];
# Ad-hoc CPU idle-power diagnostics: package power, C-state residency and
# wakeup attribution. Long-term RAPL export lives in the shared
# modules/nixos/base/power-monitoring.nix module.