From bd61b1375a7b7e4702f7ae6ff78210f34bf86ef4 Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Sun, 4 Jun 2023 09:39:17 +0300 Subject: [PATCH] feat: assert failing conditions --- modules/assertions.nix | 30 ++++++++++++++++++------------ modules/default.nix | 1 + 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/modules/assertions.nix b/modules/assertions.nix index fe55eba..3236efa 100644 --- a/modules/assertions.nix +++ b/modules/assertions.nix @@ -6,16 +6,22 @@ with lib; let cfg = config.vim; in { - assertions = mkMerge [ - { - assertion = cfg.kommentary.enable; - message = "Kommentary has been deprecated in favor of comments-nvim"; - } - mkIf - (config.programs.neovim-flake.enable) - { - assertion = !config.programs.neovim.enable; - message = "You cannot use `programs.neovim-flake.enable` with `programs.neovim.enable`"; - } - ]; + config = { + assertions = mkMerge [ + { + assertion = cfg.kommentary.enable; + message = "Kommentary has been deprecated in favor of comments-nvim"; + } + { + assertion = cfg.utility.colorizer.enable; + message = "config.utility.colorizer has been renamed to config.utility.ccc"; + } + mkIf + (config.programs.neovim-flake.enable) + { + assertion = !config.programs.neovim.enable; + message = "You cannot use `programs.neovim-flake.enable` with `programs.neovim.enable`"; + } + ]; + }; } diff --git a/modules/default.nix b/modules/default.nix index 34d6212..f7abc9e 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -66,6 +66,7 @@ inputs: { }; }; in { + imports = [./assertions.nix]; inherit (module) options config; inherit (module._module.args) pkgs; inherit neovim;