From f36491c92269d3e1dd241e67c292af762ac498c3 Mon Sep 17 00:00:00 2001 From: Arpit Chakladar Date: Thu, 24 Sep 2026 19:16:14 +0530 Subject: refactor: some more minor refactoring --- modules/system/btop/assertions.nix | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'modules/system/btop/assertions.nix') diff --git a/modules/system/btop/assertions.nix b/modules/system/btop/assertions.nix index 82cddc3..8ac7ccb 100644 --- a/modules/system/btop/assertions.nix +++ b/modules/system/btop/assertions.nix @@ -1,13 +1,16 @@ # Validates btop sub-options require the main module to be enabled { config, ... }: +let + cfg = config.system.btop; +in { assertions = [ { - assertion = !config.system.btop.nvidia.enable || config.system.btop.enable; + assertion = !cfg.nvidia.enable || cfg.enable; message = "system.btop.nvidia.enable requires system.btop.enable."; } { - assertion = !config.system.btop.amd.enable || config.system.btop.enable; + assertion = !cfg.amd.enable || cfg.enable; message = "system.btop.amd.enable requires system.btop.enable."; } ]; -- cgit v1.2.3