refactor: complete rewrite

This commit is contained in:
ooks-io 2024-10-23 23:46:25 +13:00
parent 19a4bbda3c
commit 8e81943cf9
399 changed files with 3396 additions and 8042 deletions

View file

@ -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];
};
};
}

View file

@ -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;
};
}

View file

@ -0,0 +1,9 @@
{
imports = [
./settings.nix
./theme.nix
./keymaps.nix
./plugins
./modules
];
}

View file

@ -0,0 +1,5 @@
{
config.vim = {
globals.mapleader = " ";
};
}

View file

@ -0,0 +1,5 @@
{
imports = [
./plugins
];
}

View file

@ -0,0 +1,6 @@
{
imports = [
./gruvbox-material
./telescope
];
}

View file

@ -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}
'';
};
};
}

View file

@ -0,0 +1,5 @@
{
imports = [
./config.nix
];
}

View 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,
})
'';
};
}

View file

@ -0,0 +1,5 @@
{
imports = [
./config.nix
];
}

View file

@ -0,0 +1,5 @@
{
vim.autocomplete.nvim-cmp = {
enable = true;
};
}

View file

@ -0,0 +1,5 @@
{
vim.comments = {
comment-nvim.enable = true;
};
}

View 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
];
}

View 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>";
};
}

View file

@ -0,0 +1,9 @@
{
vim.git = {
enable = true;
gitsigns = {
enable = true;
codeActions.enable = false;
};
};
}

View file

@ -0,0 +1,5 @@
{
vim.languages.bash = {
enable = true;
};
}

View file

@ -0,0 +1,6 @@
{
vim.languages.css = {
enable = true;
format.enable = true;
};
}

View 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;
};
}

View file

@ -0,0 +1,5 @@
{
vim.languages.html = {
enable = true;
};
}

View file

@ -0,0 +1,8 @@
{
vim.lsp = {
formatOnSave = true;
lspkind.enable = true;
lspSignature.enable = true;
trouble = {enable = true;};
};
}

View file

@ -0,0 +1,11 @@
{
vim = {
languages.markdown = {
enable = true;
format = true;
};
utility = {
preview.markdownPreview = {enable = true;};
};
};
}

View file

@ -0,0 +1,5 @@
{
vim.languages.nix = {
enable = true;
};
}

View file

@ -0,0 +1,11 @@
{pkgs, ...}: {
vim.treesitter = {
enable = true;
fold = true;
grammars = with pkgs.vimPlugins.nvim-treesitter.builtGrammars; [
kdl
regex
fish
];
};
}

View file

@ -0,0 +1,5 @@
{
vim.languages.ts = {
enable = true;
};
}

View file

@ -0,0 +1,16 @@
{
vim.projects = {
project-nvim = {
enable = true;
setupOpts = {
manualMode = false;
detectionMethods = ["lsp" "pattern"];
patterns = [
".git"
"index.*"
"flake.nix"
];
};
};
};
}

View file

@ -0,0 +1,5 @@
{
vim.snippets.luasnip = {
enable = true;
};
}

View 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' },
}
}
''
];
};
};
}

View 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;
};
};
}

View file

@ -0,0 +1,11 @@
{
vim.terminal = {
toggleterm = {
enable = true;
lazygit = {
enable = true;
direction = "float";
};
};
};
}

View 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;
};
};
};
};
};
}

View file

@ -0,0 +1,5 @@
{
vim.binds.whichKey = {
enable = true;
};
}

View 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
# ''
#
# '';
}

View 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 })
'';
};
}