2024-04-27 12:44:37 +00:00
|
|
|
# Home-Manager Module {#ch-hm-module}
|
2023-06-06 00:01:44 +00:00
|
|
|
|
2024-04-27 12:44:37 +00:00
|
|
|
The home-manager module allows us to customize the different `vim` options from
|
|
|
|
inside the home-manager configuration without having to call for the wrapper
|
|
|
|
yourself. It is the recommended way to use **nvf** alongside the NixOS module
|
|
|
|
depending on your needs.
|
2023-10-03 19:06:26 +00:00
|
|
|
|
|
|
|
To use it, we first add the input flake.
|
2023-06-06 00:01:44 +00:00
|
|
|
|
2023-12-09 19:03:58 +00:00
|
|
|
```nix
|
2023-06-06 00:01:44 +00:00
|
|
|
{
|
2024-04-14 12:36:23 +00:00
|
|
|
inputs = {
|
|
|
|
obsidian-nvim.url = "github:epwalsh/obsidian.nvim";
|
2024-04-27 12:44:37 +00:00
|
|
|
nvf = {
|
|
|
|
url = "github:notashelf/nvf";
|
2024-04-14 12:36:23 +00:00
|
|
|
# you can override input nixpkgs
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
# you can also override individual plugins
|
|
|
|
# for example:
|
|
|
|
inputs.obsidian-nvim.follows = "obsidian-nvim"; # <- this will use the obsidian-nvim from your inputs
|
|
|
|
};
|
2023-06-06 00:01:44 +00:00
|
|
|
};
|
|
|
|
}
|
2023-12-09 19:03:58 +00:00
|
|
|
```
|
2023-06-06 00:01:44 +00:00
|
|
|
|
2023-10-03 19:06:26 +00:00
|
|
|
Followed by importing the home-manager module somewhere in your configuration.
|
|
|
|
|
2023-12-09 19:03:58 +00:00
|
|
|
```nix
|
2023-10-03 19:06:26 +00:00
|
|
|
{
|
2024-04-27 12:44:37 +00:00
|
|
|
# assuming nvf is in your inputs and inputs is in the argset
|
|
|
|
# see example below
|
|
|
|
imports = [ inputs.nvf.homeManagerModules.default ];
|
2023-10-03 19:06:26 +00:00
|
|
|
}
|
2023-12-09 19:03:58 +00:00
|
|
|
```
|
2023-10-03 19:06:26 +00:00
|
|
|
|
2024-04-27 12:44:37 +00:00
|
|
|
## Example Installation {#sec-example-installation}
|
2023-06-06 00:01:44 +00:00
|
|
|
|
2023-12-09 19:03:58 +00:00
|
|
|
```nix
|
2023-06-06 00:01:44 +00:00
|
|
|
{
|
2023-10-03 19:06:26 +00:00
|
|
|
inputs = {
|
|
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
|
|
|
home-manager.url = "github:nix-community/home-manager";
|
2024-04-27 12:44:37 +00:00
|
|
|
nvf.url = "github:notashelf/nvf";
|
2023-10-03 19:06:26 +00:00
|
|
|
};
|
|
|
|
|
2024-04-27 12:44:37 +00:00
|
|
|
outputs = { nixpkgs, home-manager, nvf, ... }: let
|
2023-10-03 19:06:26 +00:00
|
|
|
system = "x86_64-linux"; in {
|
2024-04-27 12:44:37 +00:00
|
|
|
# ↓ this is your home output in the flake schema, expected by home-manager
|
|
|
|
"your-username@your-hostname" = home-manager.lib.homeManagerConfiguration
|
2023-10-03 19:06:26 +00:00
|
|
|
modules = [
|
2024-04-27 12:44:37 +00:00
|
|
|
nvf.homeManagerModules.default # <- this imports the home-manager module that provides the options
|
|
|
|
./home.nix # <- your home entrypoint
|
2023-10-03 19:06:26 +00:00
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
2023-06-06 00:01:44 +00:00
|
|
|
}
|
2023-12-09 19:03:58 +00:00
|
|
|
```
|
2023-06-06 00:01:44 +00:00
|
|
|
|
2024-04-27 12:44:37 +00:00
|
|
|
Once the module is properly imported by your host, you will be able to use the
|
|
|
|
`programs.nvf` module option anywhere in your configuration in order to
|
|
|
|
configure **nvf**.
|
2023-06-06 00:01:44 +00:00
|
|
|
|
2023-12-09 19:03:58 +00:00
|
|
|
```nix{
|
2024-04-27 12:44:37 +00:00
|
|
|
programs.nvf = {
|
2023-06-06 00:01:44 +00:00
|
|
|
enable = true;
|
2023-10-03 19:06:26 +00:00
|
|
|
# your settings need to go into the settings attribute set
|
|
|
|
# most settings are documented in the appendix
|
2023-06-06 00:01:44 +00:00
|
|
|
settings = {
|
|
|
|
vim.viAlias = false;
|
|
|
|
vim.vimAlias = true;
|
|
|
|
vim.lsp = {
|
|
|
|
enable = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
2023-12-09 19:03:58 +00:00
|
|
|
```
|
2023-06-06 00:01:44 +00:00
|
|
|
|
2024-04-27 12:44:37 +00:00
|
|
|
::: {.note}
|
|
|
|
**nvf** exposes a lot of options, most of which are not referenced in the
|
|
|
|
installation sections of the manual. You may find all avaliable options
|
|
|
|
in the [appendix](https://notashelf.github.io/nvf/options)
|
2023-12-09 19:03:58 +00:00
|
|
|
:::
|