refactor: complete rewrite
This commit is contained in:
parent
19a4bbda3c
commit
8e81943cf9
399 changed files with 3396 additions and 8042 deletions
|
|
@ -1,8 +1,12 @@
|
|||
{
|
||||
perSystem = {pkgs, ...}: {
|
||||
{ook, ...}: {
|
||||
perSystem = {pkgs, ...}: let
|
||||
inherit (ook.lib) mkNeovim;
|
||||
ook-vim-config = import ./ook-vim;
|
||||
in {
|
||||
packages = {
|
||||
live-buds-cli = pkgs.callPackage ./live-buds-cli {};
|
||||
repopack = pkgs.callPackage ./repopack {};
|
||||
live-buds-cli = pkgs.callPackage ./live-buds-cli {};
|
||||
ook-vim = mkNeovim pkgs [ook-vim-config];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,14 +18,14 @@ rustPlatform.buildRustPackage rec {
|
|||
sha256 = "A4XQiJrk4ehb6+935L2JFOeAhUJ7bdukV5mL0Jxn0sQ=";
|
||||
};
|
||||
|
||||
cargoSha256 = "w/dt7Q9TACw5N/+QNAKMUEngf8sAhWyGslnw3B16crQ=";
|
||||
cargoHash = "sha256-w/dt7Q9TACw5N/+QNAKMUEngf8sAhWyGslnw3B16crQ";
|
||||
|
||||
nativeBuildInputs = [pkg-config];
|
||||
buildInputs = [libpulseaudio bluez dbus];
|
||||
|
||||
meta = with lib; {
|
||||
meta = {
|
||||
description = "A free cli tool to control your Galaxy buds live, Galaxy Buds+, Galaxy Buds Pro, Galaxy Buds 2 and Galaxy Buds 2 Pro";
|
||||
license = licenses.gpl3;
|
||||
platforms = platforms.unix;
|
||||
license = lib.licenses.gpl3;
|
||||
platforms = lib.platforms.unix;
|
||||
};
|
||||
}
|
||||
|
|
|
|||
9
outputs/pkgs/ook-vim/default.nix
Normal file
9
outputs/pkgs/ook-vim/default.nix
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
imports = [
|
||||
./settings.nix
|
||||
./theme.nix
|
||||
./keymaps.nix
|
||||
./plugins
|
||||
./modules
|
||||
];
|
||||
}
|
||||
5
outputs/pkgs/ook-vim/keymaps.nix
Normal file
5
outputs/pkgs/ook-vim/keymaps.nix
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
config.vim = {
|
||||
globals.mapleader = " ";
|
||||
};
|
||||
}
|
||||
5
outputs/pkgs/ook-vim/modules/default.nix
Normal file
5
outputs/pkgs/ook-vim/modules/default.nix
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
imports = [
|
||||
./plugins
|
||||
];
|
||||
}
|
||||
6
outputs/pkgs/ook-vim/modules/plugins/default.nix
Normal file
6
outputs/pkgs/ook-vim/modules/plugins/default.nix
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
imports = [
|
||||
./gruvbox-material
|
||||
./telescope
|
||||
];
|
||||
}
|
||||
|
|
@ -0,0 +1,80 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
inputs,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkOption mkIf boolToString;
|
||||
inherit (lib.types) bool enum lines;
|
||||
inherit (inputs.nvf.lib.nvim.dag) entryAfter;
|
||||
|
||||
cfg = config.vim.gruvbox-material;
|
||||
in {
|
||||
options.vim.gruvbox-material = {
|
||||
enable = mkOption {
|
||||
type = bool;
|
||||
description = "Enable gruvbox-material-theme";
|
||||
default = false;
|
||||
};
|
||||
contrast = mkOption {
|
||||
type = enum ["dark" "medium" "soft"];
|
||||
description = "Set contrast, can be any of 'hard', 'medium', 'soft'";
|
||||
default = "dark";
|
||||
};
|
||||
italics = mkOption {
|
||||
type = bool;
|
||||
description = "Enable italic comments";
|
||||
default = true;
|
||||
};
|
||||
transparent = mkOption {
|
||||
type = bool;
|
||||
description = "Set background to transparent";
|
||||
default = false;
|
||||
};
|
||||
floatForceBackground = mkOption {
|
||||
type = bool;
|
||||
description = "Force backgrounds on floats even when transparent = true";
|
||||
default = false;
|
||||
};
|
||||
signsHighlight = mkOption {
|
||||
type = bool;
|
||||
description = "Enable sign highlighting";
|
||||
default = true;
|
||||
};
|
||||
extraConfig = mkOption {
|
||||
type = lines;
|
||||
description = "Additional lua configuration after";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
vim = {
|
||||
startPlugins = [pkgs.vimPlugins.gruvbox-material-nvim];
|
||||
luaConfigRC.theme =
|
||||
entryAfter ["basic"]
|
||||
/*
|
||||
lua
|
||||
*/
|
||||
''
|
||||
require('gruvbox-material').setup{
|
||||
contrast = "${cfg.contrast}",
|
||||
comments = {
|
||||
italics = ${boolToString cfg.italics},
|
||||
},
|
||||
background = {
|
||||
transparent = ${boolToString cfg.transparent},
|
||||
},
|
||||
float = {
|
||||
force_background = ${boolToString cfg.floatForceBackground},
|
||||
background_color = nil,
|
||||
},
|
||||
signs = {
|
||||
highlight = ${boolToString cfg.signsHighlight},
|
||||
},
|
||||
}
|
||||
${cfg.extraConfig}
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
imports = [
|
||||
./config.nix
|
||||
];
|
||||
}
|
||||
55
outputs/pkgs/ook-vim/modules/plugins/telescope/config.nix
Normal file
55
outputs/pkgs/ook-vim/modules/plugins/telescope/config.nix
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
inputs,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf mkOption;
|
||||
inherit (lib.types) bool;
|
||||
inherit (inputs.nvf.lib.nvim.dag) entryAfter;
|
||||
cfg = config.vim.telescope;
|
||||
in {
|
||||
options.vim.telescope = {
|
||||
autostart = mkOption {
|
||||
type = bool;
|
||||
default = false;
|
||||
description = "Auto start telescope when opening neovim unless opening a file";
|
||||
};
|
||||
};
|
||||
config = mkIf cfg.autostart {
|
||||
vim.luaConfigRC.telescope-autostart =
|
||||
entryAfter ["pluginConfigs"]
|
||||
#lua
|
||||
''
|
||||
local find_files_hijack_netrw = vim.api.nvim_create_augroup("find_files_hijack_netrw", { clear = true })
|
||||
-- clear FileExplorer appropriately to prevent netrw from launching on folders
|
||||
-- netrw may or may not be loaded before telescope-find-files
|
||||
-- conceptual credits to nvim-tree and telescope-file-browser
|
||||
vim.api.nvim_create_autocmd("VimEnter", {
|
||||
pattern = "*",
|
||||
once = true,
|
||||
callback = function()
|
||||
pcall(vim.api.nvim_clear_autocmds, { group = "FileExplorer" })
|
||||
end,
|
||||
})
|
||||
vim.api.nvim_create_autocmd("BufEnter", {
|
||||
group = find_files_hijack_netrw,
|
||||
pattern = "*",
|
||||
callback = function()
|
||||
vim.schedule(function()
|
||||
-- Early return if netrw or not a directory
|
||||
if vim.bo[0].filetype == "netrw" or vim.fn.isdirectory(vim.fn.expand("%:p")) == 0 then
|
||||
return
|
||||
end
|
||||
|
||||
vim.api.nvim_buf_set_option(0, "bufhidden", "wipe")
|
||||
|
||||
require("telescope.builtin").find_files({
|
||||
cwd = vim.fn.expand("%:p:h"),
|
||||
})
|
||||
end)
|
||||
end,
|
||||
})
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
imports = [
|
||||
./config.nix
|
||||
];
|
||||
}
|
||||
5
outputs/pkgs/ook-vim/plugins/cmp.nix
Normal file
5
outputs/pkgs/ook-vim/plugins/cmp.nix
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
vim.autocomplete.nvim-cmp = {
|
||||
enable = true;
|
||||
};
|
||||
}
|
||||
5
outputs/pkgs/ook-vim/plugins/comments.nix
Normal file
5
outputs/pkgs/ook-vim/plugins/comments.nix
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
vim.comments = {
|
||||
comment-nvim.enable = true;
|
||||
};
|
||||
}
|
||||
15
outputs/pkgs/ook-vim/plugins/default.nix
Normal file
15
outputs/pkgs/ook-vim/plugins/default.nix
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
{
|
||||
imports = [
|
||||
./telescope.nix
|
||||
./filetree.nix
|
||||
./cmp.nix
|
||||
./terminal.nix
|
||||
./git.nix
|
||||
./projects.nix
|
||||
./utility.nix
|
||||
./ui.nix
|
||||
./languages
|
||||
./statusline.nix
|
||||
./snippets.nix
|
||||
];
|
||||
}
|
||||
17
outputs/pkgs/ook-vim/plugins/filetree.nix
Normal file
17
outputs/pkgs/ook-vim/plugins/filetree.nix
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
vim.filetree = {
|
||||
neo-tree = {
|
||||
enable = true;
|
||||
setupOpts = {
|
||||
filesystem = {
|
||||
hijack_netrw_behavior = "open_current";
|
||||
follow_current_file.enabled = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
vim.maps.normal."<C-e>" = {
|
||||
desc = "Toggle Tree";
|
||||
action = "<cmd>Neotree toggle reveal<cr>";
|
||||
};
|
||||
}
|
||||
9
outputs/pkgs/ook-vim/plugins/git.nix
Normal file
9
outputs/pkgs/ook-vim/plugins/git.nix
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
vim.git = {
|
||||
enable = true;
|
||||
gitsigns = {
|
||||
enable = true;
|
||||
codeActions.enable = false;
|
||||
};
|
||||
};
|
||||
}
|
||||
5
outputs/pkgs/ook-vim/plugins/languages/bash.nix
Normal file
5
outputs/pkgs/ook-vim/plugins/languages/bash.nix
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
vim.languages.bash = {
|
||||
enable = true;
|
||||
};
|
||||
}
|
||||
6
outputs/pkgs/ook-vim/plugins/languages/css.nix
Normal file
6
outputs/pkgs/ook-vim/plugins/languages/css.nix
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
vim.languages.css = {
|
||||
enable = true;
|
||||
format.enable = true;
|
||||
};
|
||||
}
|
||||
19
outputs/pkgs/ook-vim/plugins/languages/default.nix
Normal file
19
outputs/pkgs/ook-vim/plugins/languages/default.nix
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
imports = [
|
||||
./nix.nix
|
||||
./lsp.nix
|
||||
./bash.nix
|
||||
./treesitter.nix
|
||||
./html.nix
|
||||
./ts.nix
|
||||
];
|
||||
|
||||
vim.languages = {
|
||||
enableLSP = true;
|
||||
enableTreesitter = true;
|
||||
enableFormat = true;
|
||||
enableExtraDiagnostics = true;
|
||||
|
||||
typst.enable = true;
|
||||
};
|
||||
}
|
||||
5
outputs/pkgs/ook-vim/plugins/languages/html.nix
Normal file
5
outputs/pkgs/ook-vim/plugins/languages/html.nix
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
vim.languages.html = {
|
||||
enable = true;
|
||||
};
|
||||
}
|
||||
8
outputs/pkgs/ook-vim/plugins/languages/lsp.nix
Normal file
8
outputs/pkgs/ook-vim/plugins/languages/lsp.nix
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
vim.lsp = {
|
||||
formatOnSave = true;
|
||||
lspkind.enable = true;
|
||||
lspSignature.enable = true;
|
||||
trouble = {enable = true;};
|
||||
};
|
||||
}
|
||||
11
outputs/pkgs/ook-vim/plugins/languages/markdown.nix
Normal file
11
outputs/pkgs/ook-vim/plugins/languages/markdown.nix
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
vim = {
|
||||
languages.markdown = {
|
||||
enable = true;
|
||||
format = true;
|
||||
};
|
||||
utility = {
|
||||
preview.markdownPreview = {enable = true;};
|
||||
};
|
||||
};
|
||||
}
|
||||
5
outputs/pkgs/ook-vim/plugins/languages/nix.nix
Normal file
5
outputs/pkgs/ook-vim/plugins/languages/nix.nix
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
vim.languages.nix = {
|
||||
enable = true;
|
||||
};
|
||||
}
|
||||
11
outputs/pkgs/ook-vim/plugins/languages/treesitter.nix
Normal file
11
outputs/pkgs/ook-vim/plugins/languages/treesitter.nix
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
{pkgs, ...}: {
|
||||
vim.treesitter = {
|
||||
enable = true;
|
||||
fold = true;
|
||||
grammars = with pkgs.vimPlugins.nvim-treesitter.builtGrammars; [
|
||||
kdl
|
||||
regex
|
||||
fish
|
||||
];
|
||||
};
|
||||
}
|
||||
5
outputs/pkgs/ook-vim/plugins/languages/ts.nix
Normal file
5
outputs/pkgs/ook-vim/plugins/languages/ts.nix
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
vim.languages.ts = {
|
||||
enable = true;
|
||||
};
|
||||
}
|
||||
16
outputs/pkgs/ook-vim/plugins/projects.nix
Normal file
16
outputs/pkgs/ook-vim/plugins/projects.nix
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
vim.projects = {
|
||||
project-nvim = {
|
||||
enable = true;
|
||||
setupOpts = {
|
||||
manualMode = false;
|
||||
detectionMethods = ["lsp" "pattern"];
|
||||
patterns = [
|
||||
".git"
|
||||
"index.*"
|
||||
"flake.nix"
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
5
outputs/pkgs/ook-vim/plugins/snippets.nix
Normal file
5
outputs/pkgs/ook-vim/plugins/snippets.nix
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
vim.snippets.luasnip = {
|
||||
enable = true;
|
||||
};
|
||||
}
|
||||
52
outputs/pkgs/ook-vim/plugins/statusline.nix
Normal file
52
outputs/pkgs/ook-vim/plugins/statusline.nix
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
{
|
||||
vim.statusline.lualine = {
|
||||
enable = true;
|
||||
activeSection = {
|
||||
a = [
|
||||
#lua
|
||||
''
|
||||
{
|
||||
"mode",
|
||||
icons_enabled = true,
|
||||
seperator = {left = "", right = " ", }
|
||||
}
|
||||
''
|
||||
#lua
|
||||
''
|
||||
{
|
||||
draw_empty = true,
|
||||
seperator = { left = " ", right = " " }
|
||||
}
|
||||
''
|
||||
];
|
||||
b = [
|
||||
#lua
|
||||
''
|
||||
{
|
||||
"",
|
||||
draw_empty = true,
|
||||
}
|
||||
''
|
||||
];
|
||||
c = ["filename"];
|
||||
x = [
|
||||
# lua
|
||||
''
|
||||
{
|
||||
"diagnostics",
|
||||
sources = {'nvim_lsp', 'nvim_diagnostic', 'nvim_diagnostic', 'vim_lsp'},
|
||||
symbols = {error = ' ', warn = ' ', info = ' ', hint = ' '},
|
||||
colored = true,
|
||||
update_in_insert = false,
|
||||
always_visible = false,
|
||||
diagnostics_color = {
|
||||
color_error = { fg = 'red' },
|
||||
color_warn = { fg = 'yellow' },
|
||||
color_info = { fg = 'cyan' },
|
||||
}
|
||||
}
|
||||
''
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
16
outputs/pkgs/ook-vim/plugins/telescope.nix
Normal file
16
outputs/pkgs/ook-vim/plugins/telescope.nix
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
vim.telescope = {
|
||||
enable = true;
|
||||
mappings = {
|
||||
findFiles = "<leader>ff";
|
||||
liveGrep = "<leader>/";
|
||||
|
||||
open = null;
|
||||
gitCommits = null;
|
||||
gitBufferCommits = null;
|
||||
gitBranches = null;
|
||||
gitStatus = null;
|
||||
gitStash = null;
|
||||
};
|
||||
};
|
||||
}
|
||||
11
outputs/pkgs/ook-vim/plugins/terminal.nix
Normal file
11
outputs/pkgs/ook-vim/plugins/terminal.nix
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
vim.terminal = {
|
||||
toggleterm = {
|
||||
enable = true;
|
||||
lazygit = {
|
||||
enable = true;
|
||||
direction = "float";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
35
outputs/pkgs/ook-vim/plugins/ui.nix
Normal file
35
outputs/pkgs/ook-vim/plugins/ui.nix
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
{
|
||||
vim = {
|
||||
ui = {
|
||||
borders = {
|
||||
enable = true;
|
||||
globalStyle = "single";
|
||||
};
|
||||
|
||||
# better cmd line
|
||||
noice.enable = true;
|
||||
|
||||
colorizer.enable = true;
|
||||
illuminate.enable = true;
|
||||
};
|
||||
# < https://github.com/NotAShelf/nvf/tree/main/modules/plugins/visuals >
|
||||
visuals = {
|
||||
enable = true;
|
||||
|
||||
# icons that other plugins depend on.
|
||||
nvimWebDevicons.enable = true;
|
||||
fidget-nvim.enable = true;
|
||||
|
||||
# indent lines
|
||||
indentBlankline = {
|
||||
enable = true;
|
||||
setupOpts = {
|
||||
scope = {
|
||||
enabled = false;
|
||||
injected_languages = false;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
5
outputs/pkgs/ook-vim/plugins/utility.nix
Normal file
5
outputs/pkgs/ook-vim/plugins/utility.nix
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
vim.binds.whichKey = {
|
||||
enable = true;
|
||||
};
|
||||
}
|
||||
23
outputs/pkgs/ook-vim/settings.nix
Normal file
23
outputs/pkgs/ook-vim/settings.nix
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
{pkgs, ...}: {
|
||||
vim = {
|
||||
package = pkgs.neovim-unwrapped;
|
||||
leaderKey = " ";
|
||||
tabWidth = 2;
|
||||
autoIndent = true;
|
||||
searchCase = "smart";
|
||||
enableLuaLoader = true;
|
||||
enableEditorconfig = true;
|
||||
useSystemClipboard = true;
|
||||
autopairs.nvim-autopairs.enable = true;
|
||||
hideSearchHighlight = true;
|
||||
theme = {
|
||||
enable = false;
|
||||
};
|
||||
};
|
||||
# Additional sets can be added here
|
||||
# vim.luaConfigRC.basic =
|
||||
# entryAfter ["entryAfter"] #lua
|
||||
# ''
|
||||
#
|
||||
# '';
|
||||
}
|
||||
20
outputs/pkgs/ook-vim/theme.nix
Normal file
20
outputs/pkgs/ook-vim/theme.nix
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
vim.gruvbox-material = {
|
||||
enable = true;
|
||||
contrast = "medium";
|
||||
italics = false;
|
||||
transparent = false;
|
||||
extraConfig =
|
||||
# lua
|
||||
''
|
||||
local g_colors = require("gruvbox-material.colors")
|
||||
local colors = g_colors.get(vim.o.background, "soft")
|
||||
|
||||
-- Noice
|
||||
vim.api.nvim_set_hl(0, "NoiceCmdlinePopupBorderHelp", { fg = colors.yellow })
|
||||
vim.api.nvim_set_hl(0, "NoiceCmdlinePopupBorder", { fg = colors.grey1 })
|
||||
vim.api.nvim_set_hl(0, "NoiceCmdlineIcon", { fg = colors.green })
|
||||
vim.api.nvim_set_hl(0, "NoiceCmdLinePopupTitle", { fg = colors.grey1 })
|
||||
'';
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue