mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 00:25:42 +02:00
modules: add env option
This commit is contained in:
parent
f4f4b4975a
commit
db01a0dd97
3 changed files with 72 additions and 1 deletions
|
@ -28,6 +28,26 @@ let
|
|||
in
|
||||
{
|
||||
options = {
|
||||
env = mkOption {
|
||||
type =
|
||||
with types;
|
||||
lazyAttrsOf (oneOf [
|
||||
str
|
||||
path
|
||||
int
|
||||
float
|
||||
]);
|
||||
description = "Environment variables to set in the neovim wrapper.";
|
||||
default = { };
|
||||
example = {
|
||||
FOO = 1;
|
||||
PI = 3.14;
|
||||
BAR_PATH = "/home/me/.local/share/bar";
|
||||
INFER_MODE = "local";
|
||||
BAZ_MAX_COUNT = 1000;
|
||||
};
|
||||
};
|
||||
|
||||
extraPlugins = mkOption {
|
||||
type = with types; listOf (nullOr (either package pluginWithConfigType));
|
||||
default = [ ];
|
||||
|
|
|
@ -339,7 +339,16 @@ in
|
|||
initSource;
|
||||
|
||||
extraWrapperArgs = builtins.concatStringsSep " " (
|
||||
(optional (
|
||||
# Setting environment variables in the wrapper
|
||||
(lib.mapAttrsToList (
|
||||
name: value:
|
||||
lib.escapeShellArgs [
|
||||
"--set"
|
||||
name
|
||||
value
|
||||
]
|
||||
) config.env)
|
||||
++ (optional (
|
||||
config.extraPackages != [ ]
|
||||
) ''--prefix PATH : "${lib.makeBinPath config.extraPackages}"'')
|
||||
++ (optional config.wrapRc ''--add-flags -u --add-flags "${initFile}"'')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue