feat: home manager module
This commit is contained in:
@@ -45,5 +45,9 @@
|
||||
};
|
||||
default = self.packages."${pkgs.system}".neovim;
|
||||
});
|
||||
homeManagerModules = {
|
||||
neovim = import ./nixos.nix {inherit self;};
|
||||
default = self.homeManagerModules.neovim;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
41
home.nix
Normal file
41
home.nix
Normal file
@@ -0,0 +1,41 @@
|
||||
{self}: {
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
neovim = self.packages.${pkgs.system}.default;
|
||||
cfg = config.neovim;
|
||||
in
|
||||
with lib; {
|
||||
options = {
|
||||
enable = mkOption {
|
||||
type = with types; bool;
|
||||
default = true;
|
||||
};
|
||||
package = mkOption {
|
||||
type = with types; package;
|
||||
default = neovim;
|
||||
};
|
||||
vimdiffAlias = mkOption {
|
||||
type = with types; bool;
|
||||
default = true;
|
||||
};
|
||||
defaultEditor = mkOption {
|
||||
type = with types; bool;
|
||||
default = true;
|
||||
};
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
home.sessionVariables = {EDITOR = "nvim";};
|
||||
|
||||
home.programs = [cfg.package];
|
||||
|
||||
programs.bash.shellAliases = mkIf cfg.vimdiffAlias {vimdiff = "nvim -d";};
|
||||
programs.fish.shellAliases = mkIf cfg.vimdiffAlias {vimdiff = "nvim -d";};
|
||||
programs.zsh.shellAliases = mkIf cfg.vimdiffAlias {vimdiff = "nvim -d";};
|
||||
|
||||
# Disable home-manager's Neovim
|
||||
programs.neovim.enable = mkForce false;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user