mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 08:35:43 +02:00
bugfix: fix #17
This commit is contained in:
parent
d934a33ab5
commit
c298e98002
1 changed files with 137 additions and 130 deletions
23
nixvim.nix
23
nixvim.nix
|
@ -23,7 +23,9 @@ let
|
|||
};
|
||||
};
|
||||
|
||||
mapOption = types.oneOf [ types.str (types.submodule {
|
||||
mapOption = types.oneOf [
|
||||
types.str
|
||||
(types.submodule {
|
||||
options = {
|
||||
silent = mkOption {
|
||||
type = types.bool;
|
||||
|
@ -72,7 +74,8 @@ let
|
|||
default = null;
|
||||
};
|
||||
};
|
||||
}) ];
|
||||
})
|
||||
];
|
||||
|
||||
mapOptions = mode: mkOption {
|
||||
description = "Mappings for ${mode} mode";
|
||||
|
@ -183,7 +186,8 @@ in
|
|||
./plugins
|
||||
];
|
||||
|
||||
config = let
|
||||
config =
|
||||
let
|
||||
neovimConfig = pkgs.neovimUtils.makeNeovimConfig {
|
||||
configure = cfg.configure;
|
||||
plugins = cfg.extraPlugins;
|
||||
|
@ -209,7 +213,8 @@ in
|
|||
'';
|
||||
|
||||
packages.nixvim = {
|
||||
start = filter (f: f != null) (map (x:
|
||||
start = filter (f: f != null) (map
|
||||
(x:
|
||||
if x ? plugin && x.optional == true then null else (x.plugin or x))
|
||||
cfg.extraPlugins);
|
||||
opt = filter (f: f != null)
|
||||
|
@ -257,16 +262,18 @@ in
|
|||
(helpers.genMaps "!" cfg.maps.insertCommand) ++
|
||||
(helpers.genMaps "c" cfg.maps.command);
|
||||
|
||||
in mkIf cfg.enable (if nixos then {
|
||||
in
|
||||
mkIf cfg.enable (if nixos then {
|
||||
environment.systemPackages = [ wrappedNeovim ];
|
||||
programs.neovim = {
|
||||
configure = configure;
|
||||
|
||||
extraConfigLua = extraConfigLua;
|
||||
};
|
||||
|
||||
programs.nixvim.extraConfigLua = extraConfigLua;
|
||||
|
||||
environment.etc."xdg/nvim/sysinit.vim".text = neovimConfig.neovimRcContent;
|
||||
} else (if homeManager then {
|
||||
} else
|
||||
(if homeManager then {
|
||||
programs.nixvim.extraConfigLua = extraConfigLua;
|
||||
programs.neovim = {
|
||||
enable = true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue