feat: assert on broken/unsupported config structures

This commit is contained in:
NotAShelf 2023-04-02 19:58:13 +03:00
parent 7b5b7bfcce
commit 7ee66ea376
No known key found for this signature in database
GPG key ID: F0D14CCB5ED5AA22
3 changed files with 29 additions and 0 deletions

16
lib/assertions.nix Normal file
View file

@ -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";
}
];
}

View file

@ -2,4 +2,8 @@
dag = import ./dag.nix {inherit lib;};
booleans = import ./booleans.nix {inherit lib;};
types = import ./types {inherit lib;};
imports = [
./assertions.nix
];
}

View file

@ -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.";
}
];
};
}