mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-20 16:15:43 +02:00
wrappers/standalone: make pkgs
arg optional, allow specifying system
This commit is contained in:
parent
8c6f9ed8c4
commit
9bf4c9d55b
4 changed files with 44 additions and 17 deletions
|
@ -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;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue