mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 00:25:42 +02:00
wrappers: make _shared.nix
return a module
This commit is contained in:
parent
97fa47376b
commit
cfa44bbb66
4 changed files with 75 additions and 38 deletions
|
@ -16,11 +16,7 @@ let
|
|||
types
|
||||
;
|
||||
helpers = getHelpers pkgs false;
|
||||
shared = import ./_shared.nix helpers args;
|
||||
cfg = config.programs.nixvim;
|
||||
files = shared.configFiles // {
|
||||
"nvim/sysinit.lua".source = cfg.initPath;
|
||||
};
|
||||
in
|
||||
{
|
||||
options = {
|
||||
|
@ -39,9 +35,19 @@ in
|
|||
];
|
||||
};
|
||||
};
|
||||
nixvim.helpers = shared.helpers;
|
||||
};
|
||||
|
||||
imports = [
|
||||
(import ./_shared.nix {
|
||||
inherit helpers;
|
||||
filesOpt = [
|
||||
"environment"
|
||||
"etc"
|
||||
];
|
||||
initName = "sysinit.lua";
|
||||
})
|
||||
];
|
||||
|
||||
config = mkIf cfg.enable (mkMerge [
|
||||
{
|
||||
environment.systemPackages = [
|
||||
|
@ -49,14 +55,13 @@ in
|
|||
cfg.printInitPackage
|
||||
] ++ (lib.optional cfg.enableMan self.packages.${pkgs.stdenv.hostPlatform.system}.man-docs);
|
||||
}
|
||||
(mkIf (!cfg.wrapRc) {
|
||||
environment.etc = files;
|
||||
environment.variables."VIM" = "/etc/nvim";
|
||||
})
|
||||
{
|
||||
inherit (cfg) warnings assertions;
|
||||
programs.neovim.defaultEditor = cfg.defaultEditor;
|
||||
environment.variables.EDITOR = mkIf cfg.defaultEditor (lib.mkOverride 900 "nvim");
|
||||
environment.variables = {
|
||||
VIM = mkIf (!cfg.wrapRc) "/etc/nvim";
|
||||
EDITOR = mkIf cfg.defaultEditor (lib.mkOverride 900 "nvim");
|
||||
};
|
||||
}
|
||||
]);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue