From 711de1179c213d41d81489f8cf66e246e242dfef Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Mon, 4 Nov 2024 17:39:10 +0300 Subject: [PATCH] docs/installation: add standalone flake example --- .../installation/custom-configuration.md | 54 +++++++++++++++++-- 1 file changed, 51 insertions(+), 3 deletions(-) diff --git a/docs/manual/installation/custom-configuration.md b/docs/manual/installation/custom-configuration.md index 408b039..64ae64e 100644 --- a/docs/manual/installation/custom-configuration.md +++ b/docs/manual/installation/custom-configuration.md @@ -1,8 +1,9 @@ # Standalone Installation {#ch-standalone-installation} -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. +It is possible to install nvf without depending on NixOS or Home-Manager as the +parent module system, using the `neovimConfiguration` function exposed in the +extended library. This function will take `modules` and `extraSpecialArgs` as +arguments, and return the following schema as a result. ```nix { @@ -13,6 +14,53 @@ It takes in the configuration as a module, and returns an attribute set as a res } ``` +An example flake that exposes your custom Neovim configuration might look like + +```nix +{ + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + nvf.url = "github:notashelf/nvf"; + }; + + outputs = { + self, + nixpkgs, + ... + } @ inputs: { + packages."x86_64-linux" = let + neovimConfigured = (inputs.nvf.lib.neovimConfiguration { + inherit (nixpkgs.legacyPackages."x86_64-linux") pkgs; + modules = [{ + config.vim = { + # Enable custom theming options + theme.enable = true; + + # Enable Treesitter + tree-sitter.enable = true; + + # Other options will go here. Refer to the config + # reference in Appendix B of the nvf manual. + # ... + }; + }]; + }); + in { + # Set the default package to the wrapped instance of Neovim. + # This will allow running your Neovim configuration with + # `nix run` and in addition, sharing your configuration with + # other users in case your repository is public. + default = neovimConfigured.neovim; + }; + }; +} +``` + + + +The next two chapters will detail specific usage of standalone nvf +configurations on NixOS and Home-Manager. + ```{=include=} chapters standalone/nixos.md standalone/home-manager.md