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/desktop | |
| 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/desktop')
| -rw-r--r-- | modules/desktop/niri/assertions.nix | 14 | ||||
| -rw-r--r-- | modules/desktop/niri/default.nix | 5 |
2 files changed, 18 insertions, 1 deletions
diff --git a/modules/desktop/niri/assertions.nix b/modules/desktop/niri/assertions.nix new file mode 100644 index 0000000..99e9d29 --- /dev/null +++ b/modules/desktop/niri/assertions.nix @@ -0,0 +1,14 @@ +# Validates niri hardware GPU options require desktop to be enabled +{ config, ... }: +{ + assertions = [ + { + assertion = !config.desktop.hardware.gpu.nvidia.enable || config.desktop.enable; + message = "desktop.hardware.gpu.nvidia.enable requires desktop.enable."; + } + { + assertion = !config.desktop.hardware.gpu.amd.enable || config.desktop.enable; + message = "desktop.hardware.gpu.amd.enable requires desktop.enable."; + } + ]; +} diff --git a/modules/desktop/niri/default.nix b/modules/desktop/niri/default.nix index 9b0b160..a5de8d8 100644 --- a/modules/desktop/niri/default.nix +++ b/modules/desktop/niri/default.nix @@ -9,7 +9,10 @@ let base16Colors = import ../../colors/base16 { inherit config lib pkgs; }; in { - imports = [ ./keybindings.nix ]; + imports = [ + ./keybindings.nix + ./assertions.nix + ]; options.desktop = { niri.package = lib.mkOption { |
