mirror of
https://github.com/nix-community/nixvim.git
synced 2025-07-22 03:35:21 +02:00
lib/deprecation: implement aliases for mkRemovedPackageOptionModule
Allows most existing configs to continue building, now with warnings instead of assertions when the old `plugins.*.*Package` options are used. An assertion will still occur if there is a merge conflict, e.g: `plugins.a.fooPackage = null` and `plugins.b.fooPackage = pkgs.foo`.
This commit is contained in:
parent
ee9655637c
commit
d94956e5da
2 changed files with 93 additions and 10 deletions
|
@ -47,4 +47,48 @@
|
|||
))
|
||||
];
|
||||
};
|
||||
|
||||
# Integration test for `lib.nixvim.deprecation.mkRemovedPackageOptionModule`
|
||||
removed-package-options =
|
||||
{
|
||||
lib,
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
{
|
||||
test = {
|
||||
buildNixvim = false;
|
||||
warnings = expect: [
|
||||
(expect "count" 2)
|
||||
|
||||
(expect "any" "The option `plugins.chatgpt.curlPackage' defined in `")
|
||||
(expect "any" "has been replaced by `dependencies.curl.enable' and `dependencies.curl.package'.")
|
||||
|
||||
(expect "any" "The option `plugins.glow.glowPackage' defined in `")
|
||||
];
|
||||
};
|
||||
|
||||
plugins.chatgpt.curlPackage = null;
|
||||
plugins.glow.glowPackage = pkgs.hello;
|
||||
|
||||
assertions = [
|
||||
{
|
||||
assertion = !lib.elem pkgs.curl config.extraPackages;
|
||||
message = "Expected curl not to be installed.";
|
||||
}
|
||||
{
|
||||
assertion = config.dependencies.glow.enable;
|
||||
message = "Expected `dependencies.glow` to be enabled.";
|
||||
}
|
||||
{
|
||||
assertion = lib.elem pkgs.hello config.extraPackages;
|
||||
message = "Expected hello to be installed.";
|
||||
}
|
||||
{
|
||||
assertion = !lib.elem pkgs.glow config.extraPackages;
|
||||
message = "Expected glow not to be installed.";
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue