Skip to content

Commit

Permalink
refactor(modules/programs/nixvim): extract local config scope
Browse files Browse the repository at this point in the history
Follows: 65071d8
  • Loading branch information
trueNAHO committed May 13, 2024
1 parent 62be0e4 commit c27951e
Showing 1 changed file with 29 additions and 26 deletions.
55 changes: 29 additions & 26 deletions modules/programs/nixvim/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,35 +18,38 @@
full = lib.mkEnableOption "modules.programs.nixvim.full";
};

config = lib.mkIf config.modules.programs.nixvim.enable (lib.mkMerge [
{
modules.homeManager.home.sessionVariables = {
EDITOR.enable = true;
MANPAGER.enable = true;
enable = true;
};
config = let
cfg = config.modules.programs.nixvim;
in
lib.mkIf cfg.enable (lib.mkMerge [
{
modules.homeManager.home.sessionVariables = {
EDITOR.enable = true;
MANPAGER.enable = true;
enable = true;
};

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

programs.nixvim = {
enable = true;
programs.nixvim = {
enable = true;

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

(lib.mkIf config.modules.programs.nixvim.full {
modules.programs.nixvim = {
autoCmd.enable = lib.mkDefault true;
keymaps.enable = lib.mkDefault true;
opts.enable = lib.mkDefault true;
plugins.full = lib.mkDefault true;
};
})
]);
(lib.mkIf cfg.full {
modules.programs.nixvim = {
autoCmd.enable = lib.mkDefault true;
keymaps.enable = lib.mkDefault true;
opts.enable = lib.mkDefault true;
plugins.full = lib.mkDefault true;
};
})
]);
}

0 comments on commit c27951e

Please sign in to comment.