repositories

NixDaemon

NixOS pentest workstation as one flake — IceBreaker's successor

clonegit clone https://git.daemon-sec.xyz/NixDaemon.git

0 folders · 9 files · 10.4 KiB

NameTypeSize
..parent folder
99-cpu-freq-cap.confConfig234 B
fan-ctlfile2.3 KiB
fan-statefile3.4 KiB
fanfix-fan.servicefile341 B
fanfix.confConfig150 B
modules-load.confConfig25 B
motherboard-stability.servicefile679 B
README.mdMarkdown3.2 KiB
uniwill-laptop.confConfig31 B

README.md

open document

fan/ — the throttle fix, as captured and as declared#

Slot: hosts/laptop/fan-throttle-guard.nix (import it from hosts/laptop/default.nix).

What is in here#

File Origin on the Arch install Role
fan-throttle-guard.nix written this pass the whole fix as one NixOS module
fanfix ~/.local/bin/fanfix CLI + fan-curve daemon (bash, 372 lines)
stability_guard.py /usr/local/lib/motherboardctl/stability_guard.py staged ceiling 3200/2400/1800 MHz
99-cpu-freq-cap.conf /etc/tmpfiles.d/ the static floor as it is today
fanfix.conf /etc/fanfix.conf CURVE="0:60 100:60"
fanfix-fan.service, motherboard-stability.service /etc/systemd/system/ the two units, verbatim
modules-load.conf, uniwill-laptop.conf /etc/modules-load.d/, /etc/modprobe.d/ module load + force=1
fan-ctl, fan-state bar plugin daemon-sec.fans/bin/ pkexec dispatcher and the read-only poller the widget uses

Measured state at capture (2026-10-07 15:21 BST, idle, mains)#

scaling_max_freq 3200000  scaling_min 1121095  cpuinfo_max 5169491  boost 1
governor performance  driver amd-pstate-epp (status active)  profile performance
k10temp Tctl 38 °C · uniwill fan1 4347 rpm pwm1 255 · fan2 0 rpm pwm2 255 · board temp2 37 °C
amdgpu package 7 W · RTX 3070 Ti 37 °C, 20 W, 16 % util (nvidia-smi fan [N/A])
motherboard-stability: active (limit 3200, stage 0, "mains power; normal temperatures")
fanfix-fan.service: enabled but stopped at 15:08 today; EC commanding both fans 100 %

Things that change on NixOS (read before enabling)#

  • fanfix install / uninstall and fan-ctl cap / uncap write /etc/tmpfiles.d imperatively. On NixOS the floor is the systemd.tmpfiles.rules line in the module; treat install/cap as a no-op and change capKhz instead. uncap still works at runtime but the guard re-applies 3200 MHz within a second, so stop motherboard-stability.service first if an uncapped run is wanted.
  • fanfix fan setup has an Arch-only package-install branch. Dead code on NixOS; the module supplies linuxPackages.acpi_call. Do not run fan setup.
  • fanfix elevates with sudo inside need_root; fan-ctl expects to be launched by pkexec from a bar widget. Both need a polkit agent in the session. Which shell provides it is an open question in the capture note.
  • stability_guard.py hard-fails unless exactly 16 cpufreq policies exist and /sys/class/power_supply/AC0/online is the mains sensor. Same hardware, so fine, but check the power-supply name on the NixOS kernel.
  • fanfix status false-negatives on the latched low-temperature clamp (its detector is temperature-gated). Trust /proc/cpuinfo "cpu MHz" vs scaling_min_freq: cores below the kernel floor = EC clamp.
  • Never set the global cpufreq boost to 0 (see module header).

First-boot verification#

fanfix status            # cap 3200 MHz · boost 1 · profile performance · fan line present
sudo fanfix fan status   # fan-abnormal=1 is expected; universal-fan-ctrl / custom-tables show which EC path is live
fanfix test 30           # all-core stress: expect 0 throttle events, peak < 75 °C
systemctl status motherboard-stability fanfix-fan