diff --git a/lib/assertions.nix b/lib/assertions.nix new file mode 100644 index 00000000..49ea8acd --- /dev/null +++ b/lib/assertions.nix @@ -0,0 +1,16 @@ +{ + pkgs, + config, + lib, + ... +}: +with lib; let + cfg = config.vim; +in { + assertions = mkMerge [ + { + assertion = cfg.kommentary.enable; + message = "Kommentary has been deprecated in favor"; + } + ]; +} diff --git a/lib/default.nix b/lib/default.nix index 873f31bc..bf12f0da 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -2,4 +2,8 @@ dag = import ./dag.nix {inherit lib;}; booleans = import ./booleans.nix {inherit lib;}; types = import ./types {inherit lib;}; + + imports = [ + ./assertions.nix + ]; } diff --git a/lib/module/default.nix b/lib/module/default.nix index 7689aef8..77e47329 100644 --- a/lib/module/default.nix +++ b/lib/module/default.nix @@ -45,5 +45,14 @@ in { config = mkIf cfg.enable { home.packages = [set.neovim]; + + assertions = mkMerge [ + mkIf + (config.programs.neovim-flake.enable) + { + assertion = !config.programs.neovim.enable; + message = "You cannot use neovim-flake together with vanilla neovim."; + } + ]; }; }