2024-04-27 12:44:37 +00:00
|
|
|
# Standalone Installation on NixOS {#ch-standalone-nixos}
|
2023-02-01 19:11:37 +00:00
|
|
|
|
2024-04-27 12:44:37 +00:00
|
|
|
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.
|
2023-02-01 19:11:37 +00:00
|
|
|
|
2023-12-09 19:03:58 +00:00
|
|
|
```nix
|
2023-02-01 19:11:37 +00:00
|
|
|
{
|
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";
|
2023-04-02 16:58:37 +00:00
|
|
|
};
|
2023-02-01 19:11:37 +00:00
|
|
|
|
2024-04-27 12:44:37 +00:00
|
|
|
outputs = {nixpkgs, nvf, ...}: let
|
2023-02-01 19:11:37 +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 = { ... };
|
2023-02-01 19:11:37 +00:00
|
|
|
|
2023-04-02 16:58:37 +00:00
|
|
|
config.vim = {
|
|
|
|
theme.enable = true;
|
2024-04-27 12:44:37 +00:00
|
|
|
# and more options as you see fit...
|
2023-04-02 16:58:37 +00:00
|
|
|
};
|
2023-02-01 19:11:37 +00:00
|
|
|
};
|
|
|
|
|
2024-04-27 12:44:37 +00:00
|
|
|
customNeovim = nvf.lib.neovimConfiguration {
|
2023-02-01 19:11:37 +00:00
|
|
|
modules = [configModule];
|
|
|
|
inherit pkgs;
|
|
|
|
};
|
|
|
|
in {
|
2023-10-03 19:06:26 +00:00
|
|
|
# this will make the package available as a flake input
|
2024-04-27 12:44:37 +00:00
|
|
|
packages.${system}.my-neovim = customNeovim.neovim;
|
2023-10-03 19:06:26 +00:00
|
|
|
|
|
|
|
# this is an example nixosConfiguration using the built neovim package
|
|
|
|
nixosConfigurations = {
|
|
|
|
yourHostName = nixpkgs.lib.nixosSystem {
|
|
|
|
# ...
|
|
|
|
modules = [
|
|
|
|
./configuration.nix # or whatever your configuration is
|
|
|
|
|
|
|
|
# this will make wrapped neovim available in your system packages
|
|
|
|
{environment.systemPackages = [customNeovim.neovim];}
|
|
|
|
];
|
|
|
|
# ...
|
|
|
|
};
|
|
|
|
};
|
2023-02-01 19:11:37 +00:00
|
|
|
};
|
|
|
|
}
|
2023-12-09 19:03:58 +00:00
|
|
|
```
|