From 3f7e6ce8501ebdaa839f75426446ab82701f76dd Mon Sep 17 00:00:00 2001 From: Matt Sturgeon Date: Mon, 1 Apr 2024 15:12:25 +0000 Subject: [PATCH] wrappers: expose `config` in standalone output (#1356) --- docs/modules/standalone.md | 6 ++++++ wrappers/standalone.nix | 1 + 2 files changed, 7 insertions(+) diff --git a/docs/modules/standalone.md b/docs/modules/standalone.md index 991661b7..bd5a0441 100644 --- a/docs/modules/standalone.md +++ b/docs/modules/standalone.md @@ -49,3 +49,9 @@ in This will generate a `init.lua` that will contain the three comments from each stages. +## Accessing options used in an existing configuration + +The `config` used to produce a standalone nixvim derivation can be accessed as an attribute on the derivation, similar to `nixvimExtend`. + +This may be useful if you want unrelated parts of your NixOS or home-manager configuration to use the same value as something in your nixvim configuration. + diff --git a/wrappers/standalone.nix b/wrappers/standalone.nix index 09eb487f..bc739340 100644 --- a/wrappers/standalone.nix +++ b/wrappers/standalone.nix @@ -52,6 +52,7 @@ default_pkgs: { meta.mainProgram = "nvim"; }) // { + inherit config; nixvimExtend = extension: mkNvim {imports = [mod extension];}; }; in