1
0
Fork 0
forked from foxora/nix

Compare commits

...

7 commits

20 changed files with 908 additions and 722 deletions

68
flake.lock generated
View file

@ -144,26 +144,27 @@
"cerulean": { "cerulean": {
"inputs": { "inputs": {
"deploy-rs": "deploy-rs", "deploy-rs": "deploy-rs",
"home-manager": "home-manager",
"microvm": "microvm", "microvm": "microvm",
"nixpkgs": [ "nixpkgs": [
"nixpkgs" "nixpkgs"
], ],
"nt": "nt", "nt": "nt",
"sops-nix": "sops-nix",
"systems": [ "systems": [
"systems" "systems"
] ]
}, },
"locked": { "locked": {
"lastModified": 1771409623, "lastModified": 1772502315,
"narHash": "sha256-1IhHueuQTVCVrui700IP9DfLXwb3kU2rnEWPSdxQY0k=", "narHash": "sha256-DHE6jU97GZ+QfUdPi4plZRnXtAvtGubOxqA5sQ4DD9M=",
"ref": "refs/heads/main", "ref": "bleeding",
"rev": "d5211287bd3cb96078f2053488d67d557848a8f2", "rev": "9bab917d8cc3b16f3c73b1980fcb55a4b5ce5239",
"revCount": 176, "revCount": 191,
"type": "git", "type": "git",
"url": "https://tearforge.net/cry/cerulean" "url": "https://tearforge.net/cry/cerulean"
}, },
"original": { "original": {
"ref": "bleeding",
"type": "git", "type": "git",
"url": "https://tearforge.net/cry/cerulean" "url": "https://tearforge.net/cry/cerulean"
} }
@ -455,28 +456,6 @@
} }
}, },
"home-manager": { "home-manager": {
"inputs": {
"nixpkgs": [
"cerulean",
"nixpkgs"
]
},
"locked": {
"lastModified": 1770260404,
"narHash": "sha256-3iVX1+7YUIt23hBx1WZsUllhbmP2EnXrV8tCRbLxHc8=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "0d782ee42c86b196acff08acfbf41bb7d13eed5b",
"type": "github"
},
"original": {
"owner": "nix-community",
"ref": "release-25.11",
"repo": "home-manager",
"type": "github"
}
},
"home-manager_2": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
"nixpkgs-unstable" "nixpkgs-unstable"
@ -497,7 +476,7 @@
"type": "github" "type": "github"
} }
}, },
"home-manager_3": { "home-manager_2": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
"zen", "zen",
@ -1293,11 +1272,11 @@
}, },
"nixpkgs-master": { "nixpkgs-master": {
"locked": { "locked": {
"lastModified": 1771439456, "lastModified": 1771702014,
"narHash": "sha256-HtQgNJrjYvZdpqpPJddF+TxGCazNyxvA8umbDcjrxT8=", "narHash": "sha256-/P7uAp8q1xFhaw9Z+OG7lUK3wVz1Q/wreAyeiMyyjLI=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "f84d6f6cd5f17d594439710f40349ba7d0706f4b", "rev": "cceb9213362e92c06b60b50c1e2877bc5fb95887",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -1548,7 +1527,7 @@
"awww": "awww", "awww": "awww",
"cachyos": "cachyos", "cachyos": "cachyos",
"cerulean": "cerulean", "cerulean": "cerulean",
"home-manager": "home-manager_2", "home-manager": "home-manager",
"hyprland-git": "hyprland-git", "hyprland-git": "hyprland-git",
"hyprland-plugins": "hyprland-plugins", "hyprland-plugins": "hyprland-plugins",
"iamb": "iamb", "iamb": "iamb",
@ -1625,6 +1604,27 @@
"type": "github" "type": "github"
} }
}, },
"sops-nix": {
"inputs": {
"nixpkgs": [
"cerulean",
"nixpkgs"
]
},
"locked": {
"lastModified": 1772495394,
"narHash": "sha256-hmIvE/slLKEFKNEJz27IZ8BKlAaZDcjIHmkZ7GCEjfw=",
"owner": "Mic92",
"repo": "sops-nix",
"rev": "1d9b98a29a45abe9c4d3174bd36de9f28755e3ff",
"type": "github"
},
"original": {
"owner": "Mic92",
"repo": "sops-nix",
"type": "github"
}
},
"spectrum": { "spectrum": {
"flake": false, "flake": false,
"locked": { "locked": {
@ -1856,7 +1856,7 @@
}, },
"zen": { "zen": {
"inputs": { "inputs": {
"home-manager": "home-manager_3", "home-manager": "home-manager_2",
"nixpkgs": "nixpkgs_10" "nixpkgs": "nixpkgs_10"
}, },
"locked": { "locked": {

View file

@ -15,7 +15,7 @@
}; };
cerulean = { cerulean = {
url = "git+https://tearforge.net/cry/cerulean"; url = "git+https://tearforge.net/cry/cerulean?ref=bleeding";
inputs = { inputs = {
systems.follows = "systems"; systems.follows = "systems";
nixpkgs.follows = "nixpkgs"; nixpkgs.follows = "nixpkgs";
@ -70,6 +70,8 @@
extra-experimental-features = "pipe-operators"; extra-experimental-features = "pipe-operators";
}; };
outputs = inputs: outputs = inputs: let
import ./snow.nix inputs; inherit (inputs.cerulean) snow;
in
snow.flake inputs ./.;
} }

View file

@ -14,34 +14,46 @@ local colors = {}
-- function to load colors -- function to load colors
local function load_colors() local function load_colors()
local new_colors = {} local new_colors = {}
for line in io.lines(colorscheme_filepath) do for line in io.lines(colorscheme_filepath) do
table.insert(new_colors, line) table.insert(new_colors, line)
end end
-- ensure the table has enough entries to avoid indexing issues -- ensure the table has enough entries to avoid indexing issues
if #new_colors >= 18 then if #new_colors >= 18 then
colors = new_colors colors = new_colors
require('base16-colorscheme').setup({ require("base16-colorscheme").setup({
base00 = colors[17], base01 = colors[1], base02 = colors[3], base03 = colors[3], base00 = colors[17],
base04 = colors[5], base05 = colors[8], base06 = colors[5], base07 = colors[8], base01 = colors[1],
base08 = colors[18], base09 = colors[4], base0A = colors[11], base0B = colors[5], base02 = colors[3],
base0C = colors[6], base0D = colors[7], base0E = colors[6], base0F = colors[16], base03 = colors[3],
}) base04 = colors[5],
base05 = colors[8],
base06 = colors[5],
base07 = colors[8],
base08 = colors[18],
base09 = colors[4],
base0A = colors[11],
base0B = colors[5],
base0C = colors[6],
base0D = colors[7],
base0E = colors[6],
base0F = colors[16],
})
-- set colors for blink.cmp's completion menu -- set colors for blink.cmp's completion menu
vim.api.nvim_set_hl(0, 'BlinkCmpMenu', { bg = colors[17] }) vim.api.nvim_set_hl(0, "BlinkCmpMenu", { bg = colors[17] })
vim.api.nvim_set_hl(0, 'BlinkCmpMenuBorder', { bg = colors[17], fg = colors[13] }) vim.api.nvim_set_hl(0, "BlinkCmpMenuBorder", { bg = colors[17], fg = colors[13] })
vim.api.nvim_set_hl(0, 'BlinkCmpMenuSelection', { bg = colors[15], fg = colors[17] }) vim.api.nvim_set_hl(0, "BlinkCmpMenuSelection", { bg = colors[15], fg = colors[17] })
vim.api.nvim_set_hl(0, 'BlinkCmpScrollBarThumb', { bg = colors[18] }) vim.api.nvim_set_hl(0, "BlinkCmpScrollBarThumb", { bg = colors[18] })
vim.api.nvim_set_hl(0, 'BlinkCmpKind', { bg = colors[17], fg = colors[14] }) vim.api.nvim_set_hl(0, "BlinkCmpKind", { bg = colors[17], fg = colors[14] })
vim.api.nvim_set_hl(0, 'BlinkCmpLabel', { bg = colors[17], fg = colors[18] }) vim.api.nvim_set_hl(0, "BlinkCmpLabel", { bg = colors[17], fg = colors[18] })
vim.api.nvim_set_hl(0, 'BlinkCmpLabelMatch', { bg = colors[17], fg = colors[18] }) vim.api.nvim_set_hl(0, "BlinkCmpLabelMatch", { bg = colors[17], fg = colors[18] })
vim.api.nvim_set_hl(0, 'BlinkCmpLabelDetail', { bg = colors[17], fg = colors[18] }) vim.api.nvim_set_hl(0, "BlinkCmpLabelDetail", { bg = colors[17], fg = colors[18] })
vim.api.nvim_set_hl(0, 'BlinkCmpLabelDescription', { bg = colors[17], fg = colors[18] }) vim.api.nvim_set_hl(0, "BlinkCmpLabelDescription", { bg = colors[17], fg = colors[18] })
else else
print("Error: Not enough colors in file") print("Error: Not enough colors in file")
end end
end end
-- initial load -- initial load
@ -51,19 +63,18 @@ load_colors()
-- set up a file watcher -- set up a file watcher
local function watch_colorscheme() local function watch_colorscheme()
local handle local handle
handle = uv.new_fs_event() handle = uv.new_fs_event()
if handle then if handle then
uv.fs_event_start(handle, colorscheme_filepath, {}, function(err, _, _) uv.fs_event_start(handle, colorscheme_filepath, {}, function(err, _, _)
if err then if err then
print("Error watching colorscheme file:", err) print("Error watching colorscheme file:", err)
return return
end end
-- debounce by adding a slight delay before reloading -- debounce by adding a slight delay before reloading
vim.defer_fn(load_colors, 100) vim.defer_fn(load_colors, 100)
end) end)
end end
end end
watch_colorscheme() watch_colorscheme()

View file

@ -1,59 +1,66 @@
local M = {} local M = {}
function M.on_attach(_, bufnr) function M.on_attach(_, bufnr)
-- we create a function that lets us more easily define mappings specific -- we create a function that lets us more easily define mappings specific
-- for LSP related items. It sets the mode, buffer and description for us each time. -- for LSP related items. It sets the mode, buffer and description for us each time.
local nmap = function(keys, func, desc) local nmap = function(keys, func, desc)
if desc then if desc then
desc = 'LSP: ' .. desc desc = "LSP: " .. desc
end end
vim.keymap.set('n', keys, func, { buffer = bufnr, desc = desc }) vim.keymap.set("n", keys, func, { buffer = bufnr, desc = desc })
end end
nmap('<leader>rn', vim.lsp.buf.rename, '[R]e[n]ame') nmap("<leader>rn", vim.lsp.buf.rename, "[R]e[n]ame")
nmap('<leader>ca', vim.lsp.buf.code_action, '[C]ode [A]ction') nmap("<leader>ca", vim.lsp.buf.code_action, "[C]ode [A]ction")
nmap('gd', vim.lsp.buf.definition, '[G]oto [D]efinition') nmap("gd", vim.lsp.buf.definition, "[G]oto [D]efinition")
-- NOTE: why are these functions that call the telescope builtin? -- NOTE: why are these functions that call the telescope builtin?
-- because otherwise they would load telescope eagerly when this is defined. -- because otherwise they would load telescope eagerly when this is defined.
-- due to us using the on_require handler to make sure it is available. -- due to us using the on_require handler to make sure it is available.
if nixCats('general.telescope') then if nixCats("general.telescope") then
nmap('gr', function() require('telescope.builtin').lsp_references() end, '[G]oto [R]eferences') nmap("gr", function()
nmap('gI', function() require('telescope.builtin').lsp_implementations() end, '[G]oto [I]mplementation') require("telescope.builtin").lsp_references()
nmap('<leader>ds', function() require('telescope.builtin').lsp_document_symbols() end, '[D]ocument [S]ymbols') end, "[G]oto [R]eferences")
nmap('<leader>ws', function() require('telescope.builtin').lsp_dynamic_workspace_symbols() end, '[W]orkspace [S]ymbols') nmap("gI", function()
nmap('<leader>dd', "<cmd>Telescope diagnostics bufnr=0<CR>", '[D]ocument [D]iagnostics') require("telescope.builtin").lsp_implementations()
nmap('<leader>wd', "<cmd>Telescope diagnostics<CR>", '[W]orkspace [D]iagnostics') end, "[G]oto [I]mplementation")
end -- TODO: someone who knows the builtin versions of these to do instead help me out please. nmap("<leader>ds", function()
require("telescope.builtin").lsp_document_symbols()
end, "[D]ocument [S]ymbols")
nmap("<leader>ws", function()
require("telescope.builtin").lsp_dynamic_workspace_symbols()
end, "[W]orkspace [S]ymbols")
nmap("<leader>dd", "<cmd>Telescope diagnostics bufnr=0<CR>", "[D]ocument [D]iagnostics")
nmap("<leader>wd", "<cmd>Telescope diagnostics<CR>", "[W]orkspace [D]iagnostics")
end -- TODO: someone who knows the builtin versions of these to do instead help me out please.
nmap('<leader>D', vim.lsp.buf.type_definition, 'Type [D]efinition') nmap("<leader>D", vim.lsp.buf.type_definition, "Type [D]efinition")
nmap('<leader>e', vim.diagnostic.open_float, 'Show [E]rror') nmap("<leader>e", vim.diagnostic.open_float, "Show [E]rror")
-- See `:help K` for why this keymap -- See `:help K` for why this keymap
nmap('K', vim.lsp.buf.hover, 'Hover Documentation') nmap("K", vim.lsp.buf.hover, "Hover Documentation")
nmap('<C-k>', vim.lsp.buf.signature_help, 'Signature Documentation') nmap("<C-k>", vim.lsp.buf.signature_help, "Signature Documentation")
-- Lesser used LSP functionality -- Lesser used LSP functionality
nmap('gD', vim.lsp.buf.declaration, '[G]oto [D]eclaration') nmap("gD", vim.lsp.buf.declaration, "[G]oto [D]eclaration")
nmap('<leader>wa', vim.lsp.buf.add_workspace_folder, '[W]orkspace [A]dd Folder') nmap("<leader>wa", vim.lsp.buf.add_workspace_folder, "[W]orkspace [A]dd Folder")
nmap('<leader>wr', vim.lsp.buf.remove_workspace_folder, '[W]orkspace [R]emove Folder') nmap("<leader>wr", vim.lsp.buf.remove_workspace_folder, "[W]orkspace [R]emove Folder")
nmap('<leader>wl', function() nmap("<leader>wl", function()
print(vim.inspect(vim.lsp.buf.list_workspace_folders())) print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
end, '[W]orkspace [L]ist Folders') end, "[W]orkspace [L]ist Folders")
-- Create a command `:Format` local to the LSP buffer
vim.api.nvim_buf_create_user_command(bufnr, 'Format', function(_)
vim.lsp.buf.format()
end, { desc = 'Format current buffer with LSP' })
-- Create a command `:Format` local to the LSP buffer
vim.api.nvim_buf_create_user_command(bufnr, "Format", function(_)
vim.lsp.buf.format()
end, { desc = "Format current buffer with LSP" })
end end
function M.get(server_name) function M.get(server_name)
local capabilities = require('blink.cmp').get_lsp_capabilities() local capabilities = require("blink.cmp").get_lsp_capabilities()
return capabilities return capabilities
end end
return M return M

View file

@ -1,88 +1,88 @@
return { return {
{ {
"friendly-snippets", "friendly-snippets",
dep_of = { "blink.cmp" }, dep_of = { "blink.cmp" },
},
{
"blink.cmp",
event = { "InsertEnter", "CmdlineEnter" },
on_require = "blink",
load = function (name)
vim.cmd.packadd(name)
end,
after = function(plugin)
local blink = require('blink.cmp')
blink.setup({
keymap = {
preset = 'default',
},
appearance = {
nerd_font_variant = 'mono',
}, },
{
"blink.cmp",
event = { "InsertEnter", "CmdlineEnter" },
on_require = "blink",
load = function(name)
vim.cmd.packadd(name)
end,
after = function(plugin)
local blink = require("blink.cmp")
sources = { blink.setup({
default = { 'lsp', 'path', 'snippets', 'buffer' }, keymap = {
providers = { preset = "default",
lsp = { },
name = 'LSP',
module = 'blink.cmp.sources.lsp', appearance = {
enabled = true, nerd_font_variant = "mono",
}, },
path = {
name = 'Path', sources = {
module = 'blink.cmp.sources.path', default = { "lsp", "path", "snippets", "buffer" },
enabled = true, providers = {
}, lsp = {
snippets = { name = "LSP",
name = 'Snippets', module = "blink.cmp.sources.lsp",
module = 'blink.cmp.sources.snippets', enabled = true,
enabled = true, },
}, path = {
buffer = { name = "Path",
name = 'Buffer', module = "blink.cmp.sources.path",
module = 'blink.cmp.sources.buffer', enabled = true,
enabled = true, },
}, snippets = {
}, name = "Snippets",
module = "blink.cmp.sources.snippets",
enabled = true,
},
buffer = {
name = "Buffer",
module = "blink.cmp.sources.buffer",
enabled = true,
},
},
},
completion = {
accept = {
auto_brackets = {
enabled = true,
},
},
menu = {
border = "rounded",
max_height = 12,
scrolloff = 2,
draw = {
columns = {
{ "kind_icon", gap = 1 },
{ "label", "label_description", gap = 1 },
},
},
},
documentation = {
auto_show = false,
window = {
border = "rounded",
},
},
},
signature = {
enabled = true,
window = {
border = "rounded",
},
},
})
end,
}, },
completion = {
accept = {
auto_brackets = {
enabled = true,
},
},
menu = {
border = 'rounded',
max_height = 12,
scrolloff = 2,
draw = {
columns = {
{ "kind_icon", gap = 1, },
{ "label", "label_description", gap = 1, },
},
},
},
documentation = {
auto_show = false,
window = {
border = 'rounded',
},
},
},
signature = {
enabled = true,
window = {
border = 'rounded',
},
},
})
end
},
} }

View file

@ -1,17 +1,17 @@
vim.api.nvim_create_autocmd("FileType", { vim.api.nvim_create_autocmd("FileType", {
pattern = "lua", pattern = "lua",
callback = function() callback = function()
vim.opt_local.shiftwidth = 2 vim.opt_local.shiftwidth = 2
vim.opt_local.tabstop = 2 vim.opt_local.tabstop = 2
vim.opt_local.expandtab = true vim.opt_local.expandtab = true
end, end,
}) })
vim.api.nvim_create_autocmd("FileType", { vim.api.nvim_create_autocmd("FileType", {
pattern = "nix", pattern = "nix",
callback = function() callback = function()
vim.opt_local.shiftwidth = 2 vim.opt_local.shiftwidth = 2
vim.opt_local.tabstop = 2 vim.opt_local.tabstop = 2
vim.opt_local.expandtab = true vim.opt_local.expandtab = true
end, end,
}) })

View file

@ -1,6 +1,6 @@
require("lze").load { require("lze").load({
{ import = "lsp.completion", }, { import = "lsp.completion" },
} })
require("lsp.indentation") require("lsp.indentation")
require("lsp.lsp") require("lsp.lsp")

View file

@ -1,87 +1,87 @@
local servers = {} local servers = {}
servers.lua_ls = { servers.lua_ls = {
settings = { settings = {
Lua = { Lua = {
formatters = { formatters = {
ignoreComments = false, ignoreComments = false,
}, },
signatureHelp = { enable = true }, signatureHelp = { enable = true },
diagnostics = { diagnostics = {
globals = { 'nixCats', 'vim' }, globals = { "nixCats", "vim" },
-- disable = { 'missing-fields' }, -- disable = { 'missing-fields' },
}, },
workspace = { workspace = {
-- make the server aware of the neovim runtime files -- make the server aware of the neovim runtime files
library = vim.api.nvim_get_runtime_file("", true), library = vim.api.nvim_get_runtime_file("", true),
checkThirdParty = false, checkThirdParty = false,
}, },
}, },
telemetry = { enabled = false }, telemetry = { enabled = false },
}, },
} }
servers.nil_ls = { servers.nil_ls = {
settings = {}, settings = {},
} }
local rust_analyzer_cmd = os.getenv("RUST_ANALYZER_CMD") local rust_analyzer_cmd = os.getenv("RUST_ANALYZER_CMD")
servers.rust_analyzer = { servers.rust_analyzer = {
cmd = { rust_analyzer_cmd }, cmd = { rust_analyzer_cmd },
settings = { settings = {
server = { server = {
-- For debugging rust-analyzer, to see log location do :LspInfo in neovim -- For debugging rust-analyzer, to see log location do :LspInfo in neovim
-- extraEnv = { {["RA_LOG"]="project_model=debug"} }, -- extraEnv = { {["RA_LOG"]="project_model=debug"} },
}, },
cargo = { cargo = {
allFeatures = false, allFeatures = false,
allTargets = false, allTargets = false,
buildScripts = { enable = true }, buildScripts = { enable = true },
target = "x86_64-unknown-linux-gnu", target = "x86_64-unknown-linux-gnu",
}, },
diagnostics = { diagnostics = {
enable = true, enable = true,
}, },
}, },
} }
servers.zls = { servers.zls = {
settings = {}, settings = {},
} }
local elixir_ls_cmd = os.getenv("ELIXIR_LS_CMD") local elixir_ls_cmd = os.getenv("ELIXIR_LS_CMD")
servers.elixirls = { servers.elixirls = {
cmd = { elixir_ls_cmd }, cmd = { elixir_ls_cmd },
settings = {}, settings = {},
} }
servers.gleam = { servers.gleam = {
settings = {}, settings = {},
} }
servers.hls = { servers.hls = {
settings = {}, settings = {},
} }
local java_home = os.getenv("JAVA_HOME") local java_home = os.getenv("JAVA_HOME")
servers.jdtls = { servers.jdtls = {
settings = { settings = {
java = { java = {
contentProvider = { preferred = 'fernflower' }, contentProvider = { preferred = "fernflower" },
configuration = { configuration = {
runtimes = { runtimes = {
{ {
name = "OpenJDK 17", name = "OpenJDK 17",
path = os.getenv("OPENJDK_17"), path = os.getenv("OPENJDK_17"),
}, },
{ {
name = "OpenJDK 21", name = "OpenJDK 21",
path = os.getenv("OPENJDK_21"), path = os.getenv("OPENJDK_21"),
}, },
} },
} },
}, },
} },
} }
-- Taken from nixCats example: -- Taken from nixCats example:
@ -90,41 +90,41 @@ servers.jdtls = {
-- nvim-lspconfig, it would do the same thing. -- nvim-lspconfig, it would do the same thing.
-- come to think of it, it might be better because then lspconfig doesnt have to be called before lsp attach? -- come to think of it, it might be better because then lspconfig doesnt have to be called before lsp attach?
-- but you would still end up triggering on a FileType event anyway, so, it makes little difference. -- but you would still end up triggering on a FileType event anyway, so, it makes little difference.
vim.api.nvim_create_autocmd('LspAttach', { vim.api.nvim_create_autocmd("LspAttach", {
group = vim.api.nvim_create_augroup('nixCats-lsp-attach', { clear = true }), group = vim.api.nvim_create_augroup("nixCats-lsp-attach", { clear = true }),
callback = function(event) callback = function(event)
require('lsp.capabilities').on_attach(vim.lsp.get_client_by_id(event.data.client_id), event.buf) require("lsp.capabilities").on_attach(vim.lsp.get_client_by_id(event.data.client_id), event.buf)
end end,
}) })
require("lze").load { require("lze").load({
{ {
"nvim-lspconfig", "nvim-lspconfig",
event = "FileType", event = "FileType",
after = function(plugin) after = function(plugin)
-- Just register configs, don't enable yet -- Just register configs, don't enable yet
for server_name, cfg in pairs(servers) do for server_name, cfg in pairs(servers) do
vim.lsp.config(server_name, { vim.lsp.config(server_name, {
capabilities = require('lsp.capabilities').get(server_name), capabilities = require("lsp.capabilities").get(server_name),
settings = (cfg or {}).settings, settings = (cfg or {}).settings,
filetypes = (cfg or {}).filetypes, filetypes = (cfg or {}).filetypes,
cmd = (cfg or {}).cmd, cmd = (cfg or {}).cmd,
root_pattern = (cfg or {}).root_pattern, root_pattern = (cfg or {}).root_pattern,
}) })
end end
-- Enable on-demand per filetype -- Enable on-demand per filetype
for server_name, cfg in pairs(servers) do for server_name, cfg in pairs(servers) do
local filetypes = cfg.filetypes or vim.lsp.config[server_name].filetypes local filetypes = cfg.filetypes or vim.lsp.config[server_name].filetypes
if filetypes then if filetypes then
vim.api.nvim_create_autocmd('FileType', { vim.api.nvim_create_autocmd("FileType", {
pattern = filetypes, pattern = filetypes,
callback = function() callback = function()
vim.lsp.enable(server_name) vim.lsp.enable(server_name)
end, end,
}) })
end end
end end
end, end,
}, },
} })

View file

@ -0,0 +1,23 @@
return {
{
"comment.nvim",
event = { "BufReadPost", "BufNewFile" },
after = function(plugin)
require("Comment").setup({
toggler = {
line = "<leader>cc",
block = "<leader>bc",
},
opLeader = {
line = "<leader>c",
block = "<leader>b",
},
extra = {
above = "<leader>c0",
below = "<leader>bo",
eol = "<leader>cA",
},
})
end,
},
}

View file

@ -1,5 +1,5 @@
return { return {
{ {
"dressing.nvim" "dressing.nvim",
}, },
} }

View file

@ -0,0 +1,33 @@
-- docs -> https://github.com/stevearc/conform.nvim
return {
{
"conform.nvim",
enabled = nixCats("format") or false,
keys = {
{ "<leader>p", desc = "Format File (pretty :3)" },
},
after = function(plugin)
local conform = require("conform")
conform.setup({
formatters_by_ft = {
lua = nixCats("lang.lua.format") and { "stylua" } or nil,
nix = nixCats("lang.nix.format") and { "nixfmt" } or nil,
rust = nixCats("lang.rust.format") and { "rustfmt", lsp_format = "fallback" } or nil,
haskell = nixCats("lang.haskell.format") and { "ormolu" } or nil,
},
format_on_save = {
timeout_ms = 500,
},
})
vim.keymap.set({ "n", "v" }, "<leader>p", function()
conform.format({
lsp_fallback = false,
async = false,
timeout_ms = 1000,
})
end, { desc = "Format File (pretty :3)" })
end,
},
}

View file

@ -1,15 +1,22 @@
return { return {
{ {
"fyler.nvim", "fyler.nvim",
cmd = { "Fyler" }, cmd = { "Fyler" },
keys = { keys = {
{ "<leader>tf", function() return require('fyler').toggle({ kind = "split_right" }) end, mode = {"n"}, desc = 'Open [F]yler' }, {
}, "<leader>tf",
load = function (name) function()
vim.cmd.packadd(name) return require("fyler").toggle({ kind = "split_right" })
end, end,
after = function(plugin) mode = { "n" },
local fyler = require("fyler").setup() desc = "Open [F]yler",
end, },
}, },
load = function(name)
vim.cmd.packadd(name)
end,
after = function(plugin)
local fyler = require("fyler").setup()
end,
},
} }

View file

@ -1,7 +1,9 @@
require("lze").load { require("lze").load({
{ import = "plugins.dressing", }, { import = "plugins.dressing" },
{ import = "plugins.telescope", }, { import = "plugins.telescope" },
{ import = "plugins.treesitter", }, { import = "plugins.treesitter" },
{ import = "plugins.fyler", }, { import = "plugins.fyler" },
{ import = "plugins.mini-hipatterns", }, { import = "plugins.mini-hipatterns" },
} { import = "plugins.format" },
{ import = "plugins.comment" },
})

View file

@ -1,76 +1,76 @@
return { return {
{ {
"mini.hipatterns", "mini.hipatterns",
after = function(plugin) after = function(plugin)
local hipatterns = require("mini.hipatterns") local hipatterns = require("mini.hipatterns")
-- Returns hex color group for matching short hex color. -- Returns hex color group for matching short hex color.
-- --
---@param match string ---@param match string
---@return string ---@return string
local hex_color_short = function(_, match) local hex_color_short = function(_, match)
local style = 'fg' -- 'fg' or 'bg', for extmark_opts_inline use 'fg' local style = "fg" -- 'fg' or 'bg', for extmark_opts_inline use 'fg'
local r, g, b = match:sub(2, 2), match:sub(3, 3), match:sub(4, 4) local r, g, b = match:sub(2, 2), match:sub(3, 3), match:sub(4, 4)
local hex = string.format('#%s%s%s%s%s%s', r, r, g, g, b, b) local hex = string.format("#%s%s%s%s%s%s", r, r, g, g, b, b)
return hipatterns.compute_hex_color_group(hex, style) return hipatterns.compute_hex_color_group(hex, style)
end end
-- Returns hex color group for matching alpha hex color. -- Returns hex color group for matching alpha hex color.
-- --
---@param match string ---@param match string
---@return string ---@return string
local hex_color_alpha = function(_, match) local hex_color_alpha = function(_, match)
local style = 'fg' -- 'fg' or 'bg', for extmark_opts_inline use 'fg' local style = "fg" -- 'fg' or 'bg', for extmark_opts_inline use 'fg'
local r, g, b = match:sub(2, 3), match:sub(4, 5), match:sub(6, 7) local r, g, b = match:sub(2, 3), match:sub(4, 5), match:sub(6, 7)
local hex = string.format('#%s%s%s', r, g, b) local hex = string.format("#%s%s%s", r, g, b)
return hipatterns.compute_hex_color_group(hex, style) return hipatterns.compute_hex_color_group(hex, style)
end end
-- Returns extmark opts for highlights with virtual inline text. -- Returns extmark opts for highlights with virtual inline text.
-- --
---@param data table Includes `hl_group`, `full_match` and more. ---@param data table Includes `hl_group`, `full_match` and more.
---@return table ---@return table
local extmark_opts_inline = function(_, _, data) local extmark_opts_inline = function(_, _, data)
return { return {
virt_text = { { '󰧞', data.hl_group } }, virt_text = { { "󰧞", data.hl_group } },
virt_text_pos = 'inline', virt_text_pos = "inline",
right_gravity = false, right_gravity = false,
} }
end end
-- Returns extmark opts for highlights with virtual inline text. -- Returns extmark opts for highlights with virtual inline text.
-- --
---@param data table Includes `hl_group`, `full_match` and more. ---@param data table Includes `hl_group`, `full_match` and more.
---@return table ---@return table
local extmark_opts_inline_alpha = function(_, _, data) local extmark_opts_inline_alpha = function(_, _, data)
return { return {
virt_text = { { '󱡓', data.hl_group } }, virt_text = { { "󱡓", data.hl_group } },
virt_text_pos = 'inline', virt_text_pos = "inline",
right_gravity = false, right_gravity = false,
} }
end end
hipatterns.setup({ hipatterns.setup({
highlighters = { highlighters = {
-- #rrggbb -- #rrggbb
hex_color = hipatterns.gen_highlighter.hex_color({ hex_color = hipatterns.gen_highlighter.hex_color({
style = "inline", style = "inline",
inline_text = '󰧞', inline_text = "󰧞",
}), }),
-- #rgb -- #rgb
hex_color_short = { hex_color_short = {
pattern = "#%x%x%x%f[%X]", pattern = "#%x%x%x%f[%X]",
group = hex_color_short, group = hex_color_short,
extmark_opts = extmark_opts_inline, extmark_opts = extmark_opts_inline,
}, },
-- #rrggbbaa -- #rrggbbaa
hex_color_alpha = { hex_color_alpha = {
pattern = "#%x%x%x%x%x%x%x%x%f[%X]", pattern = "#%x%x%x%x%x%x%x%x%f[%X]",
group = hex_color_alpha, group = hex_color_alpha,
extmark_opts = extmark_opts_inline_alpha, extmark_opts = extmark_opts_inline_alpha,
}, },
},
})
end,
}, },
})
end,
},
} }

View file

@ -1,36 +1,78 @@
return { return {
{ {
"telescope.nvim", "telescope.nvim",
cmd = { "Telescope" }, cmd = { "Telescope" },
keys = { keys = {
{ "<leader>f", function() return require('telescope.builtin').find_files() end, mode = {"n"}, desc = 'Telescope search [F]iles' }, {
{ "<leader>tr", function() return require('telescope.builtin').oldfiles() end, mode = {"n"}, desc = '[T]elescope search [R]ecent files' }, "<leader>f",
{ "<leader>ts", function() return require('telescope.builtin').live_grep() end, mode = {"n"}, desc = '[T]elescope [S]earch cwd with grep' }, function()
{ "<leader>tw", function() return require('telescope.builtin').grep_string() end, mode = {"n"}, desc = '[T]elescope search current [W]ord' }, return require("telescope.builtin").find_files()
{ "<leader>tk", function() return require('telescope.builtin').keymaps() end, mode = {"n"}, desc = '[T]elescope search [K]eymaps' }, end,
{ "<leader>tb", function() return require('telescope.builtin').buffers() end, mode = {"n"}, desc = '[T]elescope search [B]uffers' }, mode = { "n" },
}, desc = "Telescope search [F]iles",
load = function (name) },
vim.cmd.packadd(name) {
vim.cmd.packadd("telescope-fzf-native.nvim") "<leader>tr",
end, function()
after = function(plugin) return require("telescope.builtin").oldfiles()
local telescope = require("telescope") end,
local actions = require("telescope.actions") mode = { "n" },
desc = "[T]elescope search [R]ecent files",
},
{
"<leader>ts",
function()
return require("telescope.builtin").live_grep()
end,
mode = { "n" },
desc = "[T]elescope [S]earch cwd with grep",
},
{
"<leader>tw",
function()
return require("telescope.builtin").grep_string()
end,
mode = { "n" },
desc = "[T]elescope search current [W]ord",
},
{
"<leader>tk",
function()
return require("telescope.builtin").keymaps()
end,
mode = { "n" },
desc = "[T]elescope search [K]eymaps",
},
{
"<leader>tb",
function()
return require("telescope.builtin").buffers()
end,
mode = { "n" },
desc = "[T]elescope search [B]uffers",
},
},
load = function(name)
vim.cmd.packadd(name)
vim.cmd.packadd("telescope-fzf-native.nvim")
end,
after = function(plugin)
local telescope = require("telescope")
local actions = require("telescope.actions")
telescope.setup { telescope.setup({
defaults = { defaults = {
mappings = { mappings = {
i = { i = {
["<C-k>"] = actions.move_selection_previous, -- move to prev result ["<C-k>"] = actions.move_selection_previous, -- move to prev result
["<C-j>"] = actions.move_selection_next, -- move to next result ["<C-j>"] = actions.move_selection_next, -- move to next result
["<C-q>"] = actions.send_selected_to_qflist + actions.open_qflist ["<C-q>"] = actions.send_selected_to_qflist + actions.open_qflist,
} },
} },
} },
} })
pcall(telescope.load_extension, "fzf") pcall(telescope.load_extension, "fzf")
end, end,
}, },
} }

View file

@ -2,94 +2,94 @@
-- https://github.com/BirdeeHub/nixCats-nvim/blob/3c9bc4d7123e1b48d92f25ba505b889af541e897/templates/example/lua/myLuaConf/plugins/treesitter.lua -- https://github.com/BirdeeHub/nixCats-nvim/blob/3c9bc4d7123e1b48d92f25ba505b889af541e897/templates/example/lua/myLuaConf/plugins/treesitter.lua
return { return {
{ {
"nvim-treesitter", "nvim-treesitter",
lazy = false, lazy = false,
after = function (plugin) after = function(plugin)
--@param buf integer --@param buf integer
--@param language string --@param language string
local function treesitter_try_attach(buf, language) local function treesitter_try_attach(buf, language)
--check if parser exists and load it --check if parser exists and load it
if not vim.treesitter.language.add(language) then if not vim.treesitter.language.add(language) then
return return
end end
-- enables syntax highlight and other treesitter features -- enables syntax highlight and other treesitter features
vim.treesitter.start(buf, language) vim.treesitter.start(buf, language)
-- enables treesitter based folds -- enables treesitter based folds
vim.wo.foldexpr = "v:lua.vim.treesitter.foldexpr()" vim.wo.foldexpr = "v:lua.vim.treesitter.foldexpr()"
-- enables treesiter based indentation -- enables treesiter based indentation
vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()" vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()"
end end
local available_parsers = require("nvim-treesitter").get_available() local available_parsers = require("nvim-treesitter").get_available()
vim.api.nvim_create_autocmd("FileType", { vim.api.nvim_create_autocmd("FileType", {
callback = function(args) callback = function(args)
local buf, filetype = args.buf, args.match local buf, filetype = args.buf, args.match
local language = vim.treesitter.language.get_lang(filetype) local language = vim.treesitter.language.get_lang(filetype)
if not language then if not language then
return return
end end
local installed_parsers = require("nvim-treesitter").get_installed("parsers") local installed_parsers = require("nvim-treesitter").get_installed("parsers")
if vim.tbl_contains(installed_parsers, language) then if vim.tbl_contains(installed_parsers, language) then
-- enable the parser if it is installed -- enable the parser if it is installed
treesitter_try_attach(buf, language) treesitter_try_attach(buf, language)
elseif vim.tbl_contains(available_parsers, language) then elseif vim.tbl_contains(available_parsers, language) then
-- if a parser is available in `nvim-treesitter` enable it after ensuring it is installed -- if a parser is available in `nvim-treesitter` enable it after ensuring it is installed
require("nvim-treesitter").install(language):await(function() require("nvim-treesitter").install(language):await(function()
treesitter_try_attach(buf, language) treesitter_try_attach(buf, language)
end) end)
else else
-- try to enable treesitter features in case the parser exists but is not available from `nvim-treesitter` -- try to enable treesitter features in case the parser exists but is not available from `nvim-treesitter`
treesitter_try_attach(buf, language) treesitter_try_attach(buf, language)
end end
end, end,
}) })
end, end,
},
{
"nvim-treesitter-textobjects",
lazy = false,
before = function(plugin)
vim.g.no_plugin_maps = true
end,
after = function(plugin)
require("nvim-treesitter-textobjects").setup {
select = {
lookahead = true,
selection_modes = {
['@parameter.outer'] = 'v', -- charwise
['@function.outer'] = 'V', -- linewise
},
include_surrounding_whitespace = false,
}, },
} {
"nvim-treesitter-textobjects",
lazy = false,
before = function(plugin)
vim.g.no_plugin_maps = true
end,
after = function(plugin)
require("nvim-treesitter-textobjects").setup({
select = {
lookahead = true,
selection_modes = {
["@parameter.outer"] = "v", -- charwise
["@function.outer"] = "V", -- linewise
},
include_surrounding_whitespace = false,
},
})
-- keymaps -- keymaps
vim.keymap.set({ "x", "o" }, "am", function() vim.keymap.set({ "x", "o" }, "am", function()
require "nvim-treesitter-textobjects.select".select_textobject("@function.outer", "textobjects") require("nvim-treesitter-textobjects.select").select_textobject("@function.outer", "textobjects")
end) end)
vim.keymap.set({ "x", "o" }, "im", function() vim.keymap.set({ "x", "o" }, "im", function()
require "nvim-treesitter-textobjects.select".select_textobject("@function.inner", "textobjects") require("nvim-treesitter-textobjects.select").select_textobject("@function.inner", "textobjects")
end) end)
vim.keymap.set({ "x", "o" }, "ac", function() vim.keymap.set({ "x", "o" }, "ac", function()
require "nvim-treesitter-textobjects.select".select_textobject("@class.outer", "textobjects") require("nvim-treesitter-textobjects.select").select_textobject("@class.outer", "textobjects")
end) end)
vim.keymap.set({ "x", "o" }, "ic", function() vim.keymap.set({ "x", "o" }, "ic", function()
require "nvim-treesitter-textobjects.select".select_textobject("@class.inner", "textobjects") require("nvim-treesitter-textobjects.select").select_textobject("@class.inner", "textobjects")
end) end)
-- You can also use captures from other query groups like `locals.scm` -- You can also use captures from other query groups like `locals.scm`
vim.keymap.set({ "x", "o" }, "as", function() vim.keymap.set({ "x", "o" }, "as", function()
require "nvim-treesitter-textobjects.select".select_textobject("@local.scope", "locals") require("nvim-treesitter-textobjects.select").select_textobject("@local.scope", "locals")
end) end)
-- NOTE: for more textobjects options, see the following link. -- NOTE: for more textobjects options, see the following link.
-- This template is using the new `main` branch of the repo. -- This template is using the new `main` branch of the repo.
-- https://github.com/nvim-treesitter/nvim-treesitter-textobjects/tree/main -- https://github.com/nvim-treesitter/nvim-treesitter-textobjects/tree/main
end, end,
}, },
} }

View file

@ -1,14 +1,17 @@
# TODO: look into changing to this:
# https://github.com/BirdeeHub/nix-wrapper-modules
{ {
inputs, inputs,
spkgs, spkgs,
mpkgs, mpkgs,
... ...
}: let }:
inherit let
(inputs.nixcats) inherit (inputs.nixcats)
utils utils
; ;
in { in
{
imports = [ imports = [
inputs.nixcats.homeModule inputs.nixcats.homeModule
]; ];
@ -23,211 +26,250 @@ in {
# add any plugins in inputs named "plugins-pluginName" to pkgs.neovimPlugins # add any plugins in inputs named "plugins-pluginName" to pkgs.neovimPlugins
# It will not apply to overall system, just nixCats. # It will not apply to overall system, just nixCats.
addOverlays = addOverlays =
/* # (import ./overlays inputs) ++
(import ./overlays inputs) ++
*/
[ [
(utils.standardPluginOverlay inputs) (utils.standardPluginOverlay inputs)
]; ];
# see the packageDefinitions below. # see the packageDefinitions below.
# This says which of those to install. # This says which of those to install.
packageNames = ["auroranvim"]; packageNames = [ "auroranvim" ];
luaPath = "${./.}"; luaPath = "${./.}";
# the .replace vs .merge options are for modules based on existing configurations, # the .replace vs .merge options are for modules based on existing configurations,
# they refer to how multiple categoryDefinitions get merged together by the module. # they refer to how multiple categoryDefinitions get merged together by the module.
# for useage of this section, refer to :h nixCats.flake.outputs.categories # for useage of this section, refer to :h nixCats.flake.outputs.categories
categoryDefinitions.replace = { categoryDefinitions.replace =
pkgs, {
settings, pkgs,
categories, settings,
extra, categories,
name, extra,
mkNvimPlugin, name,
... mkNvimPlugin,
} @ packageDef: { ...
lspsAndRuntimeDeps = { }@packageDef:
general = with pkgs; [ {
ripgrep lspsAndRuntimeDeps = with pkgs; {
fd general = [
]; ripgrep
treesitter = with pkgs; [ fd
tree-sitter
];
lang = with pkgs; {
lua = [
lua-language-server
]; ];
nix = [ treesitter = [
nil tree-sitter
nix-doc
]; ];
rust = with pkgs; [ lang = {
cargo lua = {
mpkgs.rust-analyzer lsp = [ lua-language-server ];
]; format = [ stylua ];
zig = with pkgs; [ };
spkgs.zls # FIX: using spkgs version as zls is broken rn ;-; nix = {
]; lsp = [
elixir = with pkgs; [ nil
elixir-ls nix-doc # TODO: i forgot what this is for
]; ];
gleam = with pkgs; [ format = [ nixfmt ];
gleam };
]; rust = {
haskell = with pkgs; [ lsp = [
haskell-language-server cargo
ormolu mpkgs.rust-analyzer
]; ];
java = with pkgs; [ format = [ rustfmt ];
jdt-language-server };
javaPackages.compiler.openjdk17 zig = [
javaPackages.compiler.openjdk21 spkgs.zls # FIX: using spkgs version as zls is broken rn ;-;
]; ];
}; elixir = [
}; elixir-ls
];
startupPlugins = { gleam = [
general = with pkgs.vimPlugins; [ gleam
lze ];
plenary-nvim haskell = {
nvim-notify lsp = [ haskell-language-server ];
nvim-web-devicons format = [ ormolu ];
base16-nvim };
mini-nvim java = [
]; jdt-language-server
treesitter = with pkgs.vimPlugins; [ javaPackages.compiler.openjdk17
nvim-treesitter-textobjects javaPackages.compiler.openjdk21
nvim-treesitter.withAllGrammars ];
];
};
optionalPlugins = {
general = with pkgs.vimPlugins; [
];
ui = with pkgs.vimPlugins; [
dressing-nvim
];
qol = with pkgs.vimPlugins; [
undotree
mini-hipatterns
];
telescope = with pkgs.vimPlugins; [
telescope-nvim
telescope-fzf-native-nvim
telescope-ui-select-nvim
];
fyler = with pkgs.vimPlugins; [
fyler-nvim
];
lsp = with pkgs.vimPlugins; [
nvim-lspconfig
];
completion = with pkgs.vimPlugins; [
blink-cmp
nvim-cmp
luasnip
friendly-snippets
cmp_luasnip
cmp-buffer
cmp-path
cmp-nvim-lua
cmp-nvim-lsp
cmp-cmdline
cmp-nvim-lsp-signature-help
cmp-cmdline-history
lspkind-nvim
];
lang = with pkgs.vimPlugins; {
java = [
nvim-jdtls
];
};
};
# shared libraries to be added to LD_LIBRARY_PATH
# variable available to nvim runtime
sharedLibraries = {
general = with pkgs; [
# libgit2
];
};
environmentVariables = {
lang = {
rust = {
# it literally won't see the rust-analyzer provided to it
# if you don't use an envrionment variable to tell it
RUST_ANALYZER_CMD = "${pkgs.rust-analyzer}/bin/rust-analyzer";
};
elixir = {
ELIXIR_LS_CMD = "${pkgs.elixir-ls}/scripts/language_server.sh";
};
java = {
JAVA_HOME = "${pkgs.javaPackages.compiler.openjdk17}";
OPENJDK_17 = "${pkgs.javaPackages.compiler.openjdk17}";
OPENJDK_21 = "${pkgs.javaPackages.compiler.openjdk21}";
}; };
}; };
};
extraWrapperArgs = {
test = [
''--set CATTESTVAR2 "It worked again!"''
];
};
# lists of the functions you would have passed to
# python.withPackages or lua.withPackages
# get the path to this python environment startupPlugins = with pkgs.vimPlugins; {
# in your lua config via general = [
# vim.g.python3_host_prog lze
# or run from nvim terminal via :!<packagename>-python3 plenary-nvim
extraPython3Packages = { nvim-notify
test = _: []; nvim-web-devicons
base16-nvim
mini-nvim
];
treesitter = [
nvim-treesitter-textobjects
nvim-treesitter.withAllGrammars
];
};
optionalPlugins = with pkgs.vimPlugins; {
general = [
];
ui = [
dressing-nvim
];
qol = [
undotree
mini-hipatterns
];
telescope = [
telescope-nvim
telescope-fzf-native-nvim
telescope-ui-select-nvim
];
fyler = [
fyler-nvim
];
lsp = [
nvim-lspconfig
];
completion = [
blink-cmp
nvim-cmp
luasnip
friendly-snippets
cmp_luasnip
cmp-buffer
cmp-path
cmp-nvim-lua
cmp-nvim-lsp
cmp-cmdline
cmp-nvim-lsp-signature-help
cmp-cmdline-history
lspkind-nvim
];
format = [
conform-nvim
];
comment = [
comment-nvim
];
lang = {
java = [
nvim-jdtls
];
};
};
# shared libraries to be added to LD_LIBRARY_PATH
# variable available to nvim runtime
sharedLibraries = {
general = with pkgs; [
# libgit2
];
};
environmentVariables = {
lang = {
rust.lsp = {
# it literally won't see the rust-analyzer provided to it
# if you don't use an envrionment variable to tell it
RUST_ANALYZER_CMD = "${mpkgs.rust-analyzer}/bin/rust-analyzer";
};
elixir.lsp = {
ELIXIR_LS_CMD = "${pkgs.elixir-ls}/scripts/language_server.sh";
};
java.lsp = {
JAVA_HOME = "${pkgs.javaPackages.compiler.openjdk17}";
OPENJDK_17 = "${pkgs.javaPackages.compiler.openjdk17}";
OPENJDK_21 = "${pkgs.javaPackages.compiler.openjdk21}";
};
};
};
extraWrapperArgs = {
test = [
''--set CATTESTVAR2 "It worked again!"''
];
};
# lists of the functions you would have passed to
# python.withPackages or lua.withPackages
# get the path to this python environment
# in your lua config via
# vim.g.python3_host_prog
# or run from nvim terminal via :!<packagename>-python3
extraPython3Packages = {
test = _: [ ];
};
# populates $LUA_PATH and $LUA_CPATH
extraLuaPackages = {
test = [ (_: [ ]) ];
};
}; };
# populates $LUA_PATH and $LUA_CPATH
extraLuaPackages = {
test = [(_: [])];
};
};
# see :help nixCats.flake.outputs.packageDefinitions # see :help nixCats.flake.outputs.packageDefinitions
packageDefinitions.replace = { packageDefinitions.replace = {
# these are the names of your packages # these are the names of your packages
# you can include as many as you wish. # you can include as many as you wish.
auroranvim = {pkgs, ...}: { auroranvim =
# they contain a settings set defined above { pkgs, ... }:
# see :help nixCats.flake.outputs.settings {
settings = { # they contain a settings set defined above
wrapRc = true; # see :help nixCats.flake.outputs.settings
# IMPORTANT: settings = {
# your alias may not conflict with your other packages. wrapRc = true;
aliases = ["auroravim" "auravim" "foxyvim" "avix" "fvix" "auim"]; # IMPORTANT:
}; # your alias may not conflict with your other packages.
# and a set of categories that you want aliases = [
# (and other information to pass to lua) "auroravim"
categories = { "auravim"
general = true; "foxyvim"
"avix"
"fvix"
"auim"
];
};
# and a set of categories that you want
# (and other information to pass to lua)
categories = {
general = true;
ui = true; ui = true;
qol = true; qol = true;
telescope = true; telescope = true;
fyler = true; fyler = true;
lsp = true; lsp = true;
completion = true; completion = true;
treesitter = true; treesitter = true;
format = true;
comment = true;
lang = { lang = {
lua = true; lua = {
nix = true; lsp = true;
rust = true; format = true;
zig = true; };
elixir = true; nix = {
gleam = true; lsp = true;
haskell = true; format = true;
java = true; };
rust = {
lsp = true;
format = true;
};
zig = true;
elixir = true;
gleam = true;
haskell = {
lsp = true;
format = true;
};
java = true;
};
}; };
}; };
};
}; };
}; };
}; };

