2024-04-27 12:44:37 +00:00
|
|
|
# Standalone Installation on Home-Manager {#ch-standalone-hm}
|
2024-04-20 03:57:11 +00:00
|
|
|
|
2024-11-04 14:38:45 +00:00
|
|
|
Your built Neovim configuration can be exposed as a flake output to make it
|
2024-04-27 12:44:37 +00:00
|
|
|
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
|
2024-11-08 09:27:42 +00:00
|
|
|
`configModule`, but this example will not cover that extensively.
|
2024-04-20 03:57:11 +00:00
|
|
|
|
|
|
|
```nix
|
|
|
|
{
|
2024-04-27 12:44:37 +00:00
|
|
|
inputs = {
|
|
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
|
|
|
home-manager.url = "github:nix-community/home-manager";
|
|
|
|
nvf.url = "github:notashelf/nvf";
|
2024-04-20 03:57:11 +00:00
|
|
|
};
|
|
|
|
|
2024-04-27 12:44:37 +00:00
|
|
|
outputs = {nixpkgs, home-manager, nvf, ...}: let
|
2024-04-20 03:57:11 +00:00
|
|
|
system = "x86_64-linux";
|
|
|
|
pkgs = nixpkgs.legacyPackages.${system};
|
|
|
|
configModule = {
|
2024-04-27 12:44:37 +00:00
|
|
|
# Add any custom options (and do feel free to upstream them!)
|
|
|
|
# options = { ... };
|
2024-04-20 03:57:11 +00:00
|
|
|
|
|
|
|
config.vim = {
|
|
|
|
theme.enable = true;
|
2024-04-27 12:44:37 +00:00
|
|
|
# and more options as you see fit...
|
2024-04-20 03:57:11 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-04-27 12:44:37 +00:00
|
|
|
customNeovim = nvf.lib.neovimConfiguration {
|
2024-04-20 03:57:11 +00:00
|
|
|
inherit pkgs;
|
2024-11-08 09:27:42 +00:00
|
|
|
modules = [configModule];
|
2024-04-20 03:57:11 +00:00
|
|
|
};
|
|
|
|
in {
|
2024-11-08 09:27:42 +00:00
|
|
|
# This will make the package available as a flake output under 'packages'
|
2024-04-27 12:44:37 +00:00
|
|
|
packages.${system}.my-neovim = customNeovim.neovim;
|
|
|
|
|
2024-11-08 09:27:42 +00:00
|
|
|
# Example Home-Manager configuration using the configured Neovim package
|
2024-04-20 03:57:11 +00:00
|
|
|
homeConfigurations = {
|
2024-04-27 12:44:37 +00:00
|
|
|
"your-username@your-hostname" = home-manager.lib.homeManagerConfiguration {
|
|
|
|
# ...
|
|
|
|
modules = [
|
2024-11-08 09:27:42 +00:00
|
|
|
# This will make Neovim available to users using the Home-Manager
|
|
|
|
# configuration. To make the package available to all users, prefer
|
|
|
|
# environment.systemPackages in your NixOS configuration.
|
|
|
|
{home.packages = [customNeovim.neovim];}
|
2024-04-27 12:44:37 +00:00
|
|
|
];
|
|
|
|
# ...
|
2024-04-20 03:57:11 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
|
|
|
```
|