feat: assert failing conditions

This commit is contained in:
NotAShelf 2023-06-04 09:39:17 +03:00
parent f1f4b80c59
commit bd61b1375a
No known key found for this signature in database
GPG key ID: F0D14CCB5ED5AA22
2 changed files with 19 additions and 12 deletions

View file

@ -6,11 +6,16 @@
with lib; let with lib; let
cfg = config.vim; cfg = config.vim;
in { in {
config = {
assertions = mkMerge [ assertions = mkMerge [
{ {
assertion = cfg.kommentary.enable; assertion = cfg.kommentary.enable;
message = "Kommentary has been deprecated in favor of comments-nvim"; 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 mkIf
(config.programs.neovim-flake.enable) (config.programs.neovim-flake.enable)
{ {
@ -18,4 +23,5 @@ in {
message = "You cannot use `programs.neovim-flake.enable` with `programs.neovim.enable`"; message = "You cannot use `programs.neovim-flake.enable` with `programs.neovim.enable`";
} }
]; ];
};
} }

View file

@ -66,6 +66,7 @@ inputs: {
}; };
}; };
in { in {
imports = [./assertions.nix];
inherit (module) options config; inherit (module) options config;
inherit (module._module.args) pkgs; inherit (module._module.args) pkgs;
inherit neovim; inherit neovim;