mirror of
https://github.com/nix-community/nixvim.git
synced 2025-07-07 15:54:31 +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
|
@ -1,7 +1,7 @@
|
|||
{ pkgs, config, lib, ... }:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.programs.nixvim.plugins.telescope;
|
||||
cfg = config.plugins.telescope;
|
||||
helpers = (import ../helpers.nix { inherit lib; });
|
||||
in
|
||||
{
|
||||
|
@ -14,13 +14,13 @@ in
|
|||
|
||||
# TODO:add support for aditional filetypes. This requires autocommands!
|
||||
|
||||
options.programs.nixvim.plugins.telescope = {
|
||||
options.plugins.telescope = {
|
||||
enable = mkEnableOption "Enable telescope.nvim";
|
||||
|
||||
highlightTheme = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
description = "The colorscheme to use for syntax highlighting";
|
||||
default = config.programs.nixvim.colorscheme;
|
||||
default = config.colorscheme;
|
||||
};
|
||||
|
||||
enabledExtensions = mkOption {
|
||||
|
@ -37,32 +37,30 @@ in
|
|||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
programs.nixvim = {
|
||||
extraPackages = [ pkgs.bat ];
|
||||
extraPackages = [ pkgs.bat ];
|
||||
|
||||
extraPlugins = with pkgs.vimPlugins; [
|
||||
telescope-nvim
|
||||
plenary-nvim
|
||||
popup-nvim
|
||||
];
|
||||
extraPlugins = with pkgs.vimPlugins; [
|
||||
telescope-nvim
|
||||
plenary-nvim
|
||||
popup-nvim
|
||||
];
|
||||
|
||||
extraConfigVim = mkIf (cfg.highlightTheme != null) ''
|
||||
let $BAT_THEME = '${cfg.highlightTheme}'
|
||||
'';
|
||||
extraConfigVim = mkIf (cfg.highlightTheme != null) ''
|
||||
let $BAT_THEME = '${cfg.highlightTheme}'
|
||||
'';
|
||||
|
||||
extraConfigLua = ''
|
||||
do
|
||||
local __telescopeExtensions = ${helpers.toLuaObject cfg.enabledExtensions}
|
||||
extraConfigLua = ''
|
||||
do
|
||||
local __telescopeExtensions = ${helpers.toLuaObject cfg.enabledExtensions}
|
||||
|
||||
require('telescope').setup{
|
||||
extensions = ${helpers.toLuaObject cfg.extensionConfig}
|
||||
}
|
||||
require('telescope').setup{
|
||||
extensions = ${helpers.toLuaObject cfg.extensionConfig}
|
||||
}
|
||||
|
||||
for i, extension in ipairs(__telescopeExtensions) do
|
||||
require('telescope').load_extension(extension)
|
||||
end
|
||||
for i, extension in ipairs(__telescopeExtensions) do
|
||||
require('telescope').load_extension(extension)
|
||||
end
|
||||
'';
|
||||
};
|
||||
end
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
{ pkgs, config, lib, ... }:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.programs.nixvim.plugins.telescope.extensions.frecency;
|
||||
cfg = config.plugins.telescope.extensions.frecency;
|
||||
in
|
||||
{
|
||||
options.programs.nixvim.plugins.telescope.extensions.frecency = {
|
||||
options.plugins.telescope.extensions.frecency = {
|
||||
enable = mkEnableOption "Enable frecency";
|
||||
|
||||
dbRoot = mkOption {
|
||||
|
@ -55,13 +55,13 @@ in
|
|||
devicons_disabled = cfg.deviconsDisabled;
|
||||
};
|
||||
in mkIf cfg.enable {
|
||||
programs.nixvim.extraPackages = [ pkgs.sqlite ];
|
||||
programs.nixvim.extraPlugins = with pkgs.vimPlugins; [
|
||||
extraPackages = [ pkgs.sqlite ];
|
||||
extraPlugins = with pkgs.vimPlugins; [
|
||||
telescope-frecency-nvim
|
||||
sqlite-lua
|
||||
];
|
||||
|
||||
programs.nixvim.plugins.telescope.enabledExtensions = [ "frecency" ];
|
||||
programs.nixvim.plugins.telescope.extensionConfig."frecency" = configuration;
|
||||
plugins.telescope.enabledExtensions = [ "frecency" ];
|
||||
plugins.telescope.extensionConfig."frecency" = configuration;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
{ pkgs, config, lib, ... }:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.programs.nixvim.plugins.telescope.extensions.fzf-native;
|
||||
cfg = config.plugins.telescope.extensions.fzf-native;
|
||||
in
|
||||
{
|
||||
options.programs.nixvim.plugins.telescope.extensions.fzf-native = {
|
||||
options.plugins.telescope.extensions.fzf-native = {
|
||||
enable = mkEnableOption "Enable fzf-native";
|
||||
|
||||
fuzzy = mkOption {
|
||||
|
@ -36,9 +36,9 @@ in
|
|||
case_mode = cfg.caseMode;
|
||||
};
|
||||
in mkIf cfg.enable {
|
||||
programs.nixvim.extraPlugins = [ pkgs.vimPlugins.telescope-fzf-native-nvim ];
|
||||
extraPlugins = [ pkgs.vimPlugins.telescope-fzf-native-nvim ];
|
||||
|
||||
programs.nixvim.plugins.telescope.enabledExtensions = [ "fzf" ];
|
||||
programs.nixvim.plugins.telescope.extensionConfig."fzf" = configuration;
|
||||
plugins.telescope.enabledExtensions = [ "fzf" ];
|
||||
plugins.telescope.extensionConfig."fzf" = configuration;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
{ pkgs, config, lib, ...}:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.programs.nixvim.plugins.telescope.extensions.fzy-native;
|
||||
cfg = config.plugins.telescope.extensions.fzy-native;
|
||||
in
|
||||
{
|
||||
options.programs.nixvim.plugins.telescope.extensions.fzy-native = {
|
||||
options.plugins.telescope.extensions.fzy-native = {
|
||||
enable = mkEnableOption "Enable fzy-native";
|
||||
|
||||
overrideGenericSorter = mkOption {
|
||||
|
@ -25,9 +25,9 @@ in
|
|||
override_file_sorter = cfg.overrideFileSorter;
|
||||
};
|
||||
in mkIf cfg.enable {
|
||||
programs.nixvim.extraPlugins = [ pkgs.vimPlugins.telescope-fzy-native-nvim ];
|
||||
extraPlugins = [ pkgs.vimPlugins.telescope-fzy-native-nvim ];
|
||||
|
||||
programs.nixvim.plugins.telescope.enabledExtensions = [ "fzy_native" ];
|
||||
programs.nixvim.plugins.telescope.extensionConfig."fzy_native" = configuration;
|
||||
plugins.telescope.enabledExtensions = [ "fzy_native" ];
|
||||
plugins.telescope.extensionConfig."fzy_native" = configuration;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
{ pkgs, config, lib, ... }:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.programs.nixvim.plugins.telescope.extensions.media_files;
|
||||
cfg = config.plugins.telescope.extensions.media_files;
|
||||
in
|
||||
{
|
||||
options.programs.nixvim.plugins.telescope.extensions.media_files = {
|
||||
options.plugins.telescope.extensions.media_files = {
|
||||
enable = mkEnableOption "Enable media_files extension for telescope";
|
||||
|
||||
filetypes = mkOption {
|
||||
|
@ -20,19 +20,16 @@ in
|
|||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
programs.nixvim = {
|
||||
plugins.telescope.enabledExtensions = [ "media_files" ];
|
||||
plugins.telescope.enabledExtensions = [ "media_files" ];
|
||||
|
||||
extraPlugins = with pkgs.vimPlugins; [
|
||||
popup-nvim
|
||||
plenary-nvim
|
||||
telescope-media-files-nvim
|
||||
];
|
||||
|
||||
extraPackages = with pkgs; [
|
||||
ueberzug
|
||||
];
|
||||
};
|
||||
extraPlugins = with pkgs.vimPlugins; [
|
||||
popup-nvim
|
||||
plenary-nvim
|
||||
telescope-media-files-nvim
|
||||
];
|
||||
|
||||
extraPackages = with pkgs; [
|
||||
ueberzug
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue