feat: Package definition
This commit is contained in:
parent
1c57dc347b
commit
4cbe791f22
1 changed files with 65 additions and 0 deletions
65
packages/lixyvim/default.nix
Normal file
65
packages/lixyvim/default.nix
Normal file
|
@ -0,0 +1,65 @@
|
|||
{ lib
|
||||
, pkgs
|
||||
, inputs
|
||||
, neovim-settings ? { }
|
||||
, neovim-config ? { }
|
||||
, ...
|
||||
}:
|
||||
let
|
||||
raw-modules = lib.snowfall.fs.get-default-nix-files-recursive (
|
||||
lib.snowfall.fs.get-file "/modules/nixvim"
|
||||
);
|
||||
|
||||
wrapped-modules = builtins.map
|
||||
(
|
||||
raw-module:
|
||||
args@{ ... }:
|
||||
let
|
||||
module = import raw-module;
|
||||
result =
|
||||
if builtins.isFunction module then
|
||||
module
|
||||
(
|
||||
args
|
||||
// {
|
||||
# NOTE: nixvim doesn't allow for these to be customized so we must work around the
|
||||
# module system here...
|
||||
inherit lib pkgs;
|
||||
}
|
||||
)
|
||||
else
|
||||
module;
|
||||
in
|
||||
result // { _file = raw-module; }
|
||||
)
|
||||
raw-modules;
|
||||
|
||||
raw-neovim = pkgs.nixvim.makeNixvimWithModule {
|
||||
inherit pkgs;
|
||||
|
||||
module = {
|
||||
imports = wrapped-modules;
|
||||
|
||||
config = lib.mkMerge [
|
||||
{
|
||||
_module.args = {
|
||||
settings = neovim-settings;
|
||||
lib = lib.mkForce lib;
|
||||
};
|
||||
}
|
||||
|
||||
neovim-config
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
neovim = raw-neovim.overrideAttrs (attrs: {
|
||||
meta = attrs.meta // {
|
||||
# NOTE: The default platforms specified aren't actually all
|
||||
# supported by nixvim. Instead, only support the ones that can build with
|
||||
# the module system.
|
||||
platforms = builtins.attrNames inputs.nixvim.legacyPackages;
|
||||
};
|
||||
});
|
||||
in
|
||||
neovim
|
Loading…
Reference in a new issue