mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-12-16 00:51:03 +00:00
docs: rename all instances of neovim-flake to nvf
This commit is contained in:
parent
ebe0d6c960
commit
227f80ac9d
36 changed files with 430 additions and 278 deletions
|
|
@ -1,7 +1,7 @@
|
|||
# Standalone Installation {#ch-standalone-installation}
|
||||
|
||||
It is possible to install neovim-flake without depending on NixOS or home-manager as the parent
|
||||
module system, using the `neovimConfiguration` function exposed by neovim-flake extended library.
|
||||
It is possible to install **nvf** without depending on NixOS or home-manager as the parent
|
||||
module system, using the `neovimConfiguration` function exposed by **nvf** extended library.
|
||||
It takes in the configuration as a module, and returns an attribute set as a result.
|
||||
|
||||
```nix
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
# Home Manager Module {#ch-hm-module}
|
||||
# Home-Manager Module {#ch-hm-module}
|
||||
|
||||
The Home Manager module allows us to customize the different `vim` options from inside the home-manager configuration
|
||||
and it is the preferred way of configuring neovim-flake, both on NixOS and non-NixOS systems.
|
||||
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.
|
||||
|
||||
To use it, we first add the input flake.
|
||||
|
||||
|
|
@ -9,8 +11,8 @@ To use it, we first add the input flake.
|
|||
{
|
||||
inputs = {
|
||||
obsidian-nvim.url = "github:epwalsh/obsidian.nvim";
|
||||
neovim-flake = {
|
||||
url = "github:notashelf/neovim-flake";
|
||||
nvf = {
|
||||
url = "github:notashelf/nvf";
|
||||
# you can override input nixpkgs
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
# you can also override individual plugins
|
||||
|
|
@ -25,41 +27,41 @@ Followed by importing the home-manager module somewhere in your configuration.
|
|||
|
||||
```nix
|
||||
{
|
||||
# assuming neovim-flake is in your inputs and inputs is in the argset
|
||||
imports = [ inputs.neovim-flake.homeManagerModules.default ];
|
||||
# assuming nvf is in your inputs and inputs is in the argset
|
||||
# see example below
|
||||
imports = [ inputs.nvf.homeManagerModules.default ];
|
||||
}
|
||||
```
|
||||
|
||||
An example installation for neovim-flake under standalone home-manager
|
||||
would look like this:
|
||||
## Example Installation {#sec-example-installation}
|
||||
|
||||
```nix
|
||||
{
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
home-manager.url = "github:nix-community/home-manager";
|
||||
neovim-flake.url = "github:notashelf/neovim-flake";
|
||||
nvf.url = "github:notashelf/nvf";
|
||||
};
|
||||
|
||||
outputs = { nixpkgs, home-manager, neovim-flake ... }: let
|
||||
outputs = { nixpkgs, home-manager, nvf, ... }: let
|
||||
system = "x86_64-linux"; in {
|
||||
# ↓ this is the home-manager output in the flake schema
|
||||
homeConfigurations."yourUsername»" = home-manager.lib.homeManagerConfiguration {
|
||||
pkgs = nixpkgs.legacyPackages.x86_64-linux;
|
||||
# ↓ this is your home output in the flake schema, expected by home-manager
|
||||
"your-username@your-hostname" = home-manager.lib.homeManagerConfiguration
|
||||
modules = [
|
||||
neovim-flake.homeManagerModules.default # <- this imports the home-manager module that provides the options
|
||||
./home.nix # your home-manager configuration, probably where you will want to add programs.neovim-flake options
|
||||
nvf.homeManagerModules.default # <- this imports the home-manager module that provides the options
|
||||
./home.nix # <- your home entrypoint
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
```
|
||||
|
||||
Once the module is imported, we will be able to define the following options (and much more) from inside the
|
||||
home-manager configuration.
|
||||
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**.
|
||||
|
||||
```nix{
|
||||
programs.neovim-flake = {
|
||||
programs.nvf = {
|
||||
enable = true;
|
||||
# your settings need to go into the settings attribute set
|
||||
# most settings are documented in the appendix
|
||||
|
|
@ -74,6 +76,8 @@ home-manager configuration.
|
|||
}
|
||||
```
|
||||
|
||||
:::{.note}
|
||||
You may find all avaliable options in the [appendix](https://notashelf.github.io/neovim-flake/options)
|
||||
::: {.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)
|
||||
:::
|
||||
|
|
|
|||
|
|
@ -1,3 +1,82 @@
|
|||
# NixOS Module {#ch-nixos-module}
|
||||
|
||||
This artice is a stub. It will be written as the NixOS module is finalized.
|
||||
The NixOS module allows us to customize the different `vim` options from inside
|
||||
the NixOS configuration without having to call for the wrapper yourself. It is
|
||||
the recommended way to use **nvf** alongside the home-manager module depending
|
||||
on your needs.
|
||||
|
||||
To use it, we first add the input flake.
|
||||
|
||||
```nix
|
||||
{
|
||||
inputs = {
|
||||
obsidian-nvim.url = "github:epwalsh/obsidian.nvim";
|
||||
nvf = {
|
||||
url = "github:notashelf/nvf";
|
||||
# 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
|
||||
};
|
||||
};
|
||||
}
|
||||
```
|
||||
|
||||
Followed by importing the NixOS module somewhere in your configuration.
|
||||
|
||||
```nix
|
||||
{
|
||||
# assuming nvf is in your inputs and inputs is in the argset
|
||||
# see example below
|
||||
imports = [ inputs.nvf.nixosModules.default ];
|
||||
}
|
||||
```
|
||||
|
||||
## Example Installation {#sec-example-installation}
|
||||
|
||||
```nix
|
||||
{
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
nvf.url = "github:notashelf/nvf";
|
||||
};
|
||||
|
||||
outputs = { nixpkgs, nvf, ... }: let
|
||||
system = "x86_64-linux"; in {
|
||||
# ↓ this is your host output in the flake schema
|
||||
nixosConfigurations."yourUsername»" = nixpkgs.lib.nixosSystem {
|
||||
modules = [
|
||||
nvf.nixosModules.default # <- this imports the NixOS module that provides the options
|
||||
./configuration.nix # <- your host entrypoint
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
```
|
||||
|
||||
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**.
|
||||
|
||||
```nix{
|
||||
programs.nvf = {
|
||||
enable = true;
|
||||
# your settings need to go into the settings attribute set
|
||||
# most settings are documented in the appendix
|
||||
settings = {
|
||||
vim.viAlias = false;
|
||||
vim.vimAlias = true;
|
||||
vim.lsp = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
```
|
||||
|
||||
::: {.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)
|
||||
:::
|
||||
|
|
|
|||
|
|
@ -1,35 +1,54 @@
|
|||
# Standalone Installation (home-manager) {#ch-standalone-home-manager}
|
||||
# Standalone Installation on Home-Manager {#ch-standalone-hm}
|
||||
|
||||
The following is an example of a barebones vim configuration with the default theme enabled.
|
||||
Your built Neoevim configuration can be exposed as a flake output to make it
|
||||
easier to share across machines, repositories and so on. Or it can be added to
|
||||
your system packages to make it available across your system.
|
||||
|
||||
The following is an example installation of `nvf` as a standalone package with
|
||||
the default theme enabled. You may use other options inside `config.vim` in
|
||||
`configModule`, but this example will not cover that.
|
||||
|
||||
```nix
|
||||
{
|
||||
inputs.neovim-flake = {
|
||||
url = "github:notashelf/neovim-flake";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
home-manager.url = "github:nix-community/home-manager";
|
||||
nvf.url = "github:notashelf/nvf";
|
||||
};
|
||||
|
||||
outputs = {nixpkgs, neovim-flake, ...}: let
|
||||
outputs = {nixpkgs, home-manager, nvf, ...}: let
|
||||
system = "x86_64-linux";
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
configModule = {
|
||||
# Add any custom options (and feel free to upstream them!)
|
||||
# options = ...
|
||||
# Add any custom options (and do feel free to upstream them!)
|
||||
# options = { ... };
|
||||
|
||||
config.vim = {
|
||||
theme.enable = true;
|
||||
# and more options as you see fit...
|
||||
};
|
||||
};
|
||||
|
||||
customNeovim = neovim-flake.lib.neovimConfiguration {
|
||||
customNeovim = nvf.lib.neovimConfiguration {
|
||||
modules = [configModule];
|
||||
inherit pkgs;
|
||||
};
|
||||
in {
|
||||
# this is an example nixosConfiguration using the built neovim package
|
||||
# this will make the package available as a flake input
|
||||
packages.${system}.my-neovim = customNeovim.neovim;
|
||||
|
||||
# this is an example home-manager configuration
|
||||
# using the built neovim package
|
||||
homeConfigurations = {
|
||||
yourHostName = home-manager.lib.nixosSystem {
|
||||
# TODO
|
||||
"your-username@your-hostname" = home-manager.lib.homeManagerConfiguration {
|
||||
# ...
|
||||
modules = [
|
||||
./home.nix
|
||||
|
||||
# this will make wrapped neovim available in your system packages
|
||||
{environment.systemPackages = [customNeovim.neovim];}
|
||||
];
|
||||
# ...
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,33 +1,41 @@
|
|||
# Standalone Installation (NixOS) {#ch-standalone-nixos}
|
||||
# Standalone Installation on NixOS {#ch-standalone-nixos}
|
||||
|
||||
The following is an example of a barebones vim configuration with the default theme enabled.
|
||||
Your built Neoevim configuration can be exposed as a flake output to make it
|
||||
easier to share across machines, repositories and so on. Or it can be added to
|
||||
your system packages to make it available across your system.
|
||||
|
||||
The following is an example installation of `nvf` as a standalone package with
|
||||
the default theme enabled. You may use other options inside `config.vim` in
|
||||
`configModule`, but this example will not cover that.
|
||||
|
||||
```nix
|
||||
{
|
||||
inputs.neovim-flake = {
|
||||
url = "github:notashelf/neovim-flake";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
home-manager.url = "github:nix-community/home-manager";
|
||||
nvf.url = "github:notashelf/nvf";
|
||||
};
|
||||
|
||||
outputs = {nixpkgs, neovim-flake, ...}: let
|
||||
outputs = {nixpkgs, nvf, ...}: let
|
||||
system = "x86_64-linux";
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
configModule = {
|
||||
# Add any custom options (and feel free to upstream them!)
|
||||
# options = ...
|
||||
# Add any custom options (and do feel free to upstream them!)
|
||||
# options = { ... };
|
||||
|
||||
config.vim = {
|
||||
theme.enable = true;
|
||||
# and more options as you see fit...
|
||||
};
|
||||
};
|
||||
|
||||
customNeovim = neovim-flake.lib.neovimConfiguration {
|
||||
customNeovim = nvf.lib.neovimConfiguration {
|
||||
modules = [configModule];
|
||||
inherit pkgs;
|
||||
};
|
||||
in {
|
||||
# this will make the package available as a flake input
|
||||
packages.${system}.neovim = customNeovim.neovim;
|
||||
packages.${system}.my-neovim = customNeovim.neovim;
|
||||
|
||||
# this is an example nixosConfiguration using the built neovim package
|
||||
nixosConfigurations = {
|
||||
|
|
@ -45,7 +53,3 @@ The following is an example of a barebones vim configuration with the default th
|
|||
};
|
||||
}
|
||||
```
|
||||
|
||||
Your built neovim configuration can be exposed as a flake output, or be added to your system packages to make
|
||||
it available across your system. You may also consider passing the flake output to home-manager to make it available
|
||||
to a specific user.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue