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/web/chromium/assertions.nix | 10 ++++++++++ modules/web/chromium/default.nix | 1 + 2 files changed, 11 insertions(+) create mode 100644 modules/web/chromium/assertions.nix (limited to 'modules/web') diff --git a/modules/web/chromium/assertions.nix b/modules/web/chromium/assertions.nix new file mode 100644 index 0000000..465ebbd --- /dev/null +++ b/modules/web/chromium/assertions.nix @@ -0,0 +1,10 @@ +# Validates chromium sub-options require the main module to be enabled +{ config, ... }: +{ + assertions = [ + { + assertion = !config.web.chromium.useOpenGL || config.web.chromium.enable; + message = "web.chromium.useOpenGL requires web.chromium.enable."; + } + ]; +} diff --git a/modules/web/chromium/default.nix b/modules/web/chromium/default.nix index 7901ad6..1e3608c 100644 --- a/modules/web/chromium/default.nix +++ b/modules/web/chromium/default.nix @@ -6,6 +6,7 @@ }: { imports = [ + ./assertions.nix ./browserpass.nix ./extensions ]; -- cgit v1.2.3