refactor: add SystemStats singleton + nova-stats daemon for cpu/mem polling

This commit is contained in:
Damocles 2026-04-15 02:10:45 +02:00
parent 71a843e0f3
commit 136ff53cb5
13 changed files with 371 additions and 196 deletions

View file

@ -202,7 +202,8 @@ in
pkgs.nerd-fonts.symbols-only
]
++ lib.optional cfg.modules.weather.enable pkgs.wttrbar
++ lib.optional cfg.modules.mpris.enable pkgs.cava;
++ lib.optional cfg.modules.mpris.enable pkgs.cava
++ lib.optional cfg.modules.disk.enable pkgs.coreutils;
xdg.configFile."nova-shell/modules.json".source =
(pkgs.formats.json { }).generate "nova-shell-modules.json"

View file

@ -4,6 +4,7 @@
makeWrapper,
quickshell,
qt6,
nova-stats,
}:
stdenvNoCC.mkDerivation {
pname = "nova-shell";
@ -32,7 +33,8 @@ stdenvNoCC.mkDerivation {
mkdir -p $out/bin
makeWrapper ${lib.getExe quickshell} $out/bin/nova-shell \
--add-flags "-p $out/share/nova-shell/shell.qml"
--add-flags "-p $out/share/nova-shell/shell.qml" \
--prefix PATH : ${lib.makeBinPath [ nova-stats ]}
runHook postInstall
'';

12
nix/stats-daemon.nix Normal file
View file

@ -0,0 +1,12 @@
{ lib, rustPlatform }:
rustPlatform.buildRustPackage {
pname = "nova-stats";
version = "0.1.0";
src = lib.cleanSource ../stats-daemon;
cargoLock.lockFile = ../stats-daemon/Cargo.lock;
meta = {
description = "System stats daemon for nova-shell";
mainProgram = "nova-stats";
platforms = lib.platforms.linux;
};
}