2024-04-20 05:57:11 +02:00
|
|
|
# Standalone Installation (NixOS) {#ch-standalone-nixos}
|
2023-02-01 20:11:37 +01:00
|
|
|
|
|
|
|
The following is an example of a barebones vim configuration with the default theme enabled.
|
|
|
|
|
2023-12-09 20:03:58 +01:00
|
|
|
```nix
|
2023-02-01 20:11:37 +01:00
|
|
|
{
|
2023-04-02 18:58:37 +02:00
|
|
|
inputs.neovim-flake = {
|
|
|
|
url = "github:notashelf/neovim-flake";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
2023-02-01 20:11:37 +01:00
|
|
|
|
|
|
|
outputs = {nixpkgs, neovim-flake, ...}: let
|
|
|
|
system = "x86_64-linux";
|
|
|
|
pkgs = nixpkgs.legacyPackages.${system};
|
|
|
|
configModule = {
|
|
|
|
# Add any custom options (and feel free to upstream them!)
|
|
|
|
# options = ...
|
|
|
|
|
2023-04-02 18:58:37 +02:00
|
|
|
config.vim = {
|
|
|
|
theme.enable = true;
|
|
|
|
};
|
2023-02-01 20:11:37 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
customNeovim = neovim-flake.lib.neovimConfiguration {
|
|
|
|
modules = [configModule];
|
|
|
|
inherit pkgs;
|
|
|
|
};
|
|
|
|
in {
|
2023-10-03 21:06:26 +02:00
|
|
|
# this will make the package available as a flake input
|
2023-02-01 20:11:37 +01:00
|
|
|
packages.${system}.neovim = customNeovim.neovim;
|
2023-10-03 21:06:26 +02: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 20:11:37 +01:00
|
|
|
};
|
|
|
|
}
|
2023-12-09 20:03:58 +01:00
|
|
|
```
|
2023-02-01 20:11:37 +01:00
|
|
|
|
2023-10-03 21:06:26 +02:00
|
|
|
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
|
2024-04-20 05:57:11 +02:00
|
|
|
to a specific user.
|