mirror of
https://github.com/NotAShelf/nvf.git
synced 2024-11-22 21:30:51 +00:00
Compare commits
6 commits
720459055a
...
c54fbb516e
Author | SHA1 | Date | |
---|---|---|---|
|
c54fbb516e | ||
|
7a5c75b865 | ||
|
1df720f86c | ||
|
e39d469da9 | ||
|
947cf90878 | ||
|
a07e113f3a |
5 changed files with 41 additions and 19 deletions
16
flake.nix
16
flake.nix
|
@ -21,6 +21,7 @@
|
||||||
./flake/legacyPackages.nix
|
./flake/legacyPackages.nix
|
||||||
./flake/overlays.nix
|
./flake/overlays.nix
|
||||||
./flake/packages.nix
|
./flake/packages.nix
|
||||||
|
./flake/develop.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
flake = {
|
flake = {
|
||||||
|
@ -56,20 +57,7 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
perSystem = {
|
perSystem = {pkgs, ...}: {
|
||||||
self',
|
|
||||||
config,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}: {
|
|
||||||
devShells = {
|
|
||||||
default = self'.devShells.lsp;
|
|
||||||
nvim-nix = pkgs.mkShell {packages = [config.packages.nix];};
|
|
||||||
lsp = pkgs.mkShell {
|
|
||||||
packages = with pkgs; [nil statix deadnix alejandra];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
# Provide the default formatter. `nix fmt` in project root
|
# Provide the default formatter. `nix fmt` in project root
|
||||||
# will format available files with the correct formatter.
|
# will format available files with the correct formatter.
|
||||||
# P.S: Please do not format with nixfmt! It messes with many
|
# P.S: Please do not format with nixfmt! It messes with many
|
||||||
|
|
30
flake/develop.nix
Normal file
30
flake/develop.nix
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
{lib, ...}: {
|
||||||
|
perSystem = {
|
||||||
|
pkgs,
|
||||||
|
config,
|
||||||
|
self',
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
devShells = {
|
||||||
|
default = self'.devShells.lsp;
|
||||||
|
nvim-nix = pkgs.mkShellNoCC {packages = [config.packages.nix];};
|
||||||
|
lsp = pkgs.mkShellNoCC {
|
||||||
|
packages = with pkgs; [nil statix deadnix alejandra];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# This package exists to make development easier by providing the place and
|
||||||
|
# boilerplate to build a test nvf configuration. Feel free to use this for
|
||||||
|
# testing, but make sure to discard the changes before creating a pull
|
||||||
|
# request.
|
||||||
|
packages.dev = let
|
||||||
|
configuration = {};
|
||||||
|
|
||||||
|
customNeovim = lib.nvim.neovimConfiguration {
|
||||||
|
inherit pkgs;
|
||||||
|
modules = [configuration];
|
||||||
|
};
|
||||||
|
in
|
||||||
|
customNeovim.neovim;
|
||||||
|
};
|
||||||
|
}
|
|
@ -10,6 +10,8 @@
|
||||||
inherit (lib.nvim.attrsets) mapListToAttrs;
|
inherit (lib.nvim.attrsets) mapListToAttrs;
|
||||||
inherit (builtins) attrNames typeOf tryEval concatStringsSep;
|
inherit (builtins) attrNames typeOf tryEval concatStringsSep;
|
||||||
|
|
||||||
|
borders = config.vim.ui.borders.plugins.nvim-cmp;
|
||||||
|
|
||||||
cfg = config.vim.autocomplete.nvim-cmp;
|
cfg = config.vim.autocomplete.nvim-cmp;
|
||||||
luasnipEnable = config.vim.snippets.luasnip.enable;
|
luasnipEnable = config.vim.snippets.luasnip.enable;
|
||||||
getPluginName = plugin:
|
getPluginName = plugin:
|
||||||
|
@ -81,10 +83,9 @@ in {
|
||||||
setupOpts = {
|
setupOpts = {
|
||||||
sources = map (s: {name = s;}) (attrNames cfg.sources);
|
sources = map (s: {name = s;}) (attrNames cfg.sources);
|
||||||
|
|
||||||
# TODO: try to get nvim-cmp to follow global border style
|
window = mkIf borders.enable {
|
||||||
window = mkIf config.vim.ui.borders.enable {
|
completion.border = borders.style;
|
||||||
completion = mkLuaInline "cmp.config.window.bordered()";
|
documentation.border = borders.style;
|
||||||
documentation = mkLuaInline "cmp.config.window.bordered()";
|
|
||||||
};
|
};
|
||||||
|
|
||||||
formatting.format = cfg.format;
|
formatting.format = cfg.format;
|
||||||
|
|
|
@ -72,7 +72,7 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
format = mkOption {
|
format = mkOption {
|
||||||
type = luaInline;
|
type = nullOr luaInline;
|
||||||
default = mkLuaInline ''
|
default = mkLuaInline ''
|
||||||
function(entry, vim_item)
|
function(entry, vim_item)
|
||||||
vim_item.menu = (${toLuaObject cfg.sources})[entry.source.name]
|
vim_item.menu = (${toLuaObject cfg.sources})[entry.source.name]
|
||||||
|
|
|
@ -93,6 +93,7 @@ in {
|
||||||
setup = {
|
setup = {
|
||||||
style ? "dark",
|
style ? "dark",
|
||||||
transparent ? false,
|
transparent ? false,
|
||||||
|
...
|
||||||
}: let
|
}: let
|
||||||
style' =
|
style' =
|
||||||
warnIf (style == "light") "oxocarbon: light theme is not well-supported" style;
|
warnIf (style == "light") "oxocarbon: light theme is not well-supported" style;
|
||||||
|
@ -117,6 +118,7 @@ in {
|
||||||
setup = {
|
setup = {
|
||||||
style ? "dark",
|
style ? "dark",
|
||||||
transparent ? false,
|
transparent ? false,
|
||||||
|
...
|
||||||
}: ''
|
}: ''
|
||||||
-- Gruvbox theme
|
-- Gruvbox theme
|
||||||
require("gruvbox").setup({
|
require("gruvbox").setup({
|
||||||
|
@ -152,6 +154,7 @@ in {
|
||||||
setup = {
|
setup = {
|
||||||
style ? "main",
|
style ? "main",
|
||||||
transparent ? false,
|
transparent ? false,
|
||||||
|
...
|
||||||
}: ''
|
}: ''
|
||||||
require("rose-pine").setup({
|
require("rose-pine").setup({
|
||||||
dark_variant = "${style}", -- main, moon, or dawn
|
dark_variant = "${style}", -- main, moon, or dawn
|
||||||
|
|
Loading…
Reference in a new issue