mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 00:25:42 +02:00
* Use init.lua instead of init.vim * fix standalone generation Co-authored-by: cyrusng <cyrus.ng@protonmail.com> Co-authored-by: Pedro Alves <pta2002@pta2002.com>
34 lines
938 B
Nix
34 lines
938 B
Nix
modules:
|
|
{ pkgs, config, lib, ... }:
|
|
|
|
let
|
|
inherit (lib) mkEnableOption mkOption mkOptionType mkMerge mkIf types;
|
|
cfg = config.programs.nixvim;
|
|
in
|
|
{
|
|
options = {
|
|
programs.nixvim = mkOption {
|
|
type = types.submodule ((modules pkgs) ++ [{
|
|
options.enable = mkEnableOption "nixvim";
|
|
}]);
|
|
};
|
|
nixvim.helpers = mkOption {
|
|
type = mkOptionType {
|
|
name = "helpers";
|
|
description = "Helpers that can be used when writing nixvim configs";
|
|
check = builtins.isAttrs;
|
|
};
|
|
description = "Use this option to access the helpers";
|
|
default = import ../plugins/helpers.nix { inherit (pkgs) lib; };
|
|
};
|
|
};
|
|
|
|
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";
|
|
})
|
|
]);
|
|
}
|