View file

@ -23,6 +23,7 @@
networking = { networking = {
useNetworkd = false; useNetworkd = false;
networkmanager.enable = false;
useDHCP = false; useDHCP = false;
nftables.enable = true; nftables.enable = true;
@ -92,6 +93,7 @@
Gateway = "10.16.1.1"; Gateway = "10.16.1.1";
DNS = ["10.16.1.1"]; DNS = ["10.16.1.1"];
LinkLocalAddressing = "no"; LinkLocalAddressing = "no";
DHCP = "no";
}; };
linkConfig.RequiredForOnline = "routable"; linkConfig.RequiredForOnline = "routable";
}; };

View file

@ -1,22 +1,20 @@
{cerulean, ...} @ inputs: {
cerulean.mkNexus ./. (self: { inputs,
nexus = { cerulean,
args = {inherit inputs;}; ...
} @ args: {
modules = with inputs; []; nodes = {
base = inputs.nixpkgs; base = inputs.nixpkgs;
homeManager = inputs.home-manager;
args = {inherit inputs;};
modules = with inputs; [];
groups = { groups = {
servers = {}; servers = {};
}; };
nodes = let nodes = {
inherit
(self.nexus)
groups
;
in {
nixarawrui = { nixarawrui = {
system = "x86_64-linux"; system = "x86_64-linux";
@ -30,7 +28,7 @@ cerulean.mkNexus ./. (self: {
arcturus = { arcturus = {
system = "x86_64-linux"; system = "x86_64-linux";
groups = [ groups = groups: [
groups.servers groups.servers
]; ];
@ -75,11 +73,11 @@ cerulean.mkNexus ./. (self: {
]; ];
volumes = [ volumes = [
{ #{
image = "/var/lib/microvms/home-assistant/data.img"; #image = "/var/lib/microvms/home-assistant/data.img";
mountPoint = "/var/lib/hass"; #mountPoint = "/var/lib/hass";
size = 16384; # 16GB #autoCreate = false;
} #}
]; ];
}; };
@ -110,7 +108,7 @@ cerulean.mkNexus ./. (self: {
lyra = { lyra = {
system = "x86_64-linux"; system = "x86_64-linux";
groups = [ groups = groups: [
groups.servers groups.servers
]; ];
@ -122,4 +120,4 @@ cerulean.mkNexus ./. (self: {
}; };
}; };
}; };
}) }

View file

@ -2,7 +2,7 @@
{ {
services.home-assistant = { services.home-assistant = {
enable = true; enable = true;
configDir = "/var/lib/hass"; configDir = "/var/lib/hass/hass";
# disables config generation, i don't wanna configure home assistant # disables config generation, i don't wanna configure home assistant
# through nix at the moment # through nix at the moment
@ -16,15 +16,32 @@
extraPackages = python3Packages: with python3Packages; [ extraPackages = python3Packages: with python3Packages; [
getmac getmac
aiohue
numpy
aiodhcpwatcher
async-upnp-client
gtts
numpy
plexapi
pyipp
paho-mqtt
pyturbojpeg
]; ];
}; };
systemd.tmpfiles.rules = [ # configures the config directory to be mounted
# configures the config directory to be mounted # correctly with the right permissions
# correclty with the right permissions systemd.services.hass-permissions = {
"z /var/lib/hass 0755 hass hass -" wantedBy = [ "multi-user.target" ];
"z /var/lib/hass/lost+found 0755 hass hass -" after = [ "var-lib-hass.mount" ];
]; requires = [ "var-lib-hass.mount" ];
before = [ "home-assistant.service" ];
serviceConfig = {
Type = "oneshot";
ExecStart = "${pkgs.bash}/bin/bash -c 'mkdir -p /var/lib/hass/hass && chown hass:hass /var/lib/hass/hass'";
RemainAfterExit = true;
};
};
networking = { networking = {
nftables.enable = true; nftables.enable = true;