wrappers/standalone: make pkgs arg optional, allow specifying system

This commit is contained in:
Matt Sturgeon 2024-12-23 14:44:23 +00:00
parent 8c6f9ed8c4
commit 9bf4c9d55b
No known key found for this signature in database
GPG key ID: 4F91844CED1A8299
4 changed files with 44 additions and 17 deletions

View file

@ -30,7 +30,8 @@ let
mkTestDerivationFromNixvimModule =
{
name ? null,
pkgs ? defaultPkgs,
pkgs ? null,
system ? defaultPkgs.stdenv.hostPlatform.system,
module,
extraSpecialArgs ? { },
}:
@ -42,14 +43,18 @@ let
_nixvimTests = true;
};
systemMod =
if pkgs == null then
{ nixpkgs.hostPlatform = lib.mkDefault { inherit system; }; }
else
{ nixpkgs.pkgs = lib.mkDefault pkgs; };
result = helpers.modules.evalNixvim {
modules = [
module
(lib.optionalAttrs (name != null) { test.name = name; })
{ wrapRc = true; }
# TODO: Only do this when `args?pkgs`
# Consider deprecating the `pkgs` arg too...
{ nixpkgs.pkgs = lib.mkDefault pkgs; }
systemMod
];
inherit extraSpecialArgs;
};