mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 08:35:43 +02:00
37 lines
823 B
Nix
37 lines
823 B
Nix
modules: {
|
|
pkgs,
|
|
config,
|
|
lib,
|
|
...
|
|
} @ args: let
|
|
inherit (lib) mkEnableOption mkOption mkOptionType mkMerge mkIf types;
|
|
shared = import ./_shared.nix args;
|
|
cfg = config.programs.nixvim;
|
|
in {
|
|
options = {
|
|
programs.nixvim = mkOption {
|
|
default = {};
|
|
type = types.submodule ((modules pkgs)
|
|
++ [
|
|
{
|
|
options.enable = mkEnableOption "nixvim";
|
|
}
|
|
]);
|
|
};
|
|
nixvim.helpers = shared.helpers;
|
|
};
|
|
|
|
config =
|
|
mkIf cfg.enable
|
|
(mkMerge [
|
|
{environment.systemPackages = [cfg.finalPackage];}
|
|
(mkIf (!cfg.wrapRc) {
|
|
environment.etc."nvim/sysinit.lua".text = cfg.initContent;
|
|
environment.variables."VIM" = "/etc/nvim";
|
|
})
|
|
{
|
|
warnings = cfg.warnings;
|
|
assertions = cfg.assertions;
|
|
}
|
|
]);
|
|
}
|