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/office | |
| 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/office')
| -rw-r--r-- | modules/office/calcurse/assertions.nix | 10 | ||||
| -rw-r--r-- | modules/office/calcurse/default.nix | 2 |
2 files changed, 12 insertions, 0 deletions
diff --git a/modules/office/calcurse/assertions.nix b/modules/office/calcurse/assertions.nix new file mode 100644 index 0000000..65805fe --- /dev/null +++ b/modules/office/calcurse/assertions.nix @@ -0,0 +1,10 @@ +# Validates calcurse sub-options require the main module to be enabled +{ config, ... }: +{ + assertions = [ + { + assertion = !config.office.calcurse.sync.enable || config.office.calcurse.enable; + message = "office.calcurse.sync.enable requires office.calcurse.enable."; + } + ]; +} diff --git a/modules/office/calcurse/default.nix b/modules/office/calcurse/default.nix index 2b0a19f..90e4699 100644 --- a/modules/office/calcurse/default.nix +++ b/modules/office/calcurse/default.nix @@ -41,6 +41,8 @@ let }; in { + imports = [ ./assertions.nix ]; + options.office.calcurse = { enable = lib.mkEnableOption "Enables calcurse."; package = lib.mkOption { |
