2024-04-27 15:44:37 +03:00
|
|
|
# Standalone Installation on NixOS {#ch-standalone-nixos}
|
2023-02-01 22:11:37 +03:00
|
|
|
|
2024-11-04 17:38:45 +03:00
|
|
|
Your built Neovim configuration can be exposed as a flake output to make it
|
2024-04-27 15:44:37 +03: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 12:27:42 +03:00
|
|
|
`configModule`, but this example will not cover that extensively.
|
2023-02-01 22:11:37 +03:00
|
|
|
|
2023-12-09 22:03:58 +03:00
|
|
|
```nix
|
2023-02-01 22:11:37 +03:00
|
|
|
{
|
2024-04-27 15:44:37 +03: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 19:58:37 +03:00
|
|
|
};
|
2023-02-01 22:11:37 +03:00
|
|
|
|
2025-02-06 17:43:54 +03:00
|
|
|
outputs = {
|
|
|
|
nixpkgs,
|
|
|
|
nvf,
|
|
|
|
self,
|
|
|
|
...
|
|
|
|
}: {
|
2024-11-08 12:27:42 +03:00
|
|
|
# This will make the package available as a flake output under 'packages'
|
2025-02-06 17:43:54 +03:00
|
|
|
packages.x86_64-linux.my-neovim =
|
|
|
|
(nvf.lib.neovimConfiguration {
|
|
|
|
pkgs = nixpkgs.legacyPackages.x86_64-linux;
|
|
|
|
modules = [
|
|
|
|
# Or move this to a separate file and add it's path here instead
|
|
|
|
# IE: ./nvf_module.nix
|
|
|
|
(
|
|
|
|
{pkgs, ...}: {
|
|
|
|
# Add any custom options (and do feel free to upstream them!)
|
|
|
|
# options = { ... };
|
|
|
|
config.vim = {
|
|
|
|
theme.enable = true;
|
|
|
|
# and more options as you see fit...
|
|
|
|
};
|
|
|
|
}
|
|
|
|
)
|
|
|
|
];
|
|
|
|
})
|
|
|
|
.neovim;
|
2023-10-03 22:06:26 +03:00
|
|
|
|
2024-11-08 12:27:42 +03:00
|
|
|
# Example nixosConfiguration using the configured Neovim package
|
2023-10-03 22:06:26 +03:00
|
|
|
nixosConfigurations = {
|
|
|
|
yourHostName = nixpkgs.lib.nixosSystem {
|
|
|
|
# ...
|
|
|
|
modules = [
|
2024-11-08 12:27:42 +03:00
|
|
|
# This will make wrapped neovim available in your system packages
|
2025-02-06 17:43:54 +03:00
|
|
|
# Can also move this to another config file if you pass inputs/self around with specialArgs
|
|
|
|
({pkgs, ...}: {
|
|
|
|
environment.systemPackages = [self.packages.${pkgs.stdenv.system}.neovim];
|
|
|
|
})
|
2023-10-03 22:06:26 +03:00
|
|
|
];
|
|
|
|
# ...
|
|
|
|
};
|
|
|
|
};
|
2023-02-01 22:11:37 +03:00
|
|
|
};
|
2025-02-06 17:43:54 +03:00
|
|
|
}```
|