From 226c555d8ff451cced577904d6fbf657460187ea Mon Sep 17 00:00:00 2001 From: Matt Sturgeon Date: Mon, 1 Apr 2024 13:19:21 +0100 Subject: [PATCH] docs: move standalone example to platform usage --- docs/modules/standalone.md | 15 +++++++++++++++ docs/user-guide/install.md | 13 ++----------- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/docs/modules/standalone.md b/docs/modules/standalone.md index 8159b082c3..991661b7b3 100644 --- a/docs/modules/standalone.md +++ b/docs/modules/standalone.md @@ -7,6 +7,21 @@ This is unlike the other modules which typically use a `programs.nixvim.*` prefi There are **no** standalone-specific options available. +## Using in another configuration + +Here is an example on how to integrate into a NixOS or Home-manager configuration when using flakes. + +The example assumes your standalone config is the `default` package of a flake, and you've named the input "`nixvim-config`". +```nix +{ inputs, system, ... }: +{ + # NixOS + environment.systemPackages = [ inputs.nixvim-config.packages.${system}.default ]; + # home-manager + home.packages = [ inputs.nixvim-config.packages.${system}.default ]; +} +``` + ## Extending an existing configuration Given a `nvim` derivation obtained from `makeNixvim` or `makeNivxmiWithModule` it is possible to create a new derivation with additional options. diff --git a/docs/user-guide/install.md b/docs/user-guide/install.md index 27df56f4f1..22ff2af155 100644 --- a/docs/user-guide/install.md +++ b/docs/user-guide/install.md @@ -73,15 +73,6 @@ There are also some helper functions in `.lib.${system}` like: The nixvim derivation can then be used like any other package! -For more information you can look at the [nixvim standalone flake template](https://github.com/nix-community/nixvim/blob/main/templates/simple/flake.nix). +For an example, see the [nixvim standalone flake template](https://github.com/nix-community/nixvim/blob/main/templates/simple/flake.nix). -Here is an example on how to integrate into a NixOS or Home-manager configuration when using flake parts (assuming your standalone flake's input is `nixvim-config`): -```nix -{ inputs, system, ... }: -{ - # NixOS - environment.systemPackages = [ inputs.nixvim-config.packages.${system}.default ]; - # home-manager - home.packages = [ inputs.nixvim-config.packages.${system}.default ]; -} -``` +For more information see [Standalone Usage](../modules/standalone.md).