DieracDelta / nix-btm

MIT License
2 stars 0 forks source link

feat request: cgroups support? #17

Open qwqawawow opened 3 months ago

qwqawawow commented 3 months ago

Hi,thank you for your great work!

It looks like cgroups aren't supported yet?

related configuration

nix.settings.experimental-features = ["nix-command" "flakes" "auto-allocate-uids" "cgroups" ];

There is no nixbld users on my machine and NIX BUILDERS LIST is empty.

As the same time, try to switch build users.

thread 'main' panicked at crates/client/src/event_loop.rs:61:66:
index out of bounds: the len is 0 but the index is 0
stack backtrace:
   0: rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::panicking::panic_bounds_check
   3: nix_btm::event_loop::event_loop
   4: nix_btm::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
Aborted
DieracDelta commented 3 months ago

Thanks for the bug report!

I haven't used the cgroups feature before. A hacky fix is probably querying the cgroups using something like this. But, morally speaking, this is kind of cursed from a permissions perspective. It already seems wrong that we have to run as root to monitor nix.

I'd like to be able to grab this information in an unpermissioned way directly from the nix daemon and/or cli. Exposing an endpoint to do this seems clean. However, I'm operating on limited bandwidth so this will probably take a while