From daea646972aa03ce8e58bff2edaed16bf7fbf9db Mon Sep 17 00:00:00 2001 From: Arpit Chakladar Date: Sun, 20 Sep 2026 04:15:53 +0530 Subject: chore: added better assertions for options for submodules Now setting options for submodules requires the submodule to be enabled first. --- modules/system/btop/assertions.nix | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 modules/system/btop/assertions.nix (limited to 'modules/system/btop/assertions.nix') diff --git a/modules/system/btop/assertions.nix b/modules/system/btop/assertions.nix new file mode 100644 index 0000000..82cddc3 --- /dev/null +++ b/modules/system/btop/assertions.nix @@ -0,0 +1,14 @@ +# Validates btop sub-options require the main module to be enabled +{ config, ... }: +{ + assertions = [ + { + assertion = !config.system.btop.nvidia.enable || config.system.btop.enable; + message = "system.btop.nvidia.enable requires system.btop.enable."; + } + { + assertion = !config.system.btop.amd.enable || config.system.btop.enable; + message = "system.btop.amd.enable requires system.btop.enable."; + } + ]; +} -- cgit v1.2.3