mirror of
https://github.com/nix-community/nixvim.git
synced 2025-07-10 01:04:34 +02:00
nixvim: support standalone nixvim
This represents a major rearchitecture for nixvim, so I'm leaving this up to track the progress for now, and to serve as a reference for any breaking changes during transition. The main change is, of course, being able to use nixvim standalone. To do this, you should use the new build function, which takes in two arguments: the system architecture (e.g. x86_64-linux) and the configuration. For the new configuration, do not use the programs.nixvim. prefix. For module development, the main change is that you should no longer prefix your modules with programs.nixvim..
This commit is contained in:
parent
bd6f978d51
commit
4ddd3969e5
52 changed files with 1410 additions and 904 deletions
41
modules/options.nix
Normal file
41
modules/options.nix
Normal file
|
@ -0,0 +1,41 @@
|
|||
{ config, lib, helpers, ... }:
|
||||
with lib;
|
||||
{
|
||||
options = {
|
||||
options = mkOption {
|
||||
type = types.attrsOf types.anything;
|
||||
default = { };
|
||||
description = "The configuration options, e.g. line numbers";
|
||||
};
|
||||
|
||||
globals = mkOption {
|
||||
type = types.attrsOf types.anything;
|
||||
default = { };
|
||||
description = "Global variables";
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
extraConfigLuaPre = optionalString (config.globals != { }) ''
|
||||
-- Set up globals {{{
|
||||
do
|
||||
local nixvim_globals = ${helpers.toLuaObject config.globals}
|
||||
|
||||
for k,v in pairs(nixvim_globals) do
|
||||
vim.g[k] = v
|
||||
end
|
||||
end
|
||||
-- }}}
|
||||
'' + optionalString (config.options != { }) ''
|
||||
-- Set up options {{{
|
||||
do
|
||||
local nixvim_options = ${helpers.toLuaObject config.options}
|
||||
|
||||
for k,v in pairs(nixvim_options) do
|
||||
vim.o[k] = v
|
||||
end
|
||||
end
|
||||
-- }}}
|
||||
'';
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue