feat(hw): #58 nomarchy-detect-hw post-install re-probe CLI
All checks were successful
Check / eval (push) Successful in 2m52s
All checks were successful
Check / eval (push) Successful in 2m52s
Package the installer’s pure hardware-db probe as nomarchy-detect-hw: prints suggested hardwareProfile and system.nix snippets (or --raw protocol lines). Does not rewrite the flake. On PATH via the distro module; docs/HARDWARE.md §8 updated. Close #58. Verified: V1 (build + run on AMD laptop with fingerprint/NPU/IR cam).
This commit is contained in:
43
pkgs/nomarchy-detect-hw/default.nix
Normal file
43
pkgs/nomarchy-detect-hw/default.nix
Normal file
@@ -0,0 +1,43 @@
|
||||
# Post-install hardware re-probe (BACKLOG #58 / HARDWARE.md §8).
|
||||
# Same pure nomarchy_detect_hw protocol as the installer; prints suggested
|
||||
# hardwareProfile + system.nix snippets. Never rewrites the flake.
|
||||
{ lib
|
||||
, stdenvNoCC
|
||||
, makeWrapper
|
||||
, bash
|
||||
, coreutils
|
||||
, pciutils
|
||||
, usbutils
|
||||
, util-linux
|
||||
}:
|
||||
|
||||
stdenvNoCC.mkDerivation {
|
||||
pname = "nomarchy-detect-hw";
|
||||
version = "0.1.0";
|
||||
|
||||
src = ./.;
|
||||
|
||||
nativeBuildInputs = [ makeWrapper ];
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
share=$out/share/nomarchy-detect-hw
|
||||
install -Dm644 ${../nomarchy-install/hardware-db.sh} "$share/hardware-db.sh"
|
||||
install -Dm755 nomarchy-detect-hw.sh $out/bin/nomarchy-detect-hw
|
||||
patchShebangs $out/bin/nomarchy-detect-hw
|
||||
|
||||
wrapProgram $out/bin/nomarchy-detect-hw \
|
||||
--prefix PATH : ${lib.makeBinPath [ bash coreutils pciutils usbutils util-linux ]} \
|
||||
--set NOMARCHY_DETECT_HW_SHARE "$share"
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
meta = {
|
||||
description = "Probe hardware and print Nomarchy hardwareProfile / system.nix suggestions";
|
||||
license = lib.licenses.mit;
|
||||
mainProgram = "nomarchy-detect-hw";
|
||||
platforms = lib.platforms.linux;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user