mirror of
https://github.com/nix-community/nixvim.git
synced 2025-08-01 16:45:07 +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
|
@ -15,11 +15,7 @@ let
|
|||
types
|
||||
;
|
||||
helpers = getHelpers pkgs false;
|
||||
shared = import ./_shared.nix helpers args;
|
||||
cfg = config.programs.nixvim;
|
||||
files = shared.configFiles // {
|
||||
"nvim/init.lua".source = cfg.initPath;
|
||||
};
|
||||
in
|
||||
{
|
||||
options = {
|
||||
|
@ -38,9 +34,18 @@ in
|
|||
];
|
||||
};
|
||||
};
|
||||
nixvim.helpers = shared.helpers;
|
||||
};
|
||||
|
||||
imports = [
|
||||
(import ./_shared.nix {
|
||||
inherit helpers;
|
||||
filesOpt = [
|
||||
"xdg"
|
||||
"configFile"
|
||||
];
|
||||
})
|
||||
];
|
||||
|
||||
config = mkIf cfg.enable (mkMerge [
|
||||
{
|
||||
home.packages = [
|
||||
|
@ -48,7 +53,6 @@ in
|
|||
cfg.printInitPackage
|
||||
] ++ (lib.optional cfg.enableMan self.packages.${pkgs.stdenv.hostPlatform.system}.man-docs);
|
||||
}
|
||||
(mkIf (!cfg.wrapRc) { xdg.configFile = files; })
|
||||
{
|
||||
inherit (cfg) warnings assertions;
|
||||
home.sessionVariables = mkIf cfg.defaultEditor { EDITOR = "nvim"; };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue