{
  config,
  inputs,
  lib,
  ...
}: {
  imports = [
    ../../../home-manager/home/sessionVariables
    ./autoCmd
    ./keymaps
    ./opts
    ./plugins
    inputs.nixvim.homeManagerModules.nixvim
  ];

  options.dotfiles.inputs.nixvim.programs.nixvim = {
    enable = lib.dotfiles.mkEnableOption;
    full = lib.dotfiles.mkEnableOption;
  };

  config = let
    cfg = config.dotfiles.inputs.nixvim.programs.nixvim;
  in
    lib.mkIf cfg.enable {
      dotfiles.inputs = {
        home-manager.home.sessionVariables = {
          EDITOR.enable = true;
          MANPAGER.enable = true;
          enable = true;
        };

        nixvim.programs.nixvim = lib.mkIf cfg.full {
          autoCmd.enable = lib.mkDefault true;
          keymaps.enable = lib.mkDefault true;
          opts.enable = lib.mkDefault true;
          plugins.full = lib.mkDefault true;
        };
      };

      home.shellAliases.n = lib.getExe config.programs.nixvim.finalPackage;

      programs.nixvim = {
        enable = true;

        globals = let
          leader = " ";
        in {
          mapleader = leader;
          maplocalleader = leader;
        };
      };
    };
}
