diff options
Diffstat (limited to 'modules/system')
| -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)."; |
