From 19a487045045d21e2ea4c67e9e47b881a3430676 Mon Sep 17 00:00:00 2001 From: kenji Date: Sun, 15 Mar 2026 17:22:25 -0500 Subject: [PATCH] add(system): btop.nix gives more permission to btop (specifically for reading CPU power) --- modules/nixos/btop.nix | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 modules/nixos/btop.nix diff --git a/modules/nixos/btop.nix b/modules/nixos/btop.nix new file mode 100644 index 0000000..c4ed635 --- /dev/null +++ b/modules/nixos/btop.nix @@ -0,0 +1,15 @@ +{ pkgs, ... }: { + # Install btop system-wide with ROCm support for GPU monitoring. + environment.systemPackages = [ + (pkgs.btop.override { rocmSupport = true; }) + ]; + + # Create a security wrapper for btop to grant it capabilities + # to read CPU power information without running as root. + security.wrappers."btop-power" = { + source = "${pkgs.btop.override { rocmSupport = true; }}/bin/btop"; + owner = "root"; + group = "root"; + capabilities = "cap_dac_read_search,cap_sys_ptrace+ep"; + }; +}