diff options
| author | Arpit Chakladar <arpitchakladar@gmail.com> | 2026-09-20 04:15:53 +0530 |
|---|---|---|
| committer | Arpit Chakladar <arpitchakladar@gmail.com> | 2026-09-20 04:15:53 +0530 |
| commit | daea646972aa03ce8e58bff2edaed16bf7fbf9db (patch) | |
| tree | 0f0ee033422e456b14b3e012ca8b1a490b77de15 /modules/system/btop | |
| parent | fb442560064f98ee850c71d78330b9b3abda4774 (diff) | |
| download | home-manager-config-daea646972aa03ce8e58bff2edaed16bf7fbf9db.tar.gz home-manager-config-daea646972aa03ce8e58bff2edaed16bf7fbf9db.zip | |
chore: added better assertions for options for submodules
Now setting options for submodules requires the submodule to be enabled
first.
Diffstat (limited to 'modules/system/btop')
| -rw-r--r-- | modules/system/btop/assertions.nix | 14 | ||||
| -rw-r--r-- | modules/system/btop/default.nix | 2 |
2 files changed, 16 insertions, 0 deletions
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."; + } + ]; +} diff --git a/modules/system/btop/default.nix b/modules/system/btop/default.nix index 40f878f..4f84036 100644 --- a/modules/system/btop/default.nix +++ b/modules/system/btop/default.nix @@ -6,6 +6,8 @@ ... }: { + imports = [ ./assertions.nix ]; + options.system.btop = { enable = lib.mkEnableOption "Enables btop."; nvidia.enable = lib.mkEnableOption "Build btop with NVIDIA GPU monitoring support (CUDA)."; |
