wrappers: make _shared.nix return a module

This commit is contained in:
Matt Sturgeon 2024-07-08 05:00:44 +01:00
parent 97fa47376b
commit cfa44bbb66
No known key found for this signature in database
GPG key ID: 4F91844CED1A8299
4 changed files with 75 additions and 38 deletions

View file

@ -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"; };