From 2ac5d0321b45ff38a962b1ab59dc65a5a4901898 Mon Sep 17 00:00:00 2001 From: Dennis Date: Tue, 3 Mar 2026 13:46:54 +0100 Subject: [PATCH] sets up basic structure --- flake.nix | 30 +- modules/config.nix | 20 ++ modules/hosts/dnsc-air.nix | 36 +++ modules/neovim/colorscheme.nix | 16 ++ modules/neovim/completion.nix | 32 +++ modules/neovim/default.nix | 29 +- modules/neovim/editing.nix | 82 ++++++ modules/neovim/extraFiles/palette.lua | 33 +++ modules/neovim/extraFiles/winterly.lua | 368 +++++++++++++++++++++++++ modules/neovim/formatter.nix | 57 ++++ modules/neovim/git.nix | 33 +++ modules/neovim/keybindings.nix | 134 +++++++++ modules/neovim/lsp.nix | 202 ++++++++++++++ modules/neovim/options.nix | 52 ++++ modules/neovim/picker.nix | 174 ++++++++++++ modules/neovim/statusline.nix | 99 +++++++ modules/systems.nix | 7 - 17 files changed, 1368 insertions(+), 36 deletions(-) create mode 100644 modules/config.nix create mode 100644 modules/neovim/colorscheme.nix create mode 100644 modules/neovim/completion.nix create mode 100644 modules/neovim/editing.nix create mode 100644 modules/neovim/extraFiles/palette.lua create mode 100644 modules/neovim/extraFiles/winterly.lua create mode 100644 modules/neovim/formatter.nix create mode 100644 modules/neovim/git.nix create mode 100644 modules/neovim/keybindings.nix create mode 100644 modules/neovim/lsp.nix create mode 100644 modules/neovim/options.nix create mode 100644 modules/neovim/picker.nix create mode 100644 modules/neovim/statusline.nix delete mode 100644 modules/systems.nix diff --git a/flake.nix b/flake.nix index e341279..0c9ac25 100644 --- a/flake.nix +++ b/flake.nix @@ -1,12 +1,30 @@ { - description = "dnsc IaC config utilizing, Nix (flakes), NixOS, Nix Darwin and flake-parts"; - inputs = { - flake-parts.url = "github:hercules-ci/flake-parts"; - nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + flake-parts = { + inputs.nixpkgs-lib.follows = "nixpkgs-lib"; + url = "github:hercules-ci/flake-parts"; + }; + home-manager = { + inputs.nixpkgs.follows = "nixpkgs"; + url = "github:nix-community/home-manager"; + }; import-tree.url = "github:vic/import-tree"; - flake-file.url = "github:vic/flake-file"; + nix-darwin = { + inputs.nixpkgs.follows = "nixpkgs"; + url = "github:LnL7/nix-darwin/master"; + }; + nixpkgs.url = "https://channels.nixos.org/nixpkgs-unstable/nixexprs.tar.xz"; + nixpkgs-lib.follows = "nixpkgs"; + nixvim.url = "github:nix-community/nixvim"; }; - outputs = inputs: inputs.flake-parts.lib.mkFlake { inherit inputs; } (inputs.import-tree ./modules); + outputs = + inputs: + inputs.flake-parts.lib.mkFlake { + inherit inputs; + systems = [ + "aarch64-darwin" + "x86_64-linux" + ]; + } (inputs.import-tree ./modules); } diff --git a/modules/config.nix b/modules/config.nix new file mode 100644 index 0000000..5850750 --- /dev/null +++ b/modules/config.nix @@ -0,0 +1,20 @@ +{ lib, ... }: +{ + options.flake.globalConfig = { + username = lib.mkOption { + type = lib.types.str; + default = "dennis"; + description = "Primary username for the system"; + }; + fullname = lib.mkOption { + type = lib.types.str; + default = "Dennis Schoepf"; + description = "Full Name of the user"; + }; + email = lib.mkOption { + type = lib.types.str; + default = "me@dnsc.io"; + description = "Full Name of the user"; + }; + }; +} diff --git a/modules/hosts/dnsc-air.nix b/modules/hosts/dnsc-air.nix index e69de29..3da8700 100644 --- a/modules/hosts/dnsc-air.nix +++ b/modules/hosts/dnsc-air.nix @@ -0,0 +1,36 @@ +{ + inputs, + config, + ... +}: +let + username = config.flake.globalConfig.username; +in +{ + flake.darwinConfigurations.dnsc-air = inputs.nix-darwin.lib.darwinSystem { + system = "aarch64-darwin"; + specialArgs = { inherit inputs; }; + modules = [ + inputs.home-manager.darwinModules.home-manager + { + networking.hostName = "dnsc-air"; + networking.computerName = "dnsc-air"; + users.users.${username}.home = "/Users/${username}"; + nix.enable = false; + nix.settings.experimental-features = [ + "nix-command" + "flakes" + ]; + + home-manager = { + useGlobalPkgs = true; + backupFileExtension = "backup"; + users.${username} = { + imports = [ config.flake.modules.homeManager.neovim ]; + home.stateVersion = "24.11"; + }; + }; + } + ]; + }; +} diff --git a/modules/neovim/colorscheme.nix b/modules/neovim/colorscheme.nix new file mode 100644 index 0000000..5b8a799 --- /dev/null +++ b/modules/neovim/colorscheme.nix @@ -0,0 +1,16 @@ +{ ... }: +{ + flake.modules.homeManager.neovim-colorscheme = { + programs.nixvim = { + colorscheme = "winterly"; + + # Make palette available to this module but + # also for other configuration (e.g. lualine) + extraFiles."lua/dnsc/palette.lua".source = ./extraFiles/palette.lua; + + # Set custorscheme in neovims runtimepath so that neovim + # discovers it automatically + extraFiles."colors/winterly.lua".source = ./extraFiles/winterly.lua; + }; + }; +} diff --git a/modules/neovim/completion.nix b/modules/neovim/completion.nix new file mode 100644 index 0000000..ccbb93f --- /dev/null +++ b/modules/neovim/completion.nix @@ -0,0 +1,32 @@ +{ ... }: +{ + flake.modules.homeManager.neovim-completion = { + programs.nixvim.plugins.blink-cmp = { + enable = true; + settings = { + keymap = { + preset = "enter"; + "" = [ + "select_next" + "fallback" + ]; + "" = [ + "select_prev" + "fallback" + ]; + "" = [ + "select_and_accept" + ]; + "" = [ + "show_documentation" + "hide_documentation" + ]; + }; + appearance.nerd_font_variant = "mono"; + completion.documentation.auto_show = false; + signature.enabled = true; + cmdline.completion.menu.auto_show = true; + }; + }; + }; +} diff --git a/modules/neovim/default.nix b/modules/neovim/default.nix index 73e4c72..c5ffad7 100644 --- a/modules/neovim/default.nix +++ b/modules/neovim/default.nix @@ -1,34 +1,17 @@ { inputs, - lib, - config, + pkgs, ... }: - -with lib; - -let - cfg = config.neovim; -in { - options.neovim = { - enable = mkOption { - type = types.bool; - default = false; - description = "Enable neovim"; - }; - extraPackages = mkOption { - type = types.listOf types.package; - default = [ ]; - description = "Additional packages to install alongside neovim on the system."; - }; - }; - - flake-file.inputs.nixvim.url = "github:nix-community/nixvim"; flake.modules.homeManager.neovim = { imports = [ inputs.nixvim.homeModules.nixvim ]; programs.nixvim = { - enable = cfg.enable; + enable = true; + defaultEditor = true; + package = pkgs.neovim-unwrapped; + vimAlias = true; + vimdiffAlias = true; }; }; } diff --git a/modules/neovim/editing.nix b/modules/neovim/editing.nix new file mode 100644 index 0000000..f9775da --- /dev/null +++ b/modules/neovim/editing.nix @@ -0,0 +1,82 @@ +{ pkgs, ... }: +{ + flake.modules.homeManager.neovim-editing = { + programs.nixvim = { + plugins.sleuth.enable = true; + plugins.nvim-surround.enable = true; + plugins.flash.enable = true; + + plugins.blink-pairs = { + enable = true; + }; + + plugins.treesitter = { + enable = true; + highlight.enable = true; + indent.enable = true; + folding.enable = true; + + grammarPackages = with pkgs.vimPlugins.nvim-treesitter.builtGrammars; [ + angular + bash + css + html + javascript + jsdoc + json + lua + make + markdown + markdown_inline + go + gomod + gotmpl + python + styled + tsx + typescript + nix + regex + toml + vim + vimdoc + xml + yaml + ]; + }; + + plugins.substitute = { + enable = true; + luaConfig.post = /* lua */ '' + local sub = require("substitute") + vim.keymap.set("n", "s", sub.operator, { noremap = true }) + vim.keymap.set("n", "ss", sub.line, { noremap = true }) + vim.keymap.set("n", "S", sub.eol, { noremap = true }) + vim.keymap.set("x", "s", sub.visual, { noremap = true }) + ''; + }; + + extraPlugins = [ + pkgs.vimPlugins.vim-cool + ]; + + autoCmd = [ + { + callback.__raw = "function() vim.highlight.on_yank() end"; + event = [ + "TextYankPost" + ]; + } + { + event = [ "FileType" ]; + pattern = "qf"; + callback.__raw = /* lua */ '' + function() + vim.keymap.set("n", "", "", { buffer = true }) + end + ''; + } + ]; + }; + }; +} diff --git a/modules/neovim/extraFiles/palette.lua b/modules/neovim/extraFiles/palette.lua new file mode 100644 index 0000000..1ab3504 --- /dev/null +++ b/modules/neovim/extraFiles/palette.lua @@ -0,0 +1,33 @@ +return { + fg = "#ffffff", + fg_alt = "#bf8a9f", + fg_dim = "#807c9f", + bg = "#0f0b15", + bg_secondary = "#1d202f", + grey = "#807c9f", + grey_bright = "#807c9f", + red = "#f47359", + red_bright = "#ff6a7a", + red_subtle_bg = "#67182f", + green = "#29a444", + green_bright = "#00a392", + green_subtle_bg = "#10452f", + yellow = "#b58a52", + yellow_bright = "#df9080", + yellow_brighter = "#FCC1B6", + yellow_subtle_bg = "#54362a", + blue = "#3f95f6", + blue_bright = "#029fff", + blue_subtle_bg = "#2a346e", + blue_subtle_dark_bg = "#003045", + magenta = "#d369af", + magenta_bright = "#af85ea", + magenta_brighter = "#c57faf", + magenta_subtle_bg = "#572454", + magenta_subtle_bg_darker = "#331531", + cyan = "#4fbaef", + cyan_bright = "#35afbf", + cyan_subtle_bg = "#133d56", + silver = "#b8c6d5", + silver_bright = "#ffffff", +} diff --git a/modules/neovim/extraFiles/winterly.lua b/modules/neovim/extraFiles/winterly.lua new file mode 100644 index 0000000..d3b6a51 --- /dev/null +++ b/modules/neovim/extraFiles/winterly.lua @@ -0,0 +1,368 @@ +local palette = require("dnsc.palette") + +vim.cmd.highlight("clear") +vim.g.colors_name = "winterly" + +local hi = function(name, val) + -- Force links + val.force = true + + -- Make sure that `cterm` attribute is not populated from `gui` + val.cterm = val.cterm or {} ---@type vim.api.keyset.highlight + + -- Define global highlight + vim.api.nvim_set_hl(0, name, val) +end + +-- General +hi("Normal", { fg = palette.fg }) + +hi("Conceal", { fg = palette.silver, bg = palette.grey, ctermfg = "LightGrey", ctermbg = "DarkGrey" }) +hi("Cursor", { bg = palette.magenta_bright }) +hi("DiffText", { bg = palette.yellow_subtle_bg, bold = true, ctermbg = "DarkYellow", cterm = { bold = true } }) +hi("ErrorMsg", { fg = palette.red_bright, bg = palette.red_subtle_bg, ctermfg = "White", ctermbg = "DarkRed" }) +hi("IncSearch", { bg = palette.magenta_subtle_bg, fg = palette.magenta }) +hi("ModeMsg", { bold = true, cterm = { bold = true } }) +hi("NonText", { fg = palette.grey, ctermfg = "DarkGrey" }) +hi("PmenuSbar", { bg = palette.grey, ctermbg = "Grey" }) +hi("StatusLine", { reverse = true, bold = true, cterm = { reverse = true, bold = true } }) +hi("StatusLineNC", { reverse = true, cterm = { reverse = true } }) +hi("TabLineFill", { reverse = true, cterm = { reverse = true } }) +hi("TabLineSel", { bold = true, cterm = { bold = true } }) +hi("TermCursor", { reverse = true, cterm = { reverse = true } }) +hi("WinBar", { bold = true, cterm = { bold = true } }) +hi("WildMenu", { fg = palette.bg, bg = palette.yellow_subtle_bg, ctermfg = "Black", ctermbg = "Yellow" }) + +hi("VertSplit", { link = "Comment" }) +hi("WinSeparator", { link = "VertSplit" }) +hi("WinBarNC", { link = "WinBar" }) +hi("DiffTextAdd", { link = "DiffText" }) +hi("EndOfBuffer", { link = "NonText" }) +hi("LineNrAbove", { link = "LineNr" }) +hi("LineNrBelow", { link = "LineNr" }) +hi("QuickFixLine", { link = "Search" }) +hi("CursorLineSign", { link = "SignColumn" }) +hi("CursorLineFold", { link = "FoldColumn" }) +hi("CurSearch", { link = "Search" }) +hi("PmenuKind", { link = "Pmenu" }) +hi("PmenuKindSel", { link = "PmenuSel" }) +hi("PmenuMatch", { link = "Pmenu" }) +hi("PmenuMatchSel", { link = "PmenuSel" }) +hi("PmenuExtra", { link = "Pmenu" }) +hi("PmenuExtraSel", { link = "PmenuSel" }) +hi("PreInsert", { link = "Added" }) +hi("ComplMatchIns", {}) +hi("ComplHint", { link = "NonText" }) +hi("ComplHintMore", { link = "MoreMsg" }) +hi("Whitespace", { link = "NonText" }) +hi("MsgSeparator", { link = "StatusLine" }) +hi("NormalFloat", { link = "Pmenu" }) +hi("FloatBorder", { bg = palette.bg_secondary, fg = palette.fg_dim }) +hi("FloatTitle", { bg = palette.bg_secondary, fg = palette.fg, bold = true }) +hi("FloatFooter", { link = "Title" }) + +hi("FloatShadow", { bg = palette.bg, blend = 80 }) +hi("FloatShadowThrough", { bg = palette.bg, blend = 100 }) +hi("RedrawDebugNormal", { reverse = true, cterm = { reverse = true } }) +hi("RedrawDebugClear", { bg = palette.yellow_subtle_bg, ctermbg = "DarkYellow" }) +hi("RedrawDebugComposed", { bg = palette.green_subtle_bg, ctermbg = "DarkGreen" }) +hi("RedrawDebugRecompose", { bg = palette.red_subtle_bg, ctermbg = "DarkRed" }) +hi("Error", { link = "ErrorMsg" }) +hi("NvimInternalError", { link = "ErrorMsg" }) +hi("Todo", { fg = palette.blue_bright, bg = palette.blue_subtle_bg, ctermbg = "DarkBlue", ctermfg = "LightBlue" }) + +hi("String", { link = "Constant" }) +hi("Character", { link = "Constant" }) +hi("Number", { link = "Boolean" }) +hi("Boolean", { fg = palette.magenta_bright, bold = true }) +hi("Float", { link = "Number" }) +hi("Function", { link = "Identifier" }) +hi("Conditional", { link = "Statement" }) +hi("Repeat", { link = "Statement" }) +hi("Label", { link = "Statement" }) +hi("Operator", { fg = palette.fg_alt, italic = false, ctermfg = "White" }) +hi("Keyword", { link = "Statement" }) +hi("Exception", { link = "Statement" }) +hi("Include", { link = "PreProc" }) +hi("Define", { link = "PreProc" }) +hi("Macro", { link = "PreProc" }) +hi("PreCondit", { link = "PreProc" }) +hi("StorageClass", { link = "Type" }) +hi("Structure", { link = "Type" }) +hi("Typedef", { bold = true, fg = palette.yellow_brighter, ctermfg = "LightYellow" }) +hi("Tag", { link = "Special" }) +hi("SpecialChar", { link = "Special" }) +hi("Delimiter", { link = "Special" }) +hi("SpecialComment", { link = "Special" }) +hi("Debug", { link = "Special" }) + +hi("DiagnosticError", { fg = palette.red_bright, ctermfg = 1 }) +hi("DiagnosticWarn", { fg = palette.yellow, ctermfg = 3 }) +hi("DiagnosticInfo", { fg = palette.cyan, ctermfg = 4 }) +hi("DiagnosticHint", { fg = palette.silver, ctermfg = 7 }) +hi("DiagnosticOk", { fg = palette.green_bright, ctermfg = 10 }) +hi("DiagnosticUnderlineError", { fg = palette.red_bright, undercurl = true, cterm = { underline = true } }) +hi("DiagnosticUnderlineWarn", { fg = palette.yellow, undercurl = true, cterm = { underline = true } }) +hi("DiagnosticUnderlineInfo", { fg = palette.cyan, undercurl = true, cterm = { underline = true } }) +hi("DiagnosticUnderlineHint", { fg = palette.silver, undercurl = true, cterm = { underline = true } }) +hi("DiagnosticUnderlineOk", { fg = palette.green_bright, undercurl = true, cterm = { underline = true } }) +hi("DiagnosticVirtualTextError", { link = "DiagnosticError" }) +hi("DiagnosticVirtualTextWarn", { link = "DiagnosticWarn" }) +hi("DiagnosticVirtualTextInfo", { link = "DiagnosticInfo" }) +hi("DiagnosticVirtualTextHint", { link = "DiagnosticHint" }) +hi("DiagnosticVirtualTextOk", { link = "DiagnosticOk" }) +hi("DiagnosticFloatingError", { link = "DiagnosticError" }) +hi("DiagnosticFloatingWarn", { link = "DiagnosticWarn" }) +hi("DiagnosticFloatingInfo", { link = "DiagnosticInfo" }) +hi("DiagnosticFloatingHint", { link = "DiagnosticHint" }) +hi("DiagnosticFloatingOk", { link = "DiagnosticOk" }) +hi("DiagnosticSignError", { link = "DiagnosticError" }) +hi("DiagnosticSignWarn", { link = "DiagnosticWarn" }) +hi("DiagnosticSignInfo", { link = "DiagnosticInfo" }) +hi("DiagnosticSignHint", { link = "DiagnosticHint" }) +hi("DiagnosticSignOk", { link = "DiagnosticOk" }) +hi("DiagnosticDeprecated", { fg = palette.red, strikethrough = true, cterm = { strikethrough = true } }) + +hi("DiagnosticUnnecessary", { link = "Unused" }) +hi("LspInlayHint", { link = "NonText" }) +hi("SnippetTabstop", { link = "Visual" }) +hi("SnippetTabstopActive", { link = "SnippetTabstop" }) + +-- Text +hi("@markup.raw", { link = "Special" }) +hi("@markup.link", { link = "Identifier" }) +hi("@markup.link.label", { link = "ConstantUnderlined" }) +hi("@markup.heading", { link = "Title" }) +hi("@markup.heading.gitcommit", { bg = palette.bg, fg = palette.fg, bold = true }) +hi("@markup.link.url", { link = "Underlined" }) +hi("@markup.underline", { link = "Underlined" }) +hi("@comment.todo", { link = "Todo" }) + +-- Miscs +hi("@comment", { link = "Comment" }) +hi("@punctuation", { link = "Delimiter" }) + +-- Constants +hi("@constant", { link = "Constant" }) +hi("@constant.builtin", { link = "Special" }) +hi("@constant.macro", { link = "Define" }) +hi("@keyword.directive", { link = "Define" }) +hi("@string", { link = "String" }) +hi("@string.escape", { link = "SpecialChar" }) +hi("@string.special", { link = "SpecialChar" }) +hi("@character", { link = "Character" }) +hi("@character.special", { link = "SpecialChar" }) +hi("@number", { link = "Number" }) +hi("@boolean", { link = "Boolean" }) +hi("@number.float", { link = "Float" }) + +-- Functions +hi("@function", { link = "Function" }) +hi("@function.builtin", { link = "Special" }) +hi("@function.macro", { link = "Macro" }) +hi("@function.method", { link = "Function" }) +hi("@variable.parameter", { link = "Identifier" }) +hi("@variable.parameter.builtin", { link = "Special" }) +hi("@variable.member", { link = "Identifier" }) +hi("@property", { link = "Identifier" }) +hi("@attribute", { link = "Macro" }) +hi("@attribute.builtin", { link = "Special" }) +hi("@constructor", { link = "Special" }) + +-- Keywords +hi("@keyword.conditional", { link = "Conditional" }) +hi("@keyword.repeat", { link = "Repeat" }) +hi("@keyword.type", { link = "Structure" }) +hi("@label", { link = "Label" }) +hi("@operator", { link = "Operator" }) +hi("@keyword", { link = "Keyword" }) +hi("@keyword.exception", { link = "Exception" }) + +hi("@variable", { link = "Identifier" }) +hi("@type", { link = "Type" }) +hi("@type.builtin", { link = "Type" }) +hi("@type.definition", { link = "Typedef" }) +hi("@module", { link = "Identifier" }) +hi("@keyword.import", { link = "Include" }) +hi("@keyword.directive", { link = "PreProc" }) +hi("@keyword.debug", { link = "Debug" }) +hi("@tag", { link = "Tag" }) +hi("@tag.tsx", { link = "Identifier" }) +hi("@tag.builtin", { link = "Special" }) + +-- LSP semantic tokens +hi("@lsp.type.class", { link = "Structure" }) +hi("@lsp.type.comment", { link = "Comment" }) +hi("@lsp.type.decorator", { link = "Function" }) +hi("@lsp.type.enum", { link = "Structure" }) +hi("@lsp.type.enumMember", { link = "Constant" }) +hi("@lsp.type.function", { link = "Function" }) +hi("@lsp.type.interface", { link = "Structure" }) +hi("@lsp.type.macro", { link = "Macro" }) +hi("@lsp.type.method", { link = "Function" }) +hi("@lsp.type.namespace", { link = "Structure" }) +hi("@lsp.type.parameter", { link = "Identifier" }) +hi("@lsp.type.property", { link = "Identifier" }) +hi("@lsp.type.struct", { link = "Structure" }) +hi("@lsp.type.type", { link = "Type" }) +hi("@lsp.type.typeParameter", { link = "TypeDef" }) +hi("@lsp.type.variable", { link = "Identifier" }) +hi("@lsp.typemod.keyword.documentation", { fg = palette.grey, bold = true }) + +if vim.o.background == "light" then +-- TODO: Define light scheme +else + -- Default colors only used with a dark background. + hi("ColorColumn", { bg = palette.red_subtle_bg, ctermbg = "DarkRed" }) + hi("CursorColumn", { bg = palette.grey, ctermbg = "DarkGrey" }) + hi("CursorLine", { bg = palette.magenta_subtle_bg_darker, cterm = { underline = true } }) + hi("CursorLineNr", { + fg = palette.fg, + bg = palette.magenta_subtle_bg_darker, + bold = true, + ctermfg = "White", + cterm = { underline = true }, + }) + hi("DiffAdd", { fg = palette.green_bright, bg = palette.green_subtle_bg, ctermbg = "DarkGreen" }) + hi("DiffChange", { fg = palette.yellow_brighter, bg = palette.yellow_subtle_bg, ctermbg = "DarkYellow" }) + hi("DiffDelete", { fg = palette.red_bright, bg = palette.red_subtle_bg, ctermbg = "DarkRed" }) + hi("Directory", { fg = palette.magenta, bold = true, ctermfg = "Magenta" }) + hi("FoldColumn", { fg = palette.cyan_bright, bg = palette.grey, ctermfg = "Cyan", ctermbg = "DarkGrey" }) + hi("Folded", { fg = palette.cyan_bright, bg = palette.grey, ctermfg = "Cyan", ctermbg = "DarkGrey" }) + hi("LineNr", { fg = palette.grey_bright, ctermfg = "Grey" }) + hi( + "MatchParen", + { fg = palette.fg_alt, bg = palette.magenta_subtle_bg, ctermbg = "DarkMagenta", ctermfg = "Black" } + ) + hi("MoreMsg", { fg = palette.grey, ctermfg = "DarkGrey" }) + hi("Pmenu", { bg = palette.bg_secondary, ctermfg = "White", ctermbg = "Black" }) + hi("PmenuSel", { + bg = palette.magenta_subtle_bg, + fg = palette.fg, + bold = true, + ctermfg = "LightMagenta", + ctermbg = "DarkMagenta", + }) + hi("PmenuThumb", { bg = palette.fg, ctermbg = "White" }) + hi("Question", { fg = palette.green_bright, bold = true, ctermfg = "LightGreen" }) + hi("Search", { link = "IncSearch" }) + hi("Substitute", { + fg = palette.green_bright, + bg = palette.green_subtle_bg, + bold = true, + ctermfg = "DarkBlue", + ctermbg = "LightBlue", + }) + hi("SignColumn", { fg = palette.grey_bright, bg = palette.bg, ctermfg = "Cyan", ctermbg = "DarkGrey" }) + hi("SpecialKey", { fg = palette.cyan_bright, ctermfg = "LightBlue" }) + hi("SpellBad", { fg = palette.red, undercurl = true, ctermbg = "Red" }) + hi("SpellCap", { fg = palette.blue, undercurl = true, ctermbg = "Blue" }) + hi("SpellLocal", { fg = palette.cyan, undercurl = true, ctermbg = "Cyan" }) + hi("SpellRare", { fg = palette.magenta, undercurl = true, ctermbg = "Magenta" }) + hi("StatusLineTerm", { + fg = palette.bg, + bg = palette.green_bright, + bold = true, + ctermfg = "Black", + ctermbg = "LightGreen", + cterm = { bold = true }, + }) + hi("StatusLineTermNC", { fg = palette.bg, bg = palette.green_bright, ctermfg = "Black", ctermbg = "LightGreen" }) + hi( + "TabLine", + { bg = palette.grey, underline = true, ctermfg = "White", ctermbg = "DarkGrey", cterm = { underline = true } } + ) + hi("Title", { fg = palette.magenta_bright, bold = true, ctermfg = "Magenta" }) + hi("Visual", { + fg = palette.magenta_brighter, + bg = palette.magenta_subtle_bg, + ctermfg = "LightMagenta", + ctermbg = "DarkMagenta", + }) + hi("WarningMsg", { fg = palette.red_bright, ctermfg = "LightRed" }) + hi("Comment", { fg = palette.grey, ctermfg = "Cyan" }) + hi("Unused", { fg = palette.grey_bright, undercurl = true, ctermfg = "LightGrey" }) + hi("Constant", { fg = palette.yellow_brighter, ctermfg = "LightYellow" }) + hi("ConstantUnderlined", { fg = palette.yellow_brighter, underline = true, ctermfg = "LightYellow" }) + hi("Special", { fg = palette.silver, ctermfg = "LightGrey" }) + hi("Identifier", { fg = palette.fg, ctermfg = "White", cterm = { bold = true } }) + hi("Statement", { fg = palette.fg_alt, bold = true, ctermfg = "White" }) + hi("PreProc", { fg = palette.magenta, ctermfg = "LightMagenta" }) + hi("Type", { fg = palette.silver, bold = true, ctermfg = "LightCyan" }) + hi("Underlined", { fg = palette.silver, underline = true, ctermfg = "LightGrey", cterm = { underline = true } }) + hi("Ignore", { fg = palette.bg, ctermfg = "Black" }) + hi( + "Added", + { fg = palette.green_bright, bg = palette.green_subtle_bg, ctermfg = "LightGreen", ctermbg = "DarkGreen" } + ) + hi( + "Changed", + { fg = palette.blue_bright, bg = palette.blue_subtle_bg, ctermfg = "LightBlue", ctermbg = "DarkBlue" } + ) + hi("Removed", { fg = palette.red_bright, bg = palette.red_subtle_bg, ctermfg = "LightRed", ctermbg = "DarkRed" }) + hi("NotificationInfo", { fg = palette.silver, bg = palette.bg, ctermfg = "White", ctermbg = "Black" }) + + -- Snacks + hi("SnacksIndentScope", { fg = palette.magenta, ctermfg = "LightGrey" }) + hi("SnacksIndent", { fg = palette.magenta_subtle_bg, ctermfg = "DarkGrey" }) + hi( + "SnacksPickerCursorLine", + { bg = palette.magenta_subtle_bg, fg = palette.fg, bold = true, cterm = { underline = true } } + ) + hi("SnacksPickerListCursorLine", { link = "SnacksPickerCursorLine" }) + hi("SnacksPickerTitle", { link = "FloatTitle" }) + hi("SnacksBackdrop", { link = "Pmenu" }) + + -- Flash + hi("FlashMatch", { reverse = true }) + hi("FlashLabel", { bg = palette.fg, fg = palette.bg }) + + -- FzfLua + hi("FzfLuaNormal", { link = "Pmenu" }) + hi("FzfLuaBorder", { link = "Pmenu" }) + hi("FzfLuaTitle", { link = "Pmenu" }) + hi("FzfLuaBackdrop", { link = "Pmenu" }) + hi("FzfLuaPreviewNormal", { link = "FzfLuaNormal" }) + hi("FzfLuaPreviewBorder", { link = "FzfLuaBorder" }) + hi("FzfLuaPreviewTitle", { link = "FzfLuaTitle" }) + hi( + "FzfLuaCursorLine", + { bg = palette.magenta_subtle_bg, fg = palette.fg, bold = true, cterm = { underline = true } } + ) + hi("FzfLuaTitleFlags", { link = "FzfLuaCursorLine" }) + hi("FzfLuaCursorLineNr", { link = "FzfLuaCursorLine" }) + hi("FzfLuaHeaderBind", { link = "Pmenu" }) + hi("FzfLuaHeaderText", { link = "Comment" }) + hi("FzfLuaPathLineNr", { link = "Pmenu" }) + hi("FzfLuaPathColNr", { link = "Pmenu" }) + hi("FzfLuaLivePrompt", { link = "Pmenu" }) + hi("FzfLuaCmdBuf", { link = "Comment" }) + hi("FzfLuaBufName", { link = "Pmenu" }) + hi("FzfLuaBufId", { link = "Special" }) + hi("FzfLuaBufLineNr", { link = "Special" }) + hi("FzfLuaBufFlagCur", { link = "Pmenu" }) + hi("FzfLuaBufFlagAlt", { link = "Comment" }) + + -- Blinkpairs + hi("BlinkPairsOrange", { link = "Comment" }) + hi("BlinkPairsPurple", { fg = palette.magenta_brighter }) + hi("BlinkPairsBlue", { fg = palette.magenta_bright }) + + -- Neogit + hi("NeogitDiffAdd", { link = "DiffAdd" }) + hi("NeogitDiffDelete", { link = "DiffDelete" }) + hi("NeogitDiffContext", { bg = palette.bg_secondary, fg = palette.fg }) + hi("NeogitDiffContextCursor", { bg = palette.magenta_subtle_bg_darker, fg = palette.magenta_brighter }) + hi("NeogitDiffAddCursor", { bg = palette.green_bright, fg = palette.green_subtle_bg }) + hi("NeogitDiffDeleteCursor", { bg = palette.red_bright, fg = palette.red_subtle_bg }) + hi("NeogitDiffContextHighlight", { link = "NeogitDiffContext" }) + hi("NeogitDiffAddHighlight", { link = "DiffAdd" }) + hi("NeogitDiffDeleteHighlight", { link = "DiffDelete" }) + hi("NeogitHunkHeader", { bg = palette.bg_secondary, fg = palette.grey_bright }) + hi("NeogitHunkMergeHeader", { link = "NeogitHunkHeader" }) + hi("NeogitHunkHeaderHighlight", { bg = palette.magenta_subtle_bg, fg = palette.magenta_brighter }) + hi("NeogitHunkHeaderCursor", { link = "NeogitHunkHeaderHighlight" }) + hi("NeogitCommitViewHeader", { bg = palette.bg_secondary, fg = palette.fg }) + hi("NeogitDiffHeader", { bg = palette.bg, fg = palette.grey_bright, bold = true }) + hi("NeogitActiveItem", { bg = palette.grey_bright, fg = palette.bg, bold = true }) +end diff --git a/modules/neovim/formatter.nix b/modules/neovim/formatter.nix new file mode 100644 index 0000000..8b5de93 --- /dev/null +++ b/modules/neovim/formatter.nix @@ -0,0 +1,57 @@ +{ pkgs, ... }: +{ + flake.modules.homeManager.neovim-formatter = { + programs.nixvim.plugins.conform-nvim = { + enable = true; + settings = { + formatters_by_ft = { + typescriptreact = { + __unkeyed-1 = "biome-check"; + __unkeyed-2 = "prettierd"; + stop_after_first = true; + }; + astro = [ "prettierd" ]; + typescript = { + __unkeyed-1 = "biome-check"; + __unkeyed-2 = "prettierd"; + stop_after_first = true; + }; + javascript = { + __unkeyed-1 = "biome-check"; + __unkeyed-2 = "prettierd"; + stop_after_first = true; + }; + javascriptreact = { + __unkeyed-1 = "biome-check"; + __unkeyed-2 = "prettierd"; + stop_after_first = true; + }; + html = [ "prettierd" ]; + htmlangular = [ "prettierd" ]; + css = { + __unkeyed-1 = "biome-check"; + __unkeyed-2 = "prettierd"; + stop_after_first = true; + }; + yaml = [ "prettierd" ]; + markdown = [ "prettierd" ]; + json = { + __unkeyed-1 = "biome-check"; + __unkeyed-2 = "prettierd"; + stop_after_first = true; + }; + lua = [ "stylua" ]; + go = [ "goimports" ]; + gomod = [ "goimports" ]; + gowork = [ "goimports" ]; + gotmpl = [ "goimports" ]; + }; + format_on_save = { + timeout_ms = 500; + lsp_format = "fallback"; + }; + }; + extraPackages = [ pkgs.stylua ]; + }; + }; +} diff --git a/modules/neovim/git.nix b/modules/neovim/git.nix new file mode 100644 index 0000000..ac8845d --- /dev/null +++ b/modules/neovim/git.nix @@ -0,0 +1,33 @@ +{ ... }: +{ + flake.modules.homeManager.neovim-git = { + programs.nixvim = { + plugins.gitportal = { + enable = true; + }; + + keymaps = [ + { + key = "gll"; + action = "GitPortal"; + options.desc = "Open line in Git provider"; + } + { + key = "gll"; + action = "GitPortal"; + options.desc = "Open line in Git provider"; + } + { + key = "gly"; + action = "GitPortal copy_link_to_clipboard"; + options.desc = "Copy link to line at Git provider"; + } + { + key = "glo"; + action = "GitPortal open_link"; + options.desc = "Open link to line at Git provider"; + } + ]; + }; + }; +} diff --git a/modules/neovim/keybindings.nix b/modules/neovim/keybindings.nix new file mode 100644 index 0000000..eb9e9ac --- /dev/null +++ b/modules/neovim/keybindings.nix @@ -0,0 +1,134 @@ +{ ... }: +{ + flake.modules.homeManager.neovim-keybindings = { + programs.nixvim = { + plugins.which-key = { + enable = true; + icons.mappings = false; + }; + + keymaps = [ + # Open + { + mode = [ "n" ]; + key = "od"; + action = "vsplit | lua vim.lsp.buf.definition()"; + options.desc = "Go to definition in other window"; + } + + # Buffer + { + mode = [ "n" ]; + key = "bn"; + action = "bn"; + options.desc = "Move to next buffer"; + } + { + mode = [ "n" ]; + key = "bp"; + action = "bp"; + options.desc = "Move to previous buffer"; + } + { + mode = [ "n" ]; + key = "bk"; + action = "bn"; + options.desc = "Kill buffer and window"; + } + + # File + { + mode = [ "n" ]; + key = "fn"; + action = "enew"; + options.desc = "Create a new file"; + } + { + mode = [ "n" ]; + key = "fs"; + action = "w"; + options.desc = "Save currently opened file"; + } + + # Quit + { + mode = [ "n" ]; + key = "qq"; + action = "qa!"; + options.desc = "Leave neovim"; + } + + # Window + { + mode = [ "n" ]; + key = "w+"; + action = ":vertical resize +4"; + options.desc = "Increase window size"; + } + { + mode = [ "n" ]; + key = "w-"; + action = ":vertical resize -4"; + options.desc = "Decrease window size"; + } + { + mode = [ "n" ]; + key = "wx"; + action = ":bd"; + options.desc = "Kill active window and buffer"; + } + { + mode = [ "n" ]; + key = "wh"; + action = "h"; + options.desc = "Move to window on left"; + } + { + mode = [ "n" ]; + key = "wj"; + action = "j"; + options.desc = "Move to window on bottom"; + } + { + mode = [ "n" ]; + key = "wk"; + action = "k"; + options.desc = "Move to window on top"; + } + { + mode = [ "n" ]; + key = "wl"; + action = "l"; + options.desc = "Move to window on right"; + } + { + mode = [ "n" ]; + key = "ws"; + action = "sp"; + options.desc = "Split windows horizontally"; + } + { + mode = [ "n" ]; + key = "wv"; + action = "vsp"; + options.desc = "Split windows vertically"; + } + { + mode = [ "n" ]; + key = "wd"; + action = "close"; + options.desc = "Delete window only"; + } + { + mode = [ + "n" + "x" + "o" + ]; + key = ""; + action.__raw = /* lua */ ''function() require("flash").jump() end''; + } + ]; + }; + }; +} diff --git a/modules/neovim/lsp.nix b/modules/neovim/lsp.nix new file mode 100644 index 0000000..a652c90 --- /dev/null +++ b/modules/neovim/lsp.nix @@ -0,0 +1,202 @@ +{ pkgs, ... }: +{ + flake.modules.homeManager.neovim-lsp = { + programs.nixvim = { + plugins.lspconfig.enable = true; + + lsp = { + enable = true; + + servers = { + lua_ls = { + enable = true; + package = pkgs.lua-language-server; + packageFallback = true; + }; + nil_ls = { + enable = true; + package = pkgs.nil; + packageFallback = true; + }; + gopls = { + enable = true; + package = pkgs.gopls; + packageFallback = true; + }; + ts_ls = { + enable = true; + package = pkgs.typescript-language-server; + packageFallback = true; + }; + jsonls = { + enable = true; + package = pkgs.vscode-langservers-extracted; + packageFallback = true; + }; + cssls = { + enable = true; + package = pkgs.vscode-langservers-extracted; + packageFallback = true; + }; + html = { + enable = true; + package = pkgs.vscode-langservers-extracted; + packageFallback = true; + }; + astro = { + enable = true; + package = pkgs.astro-language-server; + packageFallback = true; + config.init_options.typescript.tsdk = "${pkgs.typescript}/lib/node_modules/typescript/lib"; + }; + eslint = { + enable = true; + package = pkgs.vscode-langservers-extracted; + packageFallback = true; + config = { + root_markers = [ + ".eslintrc" + ".eslintrc.js" + ".eslintrc.cjs" + ".eslintrc.yaml" + ".eslintrc.yml" + ".eslintrc.json" + "eslint.config.js" + "eslint.config.mjs" + "eslint.config.cjs" + "eslint.config.ts" + "eslint.config.mts" + "eslint.config.cts" + "package.json" + ]; + settings = { + validate = "on"; + useESLintClass = false; + experimental = { + useFlatConfig = true; + }; + codeActionOnSave = { + enable = false; + mode = "all"; + }; + format = true; + quiet = false; + onIgnoredFiles = "off"; + rulesCustomizations = { }; + run = "onType"; + problems = { + shortenToSingleLine = false; + }; + nodePath = ""; + workingDirectory = { + mode = "location"; + }; + codeAction = { + disableRuleComment = { + enable = true; + location = "separateLine"; + }; + showDocumentation = { + enable = true; + }; + }; + }; + handlers = { + "eslint/openDoc".__raw = /* lua */ '' + function(_, result) + if result then + vim.ui.open(result.url) + end + return {} + end + ''; + "eslint/confirmESLintExecution" = /* lua */ '' + function(_, result) + if not result then + return + end + return 4 -- approved + end + ''; + "eslint/probeFailed" = /* lua */ '' + function() + vim.notify("[lspconfig] ESLint probe failed.", vim.log.levels.WARN) + return {} + end + ''; + "eslint/noLibrary" = /* lua */ '' + function() + vim.notify("[lspconfig] Unable to find ESLint library.", vim.log.levels.WARN) + return {} + end + ''; + }; + on_new_config.__raw = /* lua */ '' + function(config, new_root_dir) + -- This function is called when LSP attaches to a new buffer + -- Set the working directory to the root where eslint config is found + config.settings = config.settings or {} + config.settings.workspaceFolder = { + uri = new_root_dir, + name = vim.fn.fnamemodify(new_root_dir, ":t"), + } + + -- Detect flat config + local flat_config_files = { + "eslint.config.js", + "eslint.config.mjs", + "eslint.config.cjs", + "eslint.config.ts", + "eslint.config.mts", + "eslint.config.cts", + } + + for _, file in ipairs(flat_config_files) do + local config_path = new_root_dir .. "/" .. file + if vim.uv.fs_stat(config_path) then + config.settings.experimental = config.settings.experimental or {} + config.settings.experimental.useFlatConfig = true + break + end + end + + -- Support Yarn PnP + local pnp_cjs = new_root_dir .. "/.pnp.cjs" + local pnp_js = new_root_dir .. "/.pnp.js" + if vim.uv.fs_stat(pnp_cjs) or vim.uv.fs_stat(pnp_js) then + config.cmd = vim.list_extend({ "yarn", "exec" }, config.cmd or {}) + end + end + ''; + }; + }; + biome = { + enable = true; + package = null; + packageFallback = false; + }; + }; + + keymaps = [ + { + key = "ca"; + lspBufAction = "code_action"; + } + { + key = "e"; + action = "lua vim.diagnostic.open_float()"; + } + ]; + }; + + # Define diagnostic appearance + diagnostic.settings = { + virtual_text = false; + signs = true; + underline = true; + update_in_insert = false; + severity_sort = false; + }; + }; + }; +} diff --git a/modules/neovim/options.nix b/modules/neovim/options.nix new file mode 100644 index 0000000..c36b7f4 --- /dev/null +++ b/modules/neovim/options.nix @@ -0,0 +1,52 @@ +{ ... }: +{ + flake.modules.homeManager.neovim-options = { + programs.nixvim = { + globals = { + mapleader = " "; + maplocalleader = " "; + }; + + clipboard.register = "unnamedplus"; + + opts = { + backup = false; + cmdheight = 1; + conceallevel = 0; + fileencoding = "utf-8"; + hlsearch = true; + ignorecase = true; + mouse = "a"; + pumheight = 10; + showmode = false; + smartindent = true; + breakindent = true; + showtabline = 0; + smartcase = true; + splitbelow = true; + splitright = true; + swapfile = false; + termguicolors = true; + timeoutlen = 600; + undofile = true; + updatetime = 230; + writebackup = false; + expandtab = true; + shiftwidth = 2; + tabstop = 2; + cursorline = true; + number = true; + relativenumber = true; + numberwidth = 2; + signcolumn = "yes"; + linebreak = true; + breakat = " ^I!@*-+;:,./?"; + scrolloff = 4; + sidescrolloff = 4; + winbar = ""; + foldlevel = 99; + foldlevelstart = 99; + }; + }; + }; +} diff --git a/modules/neovim/picker.nix b/modules/neovim/picker.nix new file mode 100644 index 0000000..5273ab6 --- /dev/null +++ b/modules/neovim/picker.nix @@ -0,0 +1,174 @@ +{ pkgs, ... }: +{ + flake.modules.homeManager.neovim-picker = { + programs.nixvim = { + plugins.oil = { + enable = true; + settings = { + keymaps = { + "q" = "actions.close"; + }; + columns = [ + "icon" + "permissions" + "size" + "mtime" + ]; + }; + }; + + extraPlugins = [ pkgs.vimPlugins.snacks-nvim ]; + extraConfigLua = /* lua */ '' + local Snacks = require("snacks"); + local filter_lsp_definitions = function(item) + if item.file:match("/react/ts5.0/") or item.file:match("react.d.ts") then + return false + end + return true + end + + Snacks.setup({ + bigfile = { enabled = true }, + bufdelete = { enabled = true }, + git = { enabled = true }, + indent = { enabled = true }, + input = { enabled = true }, + notifier = { enabled = true }, + picker = { + enabled = true, + prompt = "λ ", + layout = { preset = "ivy" }, + }, + statuscolumn = { enabled = true }, + }) + ''; + + keymaps = [ + # Git + { + key = "gb"; + action.__raw = "function() Snacks.git.blame_line() end"; + options.desc = "Show git blame for current line"; + } + # Picker + { + key = "."; + action.__raw = "function() Snacks.picker.files({ hidden = true }) end"; + options.desc = "Files"; + } + { + key = ""; + action.__raw = "function() Snacks.picker.git_files() end"; + options.desc = "Git files"; + } + # Find + { + key = "fr"; + action.__raw = "function() Snacks.picker.recent() end"; + options.desc = "Recent"; + } + { + key = "fp"; + action.__raw = "function() Snacks.picker.projects() end"; + options.desc = "Projects"; + } + { + key = "bb"; + action.__raw = "function() Snacks.picker.buffers() end"; + options.desc = "List buffers"; + } + { + key = "bd"; + action.__raw = "function() Snacks.bufdelete() end"; + options.desc = "Delete buffer"; + } + { + key = "bD"; + action.__raw = "function() Snacks.bufdelete.all() end"; + options.desc = "Delete all buffers"; + } + { + key = "bo"; + action.__raw = "function() Snacks.bufdelete.other() end"; + options.desc = "Delete other buffers"; + } + # Search + { + key = "ss"; + action.__raw = "function() Snacks.picker.grep() end"; + options.desc = "Grep"; + } + { + mode = [ + "n" + "x" + ]; + key = "sw"; + action.__raw = "function() Snacks.picker.grep_word() end"; + options.desc = "Visual selection or word"; + } + { + key = "su"; + action.__raw = "function() Snacks.picker.undo() end"; + options.desc = "Undo History"; + } + # Diagnostics + { + key = "td"; + action.__raw = "function() Snacks.picker.diagnostics_buffer() end"; + options.desc = "Buffer Diagnostics"; + } + { + key = "ta"; + action.__raw = "function() Snacks.picker.diagnostics() end"; + options.desc = "Diagnostics"; + } + # LSP + { + key = "gd"; + action.__raw = "function() Snacks.picker.lsp_definitions({ filter = { filter = filter_lsp_definitions } }) end"; + options.desc = "Goto Definition"; + } + { + key = "gD"; + action.__raw = "function() Snacks.picker.lsp_declarations() end"; + options.desc = "Goto Declaration"; + } + { + key = "grr"; + action.__raw = "function() Snacks.picker.lsp_references() end"; + options = { + desc = "References"; + nowait = true; + }; + } + { + key = "gI"; + action.__raw = "function() Snacks.picker.lsp_implementations() end"; + options.desc = "Goto Implementation"; + } + { + key = "gy"; + action.__raw = "function() Snacks.picker.lsp_type_definitions() end"; + options.desc = "Goto T[y]pe Definition"; + } + # Notifications and highlights + { + key = "on"; + action.__raw = "function() Snacks.notifier.show_history() end"; + options.desc = "Open notification history"; + } + { + key = "oh"; + action.__raw = "function() Snacks.picker.highlights() end"; + options.desc = "List highlights"; + } + { + key = "n"; + action = "Oil"; + options.desc = "Opens file explorer"; + } + ]; + }; + }; +} diff --git a/modules/neovim/statusline.nix b/modules/neovim/statusline.nix new file mode 100644 index 0000000..64af6d7 --- /dev/null +++ b/modules/neovim/statusline.nix @@ -0,0 +1,99 @@ +{ ... }: +{ + flake.modules.homeManager.neovim-statusline = { + programs.nixvim.plugins.lualine = { + enable = true; + + settings = { + options = { + theme = { + __raw = "winterly_lualine"; + }; + icons_enabled = false; + component_separators = { + left = "|"; + right = "|"; + }; + section_separators = { + left = ""; + right = ""; + }; + }; + sections = { + lualine_a = [ + { + __unkeyed-1 = "mode"; + fmt = { + __raw = "function(str) return str:sub(1, 1) end"; + }; + } + ]; + lualine_b = [ + { + __unkeyed-1 = "filename"; + file_status = true; + newfile_status = false; + path = 4; + shorting_target = 120; + symbols = { + modified = "[+]"; + readonly = "[-]"; + unnamed = "[No Name]"; + newfile = "[New]"; + }; + } + "encoding" + ]; + lualine_c = null; + lualine_x = null; + lualine_y = [ + "branch" + "diff" + "diagnostics" + ]; + lualine_z = [ + "location" + ]; + }; + }; + + # Sets up my custom colorscheme + luaConfig.pre = /* lua */ '' + local palette = require("dnsc.palette") + + local winterly_lualine = { + normal = { + a = { bg = palette.magenta, fg = palette.bg, gui = "bold" }, + b = { bg = palette.bg_secondary, fg = palette.magenta }, + c = { bg = palette.bg_secondary, fg = palette.magenta }, + }, + insert = { + a = { bg = palette.cyan_bright, fg = palette.bg, gui = "bold" }, + b = { bg = palette.bg_secondary, fg = palette.cyan_bright }, + c = { bg = palette.bg_secondary, fg = palette.cyan_bright }, + }, + visual = { + a = { bg = palette.blue_bright, fg = palette.bg, gui = "bold" }, + b = { bg = palette.bg_secondary, fg = palette.blue_bright }, + c = { bg = palette.bg_secondary, fg = palette.blue_bright }, + }, + replace = { + a = { bg = palette.red_bright, fg = palette.bg, gui = "bold" }, + b = { bg = palette.bg_secondary, fg = palette.red_bright }, + c = { bg = palette.bg_secondary, fg = palette.red_bright }, + }, + command = { + a = { bg = palette.green_bright, fg = palette.bg, gui = "bold" }, + b = { bg = palette.bg_secondary, fg = palette.green_bright }, + c = { bg = palette.bg_secondary, fg = palette.green_bright }, + }, + inactive = { + a = { bg = palette.bg_secondary, fg = palette.fg_dim }, + b = { bg = palette.bg_secondary, fg = palette.fg_dim }, + c = { bg = palette.bg_secondary, fg = palette.fg_dim }, + }, + } + ''; + }; + }; +} diff --git a/modules/systems.nix b/modules/systems.nix deleted file mode 100644 index 9cfcc0c..0000000 --- a/modules/systems.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ - # Currently using ARM on MacOS and x86 on Linux - systems = [ - "aarch64-darwin" - "x86_64-linux" - ]; -}