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
|
@ -1,8 +1,13 @@
|
|||
default_pkgs: self:
|
||||
{
|
||||
self,
|
||||
lib,
|
||||
defaultSystem,
|
||||
}:
|
||||
{
|
||||
# TODO: Deprecate this arg in favour of using module options
|
||||
pkgs ? default_pkgs,
|
||||
lib ? pkgs.lib,
|
||||
pkgs ? null,
|
||||
# NOTE: `defaultSystem` is the only reason this function can't go in `<nixvim>.lib`
|
||||
system ? defaultSystem,
|
||||
extraSpecialArgs ? { },
|
||||
_nixvimTests ? false,
|
||||
module,
|
||||
|
@ -12,23 +17,32 @@ let
|
|||
helpers = self.lib.nixvim.override { inherit _nixvimTests; };
|
||||
inherit (helpers.modules) evalNixvim;
|
||||
|
||||
systemMod =
|
||||
if pkgs == null then
|
||||
{
|
||||
_file = ./standalone.nix;
|
||||
nixpkgs.hostPlatform = lib.mkDefault { inherit system; };
|
||||
}
|
||||
else
|
||||
{
|
||||
_file = ./standalone.nix;
|
||||
nixpkgs.pkgs = lib.mkDefault pkgs;
|
||||
};
|
||||
|
||||
mkNvim =
|
||||
mod:
|
||||
let
|
||||
nixvimConfig = evalNixvim {
|
||||
modules = [
|
||||
mod
|
||||
# TODO: only include this when `args?pkgs`:
|
||||
{
|
||||
_file = ./standalone.nix;
|
||||
nixpkgs.pkgs = lib.mkDefault pkgs;
|
||||
}
|
||||
systemMod
|
||||
];
|
||||
inherit extraSpecialArgs;
|
||||
};
|
||||
inherit (nixvimConfig.config) enableMan build;
|
||||
inherit (nixvimConfig._module.args.pkgs) symlinkJoin;
|
||||
in
|
||||
(pkgs.symlinkJoin {
|
||||
(symlinkJoin {
|
||||
name = "nixvim";
|
||||
paths = [
|
||||
build.package
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue