mirror of
https://github.com/NotAShelf/neovim-flake.git
synced 2024-12-19 10:59:49 +01:00
feat: assert on broken/unsupported config structures
This commit is contained in:
parent
7b5b7bfcce
commit
7ee66ea376
3 changed files with 29 additions and 0 deletions
16
lib/assertions.nix
Normal file
16
lib/assertions.nix
Normal 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";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
|
@ -2,4 +2,8 @@
|
||||||
dag = import ./dag.nix {inherit lib;};
|
dag = import ./dag.nix {inherit lib;};
|
||||||
booleans = import ./booleans.nix {inherit lib;};
|
booleans = import ./booleans.nix {inherit lib;};
|
||||||
types = import ./types {inherit lib;};
|
types = import ./types {inherit lib;};
|
||||||
|
|
||||||
|
imports = [
|
||||||
|
./assertions.nix
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,5 +45,14 @@ in {
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
home.packages = [set.neovim];
|
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.";
|
||||||
|
}
|
||||||
|
];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue