mirror of
https://github.com/smg1024/nix-darwin.git
synced 2026-05-22 20:32:59 +09:00
refactor: migrate nix-darwin config to a flake-parts dendritic layout
This commit is contained in:
parent
f80b0b0d4f
commit
09801ac429
84 changed files with 1029 additions and 687 deletions
6
modules/aspects/_editor/nvf/appearance/theme.nix
Executable file
6
modules/aspects/_editor/nvf/appearance/theme.nix
Executable file
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
# theme
|
||||
enable = true;
|
||||
name = "tokyonight";
|
||||
style = "night";
|
||||
}
|
||||
11
modules/aspects/_editor/nvf/core/augroups.nix
Executable file
11
modules/aspects/_editor/nvf/core/augroups.nix
Executable file
|
|
@ -0,0 +1,11 @@
|
|||
[
|
||||
# augroups
|
||||
{
|
||||
enable = true;
|
||||
name = "LastCursorGroup";
|
||||
}
|
||||
{
|
||||
enable = true;
|
||||
name = "HighlightYank";
|
||||
}
|
||||
]
|
||||
33
modules/aspects/_editor/nvf/core/autocmds.nix
Executable file
33
modules/aspects/_editor/nvf/core/autocmds.nix
Executable file
|
|
@ -0,0 +1,33 @@
|
|||
{lib, ...}: [
|
||||
# autocmds
|
||||
{
|
||||
enable = true;
|
||||
event = ["BufReadPost"];
|
||||
desc = "Return to last cursor position";
|
||||
group = "LastCursorGroup";
|
||||
callback = lib.generators.mkLuaInline ''
|
||||
function()
|
||||
local mark = vim.api.nvim_buf_get_mark(0, '"')
|
||||
local line_count = vim.api.nvim_buf_line_count(0)
|
||||
if mark[1] > 0 and mark[1] <= line_count then
|
||||
pcall(vim.api.nvim_win_set_cursor, 0, mark)
|
||||
end
|
||||
end
|
||||
'';
|
||||
}
|
||||
{
|
||||
enable = true;
|
||||
event = ["TextYankPost"];
|
||||
desc = "Highlight yanks on copy";
|
||||
group = "HighlightYank";
|
||||
pattern = ["*"];
|
||||
callback = lib.generators.mkLuaInline ''
|
||||
function()
|
||||
vim.hl.on_yank({
|
||||
higroup = "IncSearch",
|
||||
timeout = 250,
|
||||
})
|
||||
end
|
||||
'';
|
||||
}
|
||||
]
|
||||
8
modules/aspects/_editor/nvf/core/clipboard.nix
Executable file
8
modules/aspects/_editor/nvf/core/clipboard.nix
Executable file
|
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
# clipboard
|
||||
enable = true;
|
||||
registers = "unnamedplus";
|
||||
providers = {
|
||||
wl-copy.enable = true;
|
||||
};
|
||||
}
|
||||
81
modules/aspects/_editor/nvf/core/keymaps.nix
Executable file
81
modules/aspects/_editor/nvf/core/keymaps.nix
Executable file
|
|
@ -0,0 +1,81 @@
|
|||
[
|
||||
# Keymaps
|
||||
{
|
||||
key = "<leader>ff";
|
||||
mode = "n";
|
||||
action = "<Cmd>FzfLua files<CR>";
|
||||
desc = "[F]ind files";
|
||||
}
|
||||
{
|
||||
key = "<leader>fg";
|
||||
mode = "n";
|
||||
action = "<Cmd>FzfLua live_grep_native<CR>";
|
||||
desc = "Live [G]rep";
|
||||
}
|
||||
{
|
||||
key = "<leader><leader>";
|
||||
mode = "n";
|
||||
action = "<Cmd>FzfLua buffers<CR>";
|
||||
desc = "Buffers";
|
||||
}
|
||||
{
|
||||
key = "<leader>fh";
|
||||
mode = "n";
|
||||
action = "<Cmd>FzfLua help_tags<CR>";
|
||||
desc = "[H]elp Tags";
|
||||
}
|
||||
{
|
||||
key = "<leader>fx";
|
||||
mode = "n";
|
||||
action = "<Cmd>FzfLua diagnostics_document<CR>";
|
||||
desc = "Diagnostics Document";
|
||||
}
|
||||
{
|
||||
key = "<leader>fX";
|
||||
mode = "n";
|
||||
action = "<Cmd>FzfLua diagnostics_workspace<CR>";
|
||||
desc = "Diagnostics Workspace";
|
||||
}
|
||||
{
|
||||
key = "<leader>fs";
|
||||
mode = "n";
|
||||
action = "<Cmd>FzfLua lsp_document_symbols<CR>";
|
||||
desc = "Document [S]ymbols";
|
||||
}
|
||||
{
|
||||
key = "<leader>fS";
|
||||
mode = "n";
|
||||
action = "<Cmd>FzfLua lsp_workspace_symbols<CR>";
|
||||
desc = "Workspace [S]ymbols";
|
||||
}
|
||||
{
|
||||
key = "<leader>fk";
|
||||
mode = "n";
|
||||
action = "<Cmd>FzfLua keymaps<CR>";
|
||||
desc = "[K]eymaps";
|
||||
}
|
||||
{
|
||||
key = "<leader>fb";
|
||||
mode = "n";
|
||||
action = "<Cmd>FzfLua builtin<CR>";
|
||||
desc = "[B]uiltin FZF";
|
||||
}
|
||||
{
|
||||
key = "<leader>fr";
|
||||
mode = "n";
|
||||
action = "<Cmd>FzfLua resume<CR>";
|
||||
desc = "[R]esume";
|
||||
}
|
||||
{
|
||||
key = "<leader>fo";
|
||||
mode = "n";
|
||||
action = "<Cmd>FzfLua oldfiles<CR>";
|
||||
desc = "[O]ld Files";
|
||||
}
|
||||
{
|
||||
key = "<leader>-";
|
||||
mode = "n";
|
||||
action = "<Cmd>Oil --float<CR>";
|
||||
desc = "Open Current Directory";
|
||||
}
|
||||
]
|
||||
12
modules/aspects/_editor/nvf/core/options.nix
Executable file
12
modules/aspects/_editor/nvf/core/options.nix
Executable file
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
# options
|
||||
cursorlineopt = "line";
|
||||
wrap = false;
|
||||
cmdheight = 1;
|
||||
tabstop = 2;
|
||||
shiftwidth = 2;
|
||||
autoindent = true;
|
||||
termguicolors = true;
|
||||
splitbelow = true;
|
||||
splitright = true;
|
||||
}
|
||||
5
modules/aspects/_editor/nvf/core/spellcheck.nix
Executable file
5
modules/aspects/_editor/nvf/core/spellcheck.nix
Executable file
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
# spellcheck
|
||||
enable = true;
|
||||
languages = ["en"];
|
||||
}
|
||||
4
modules/aspects/_editor/nvf/core/undoFile.nix
Executable file
4
modules/aspects/_editor/nvf/core/undoFile.nix
Executable file
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
# undoFile
|
||||
enable = true;
|
||||
}
|
||||
47
modules/aspects/_editor/nvf/default.nix
Executable file
47
modules/aspects/_editor/nvf/default.nix
Executable file
|
|
@ -0,0 +1,47 @@
|
|||
{
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
options = import ./core/options.nix;
|
||||
autocmds = import ./core/autocmds.nix {inherit lib;};
|
||||
augroups = import ./core/augroups.nix;
|
||||
keymaps = import ./core/keymaps.nix;
|
||||
fzf-lua = import ./plugins/fzf-lua.nix;
|
||||
mini = import ./plugins/mini.nix;
|
||||
utility = import ./plugins/utility.nix;
|
||||
binds = import ./plugins/binds.nix;
|
||||
terminal = import ./plugins/terminal.nix;
|
||||
theme = import ./appearance/theme.nix;
|
||||
lsp = import ./lsp/lsp.nix;
|
||||
treesitter = import ./lsp/treesitter.nix {inherit pkgs;};
|
||||
autocomplete = import ./lsp/autocomplete.nix;
|
||||
languages = import ./lsp/languages;
|
||||
in {
|
||||
programs.nvf = {
|
||||
enable = true;
|
||||
|
||||
settings = {
|
||||
vim = {
|
||||
inherit
|
||||
options
|
||||
autocmds
|
||||
augroups
|
||||
keymaps
|
||||
fzf-lua
|
||||
mini
|
||||
utility
|
||||
binds
|
||||
terminal
|
||||
theme
|
||||
lsp
|
||||
treesitter
|
||||
autocomplete
|
||||
languages
|
||||
;
|
||||
searchCase = "smart";
|
||||
hideSearchHighlight = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
22
modules/aspects/_editor/nvf/lsp/autocomplete.nix
Executable file
22
modules/aspects/_editor/nvf/lsp/autocomplete.nix
Executable file
|
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
# autocomplete
|
||||
blink-cmp = {
|
||||
enable = true;
|
||||
friendly-snippets.enable = true;
|
||||
setupOpts = {
|
||||
keymap.preset = "default";
|
||||
cmdline = {
|
||||
keymap.preset = "default";
|
||||
};
|
||||
completion = {
|
||||
documentation = {
|
||||
auto_show = true;
|
||||
auto_show_delay_ms = 1000;
|
||||
};
|
||||
};
|
||||
};
|
||||
sourcePlugins = {
|
||||
emoji.enable = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
17
modules/aspects/_editor/nvf/lsp/languages/bash.nix
Executable file
17
modules/aspects/_editor/nvf/lsp/languages/bash.nix
Executable file
|
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
# bash
|
||||
enable = true;
|
||||
extraDiagnostics = {
|
||||
enable = true;
|
||||
types = ["shellcheck"];
|
||||
};
|
||||
format = {
|
||||
enable = true;
|
||||
type = ["shfmt"];
|
||||
};
|
||||
lsp = {
|
||||
enable = true;
|
||||
servers = ["bash-ls"];
|
||||
};
|
||||
treesitter.enable = true;
|
||||
}
|
||||
23
modules/aspects/_editor/nvf/lsp/languages/default.nix
Executable file
23
modules/aspects/_editor/nvf/lsp/languages/default.nix
Executable file
|
|
@ -0,0 +1,23 @@
|
|||
let
|
||||
nix = import ./nix.nix;
|
||||
python = import ./python.nix;
|
||||
lua = import ./lua.nix;
|
||||
bash = import ./bash.nix;
|
||||
markdown = import ./markdown.nix;
|
||||
html = import ./html.nix;
|
||||
yaml = import ./yaml.nix;
|
||||
toml = import ./toml.nix;
|
||||
just = import ./just.nix;
|
||||
in {
|
||||
inherit
|
||||
nix
|
||||
python
|
||||
lua
|
||||
bash
|
||||
markdown
|
||||
html
|
||||
yaml
|
||||
toml
|
||||
just
|
||||
;
|
||||
}
|
||||
23
modules/aspects/_editor/nvf/lsp/languages/html.nix
Executable file
23
modules/aspects/_editor/nvf/lsp/languages/html.nix
Executable file
|
|
@ -0,0 +1,23 @@
|
|||
{
|
||||
# html
|
||||
enable = true;
|
||||
extraDiagnostics = {
|
||||
enable = true;
|
||||
types = ["htmlhint"];
|
||||
};
|
||||
format = {
|
||||
enable = true;
|
||||
type = [
|
||||
"superhtml"
|
||||
"prettierd"
|
||||
];
|
||||
};
|
||||
lsp = {
|
||||
enable = true;
|
||||
servers = ["superhtml"];
|
||||
};
|
||||
treesitter = {
|
||||
enable = true;
|
||||
autotagHtml = true;
|
||||
};
|
||||
}
|
||||
9
modules/aspects/_editor/nvf/lsp/languages/just.nix
Normal file
9
modules/aspects/_editor/nvf/lsp/languages/just.nix
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
# just
|
||||
enable = true;
|
||||
lsp = {
|
||||
enable = true;
|
||||
servers = ["just-lsp"];
|
||||
};
|
||||
treesitter.enable = true;
|
||||
}
|
||||
17
modules/aspects/_editor/nvf/lsp/languages/lua.nix
Executable file
17
modules/aspects/_editor/nvf/lsp/languages/lua.nix
Executable file
|
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
# lua
|
||||
enable = true;
|
||||
extraDiagnostics = {
|
||||
enable = true;
|
||||
types = ["luacheck"];
|
||||
};
|
||||
format = {
|
||||
enable = true;
|
||||
type = ["stylua"];
|
||||
};
|
||||
lsp = {
|
||||
enable = true;
|
||||
servers = ["lua-language-server"];
|
||||
};
|
||||
treesitter.enable = true;
|
||||
}
|
||||
30
modules/aspects/_editor/nvf/lsp/languages/markdown.nix
Executable file
30
modules/aspects/_editor/nvf/lsp/languages/markdown.nix
Executable file
|
|
@ -0,0 +1,30 @@
|
|||
{
|
||||
# markdown
|
||||
enable = true;
|
||||
extensions = {
|
||||
render-markdown-nvim = {
|
||||
enable = true;
|
||||
setupOpts = {
|
||||
checkbox = {
|
||||
checked.scope_highlight = "@markup.strikethrough";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
extraDiagnostics = {
|
||||
enable = true;
|
||||
types = ["markdownlint-cli2"];
|
||||
};
|
||||
format = {
|
||||
enable = true;
|
||||
type = [
|
||||
"prettierd"
|
||||
"deno_fmt"
|
||||
];
|
||||
};
|
||||
lsp = {
|
||||
enable = true;
|
||||
servers = ["marksman"];
|
||||
};
|
||||
treesitter.enable = true;
|
||||
}
|
||||
20
modules/aspects/_editor/nvf/lsp/languages/nix.nix
Executable file
20
modules/aspects/_editor/nvf/lsp/languages/nix.nix
Executable file
|
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
# nix
|
||||
enable = true;
|
||||
extraDiagnostics = {
|
||||
enable = true;
|
||||
types = [
|
||||
"deadnix"
|
||||
"statix"
|
||||
];
|
||||
};
|
||||
format = {
|
||||
enable = true;
|
||||
type = ["alejandra"];
|
||||
};
|
||||
lsp = {
|
||||
enable = true;
|
||||
servers = ["nil"];
|
||||
};
|
||||
treesitter.enable = true;
|
||||
}
|
||||
13
modules/aspects/_editor/nvf/lsp/languages/python.nix
Executable file
13
modules/aspects/_editor/nvf/lsp/languages/python.nix
Executable file
|
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
# python
|
||||
enable = true;
|
||||
format = {
|
||||
enable = true;
|
||||
type = ["ruff"];
|
||||
};
|
||||
lsp = {
|
||||
enable = true;
|
||||
servers = ["pyright"];
|
||||
};
|
||||
treesitter.enable = true;
|
||||
}
|
||||
13
modules/aspects/_editor/nvf/lsp/languages/toml.nix
Normal file
13
modules/aspects/_editor/nvf/lsp/languages/toml.nix
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
# toml
|
||||
enable = true;
|
||||
lsp = {
|
||||
enable = true;
|
||||
servers = ["taplo"];
|
||||
};
|
||||
format = {
|
||||
enable = true;
|
||||
type = ["taplo"];
|
||||
};
|
||||
treesitter.enable = true;
|
||||
}
|
||||
9
modules/aspects/_editor/nvf/lsp/languages/yaml.nix
Executable file
9
modules/aspects/_editor/nvf/lsp/languages/yaml.nix
Executable file
|
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
# yaml
|
||||
enable = true;
|
||||
lsp = {
|
||||
enable = true;
|
||||
servers = ["yaml-language-server"];
|
||||
};
|
||||
treesitter.enable = true;
|
||||
}
|
||||
7
modules/aspects/_editor/nvf/lsp/lsp.nix
Executable file
7
modules/aspects/_editor/nvf/lsp/lsp.nix
Executable file
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
# lsp
|
||||
enable = true;
|
||||
inlayHints.enable = true;
|
||||
lspconfig.enable = true;
|
||||
formatOnSave = true;
|
||||
}
|
||||
20
modules/aspects/_editor/nvf/lsp/treesitter.nix
Executable file
20
modules/aspects/_editor/nvf/lsp/treesitter.nix
Executable file
|
|
@ -0,0 +1,20 @@
|
|||
{pkgs, ...}: {
|
||||
# treesitter
|
||||
enable = true;
|
||||
addDefaultGrammars = true;
|
||||
grammars = with pkgs.vimPlugins.nvim-treesitter.builtGrammars; [
|
||||
nix
|
||||
lua
|
||||
markdown
|
||||
html
|
||||
python
|
||||
yaml
|
||||
toml
|
||||
just
|
||||
];
|
||||
fold = true;
|
||||
highlight = {
|
||||
enable = true;
|
||||
};
|
||||
indent.enable = true;
|
||||
}
|
||||
10
modules/aspects/_editor/nvf/plugins/binds.nix
Executable file
10
modules/aspects/_editor/nvf/plugins/binds.nix
Executable file
|
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
# binds
|
||||
whichKey = {
|
||||
enable = true;
|
||||
register = {
|
||||
"<leader>f" = "+FZF";
|
||||
"<leader>l" = "+Language";
|
||||
};
|
||||
};
|
||||
}
|
||||
6
modules/aspects/_editor/nvf/plugins/fzf-lua.nix
Executable file
6
modules/aspects/_editor/nvf/plugins/fzf-lua.nix
Executable file
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
# fzf-lua
|
||||
enable = true;
|
||||
profile = "default";
|
||||
setupOpts = {};
|
||||
}
|
||||
14
modules/aspects/_editor/nvf/plugins/mini.nix
Executable file
14
modules/aspects/_editor/nvf/plugins/mini.nix
Executable file
|
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
# mini
|
||||
statusline.enable = true;
|
||||
ai.enable = true;
|
||||
bufremove.enable = true;
|
||||
comment.enable = true;
|
||||
pairs.enable = true;
|
||||
cursorword.enable = true;
|
||||
icons.enable = true;
|
||||
move.enable = true;
|
||||
surround.enable = true;
|
||||
indentscope.enable = true;
|
||||
trailspace.enable = true;
|
||||
}
|
||||
21
modules/aspects/_editor/nvf/plugins/terminal.nix
Executable file
21
modules/aspects/_editor/nvf/plugins/terminal.nix
Executable file
|
|
@ -0,0 +1,21 @@
|
|||
{
|
||||
# terminal
|
||||
toggleterm = {
|
||||
enable = true;
|
||||
setupOpts = {
|
||||
direction = "horizontal";
|
||||
size = 6;
|
||||
};
|
||||
mappings = {
|
||||
open = "<leader>tt";
|
||||
};
|
||||
|
||||
# lazygit
|
||||
lazygit = {
|
||||
enable = true;
|
||||
mappings = {
|
||||
open = "<leader>gg";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
11
modules/aspects/_editor/nvf/plugins/utility.nix
Executable file
11
modules/aspects/_editor/nvf/plugins/utility.nix
Executable file
|
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
# utility
|
||||
oil-nvim = {
|
||||
enable = true;
|
||||
gitStatus.enable = true;
|
||||
setupOpts = {
|
||||
view_options.show_hidden = true;
|
||||
};
|
||||
};
|
||||
sleuth.enable = true;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue