flake.nix now only declares inputs and calls flake-parts with import-tree
over ./modules: every .nix file under modules/ is a flake-parts module.
Features are aspects (flake.modules.nixos.<name> and
flake.modules.homeManager.<name>); importing an aspect enables it, so the
my.* option modules and their enable flags are gone.
- Add the flake-parts glue: modules/flake/ (systems, shared meta data,
host construction through configurations.nixos, overlays, packages,
apps, dev shell, formatter, checks), modules/users/faumaray.nix
(meta.owner) and modules/core/{nixpkgs,home-manager,install-facts}.nix.
config.my is kept as one read-only derived option so install-system
keeps working unchanged.
- Add the aspects that are already final: secrets, ssh, hyprland,
wezterm, git, stylix, proxy-suite, gitea-runner and claude-code, and
the desktop host (modules/hosts/desktop/{host,hardware,disks}.nix).
- Port the always-on basics to the `core` aspect (nix, boot, locale,
networking, users), lanzaboote and plain systemd-boot to the
`secure-boot` and `systemd-boot` aspects, and the installer ISO to
modules/installer/iso.nix. Behaviour is unchanged; the time zone,
default locale, XKB layouts and the firewall setting now live in
modules/hosts/desktop/host.nix.
- Move the Lua files (Hyprland settings, binds, rules; Neovim init.lua)
with git mv, byte-identical.
- Add bare stubs, marked STUB, for the aspects that the next phase
ports: amd, rocm, gaming, vpn, docker, noctalia, audio, fonts, xdg,
apps, shell and neovim. The host evaluates with them, but those
features are not configured until they are ported.
- Remove lib/, overlays/, apps/, modules/nixos/, modules/home/,
modules/installer/default.nix and hosts/desktop/{default,disks,home}.nix.
- flake.lock: add flake-parts, import-tree, stylix and serena with their
transitive inputs (22 new nodes); every existing pin is unchanged.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JZ16yf4acmaSiHq81vyQ6Z
150 lines
3.8 KiB
Lua
150 lines
3.8 KiB
Lua
-- Plugins are installed by Nix (see default.nix); this file only configures them.
|
|
|
|
vim.g.mapleader = " "
|
|
vim.g.maplocalleader = " "
|
|
|
|
-----------------
|
|
---- OPTIONS ----
|
|
-----------------
|
|
|
|
local o = vim.opt
|
|
o.number = true
|
|
o.relativenumber = true
|
|
o.signcolumn = "yes"
|
|
o.cursorline = true
|
|
o.termguicolors = true
|
|
o.mouse = "a"
|
|
o.clipboard = "unnamedplus"
|
|
o.undofile = true
|
|
o.ignorecase = true
|
|
o.smartcase = true
|
|
o.splitright = true
|
|
o.splitbelow = true
|
|
o.scrolloff = 8
|
|
o.updatetime = 250
|
|
o.timeoutlen = 400
|
|
o.expandtab = true
|
|
o.shiftwidth = 2
|
|
o.tabstop = 2
|
|
o.smartindent = true
|
|
o.wrap = false
|
|
o.list = true
|
|
o.listchars = { tab = "» ", trail = "·", nbsp = "␣" }
|
|
o.inccommand = "split"
|
|
|
|
---------------------
|
|
---- COLORSCHEME ----
|
|
---------------------
|
|
|
|
require("catppuccin").setup({ flavour = "mocha" })
|
|
vim.cmd.colorscheme("catppuccin")
|
|
|
|
require("nvim-web-devicons").setup()
|
|
require("lualine").setup({ options = { theme = "catppuccin-mocha", globalstatus = true } })
|
|
require("gitsigns").setup()
|
|
require("which-key").setup()
|
|
require("oil").setup()
|
|
|
|
-- mini.nvim: only the small editing helpers.
|
|
require("mini.pairs").setup()
|
|
require("mini.surround").setup()
|
|
|
|
--------------------
|
|
---- TREESITTER ----
|
|
--------------------
|
|
|
|
-- Parsers come from nvim-treesitter.withAllGrammars. Starting the built-in
|
|
-- highlighter works with both the old and the rewritten nvim-treesitter.
|
|
vim.api.nvim_create_autocmd("FileType", {
|
|
callback = function(args)
|
|
pcall(vim.treesitter.start, args.buf)
|
|
end,
|
|
})
|
|
|
|
--------------------
|
|
---- TELESCOPE ----
|
|
--------------------
|
|
|
|
local telescope = require("telescope")
|
|
telescope.setup({})
|
|
pcall(telescope.load_extension, "fzf")
|
|
|
|
local builtin = require("telescope.builtin")
|
|
vim.keymap.set("n", "<leader>ff", builtin.find_files, { desc = "Find files" })
|
|
vim.keymap.set("n", "<leader>fg", builtin.live_grep, { desc = "Grep" })
|
|
vim.keymap.set("n", "<leader>fb", builtin.buffers, { desc = "Buffers" })
|
|
vim.keymap.set("n", "<leader>fh", builtin.help_tags, { desc = "Help" })
|
|
vim.keymap.set("n", "<leader>fr", builtin.oldfiles, { desc = "Recent files" })
|
|
|
|
vim.keymap.set("n", "-", "<cmd>Oil<cr>", { desc = "File explorer" })
|
|
|
|
-------------
|
|
---- LSP ----
|
|
-------------
|
|
|
|
-- Neovim 0.11+ API. nvim-lspconfig supplies the default cmd, filetypes and
|
|
-- root markers for each server; the language servers are on nvim's PATH
|
|
-- (extraPackages in default.nix).
|
|
require("blink.cmp").setup({
|
|
keymap = { preset = "default" },
|
|
sources = { default = { "lsp", "path", "snippets", "buffer" } },
|
|
})
|
|
|
|
vim.lsp.config("*", {
|
|
capabilities = require("blink.cmp").get_lsp_capabilities(),
|
|
})
|
|
|
|
vim.lsp.config("nixd", {
|
|
settings = {
|
|
nixd = {
|
|
formatting = { command = { "nixfmt" } },
|
|
},
|
|
},
|
|
})
|
|
|
|
vim.lsp.config("lua_ls", {
|
|
settings = {
|
|
Lua = {
|
|
runtime = { version = "LuaJIT" },
|
|
diagnostics = { globals = { "vim", "hl" } },
|
|
workspace = { checkThirdParty = false },
|
|
telemetry = { enable = false },
|
|
},
|
|
},
|
|
})
|
|
|
|
vim.lsp.enable({ "nixd", "lua_ls", "bashls" })
|
|
|
|
vim.api.nvim_create_autocmd("LspAttach", {
|
|
callback = function(args)
|
|
local function map(lhs, rhs, desc)
|
|
vim.keymap.set("n", lhs, rhs, { buffer = args.buf, desc = desc })
|
|
end
|
|
map("gd", vim.lsp.buf.definition, "Go to definition")
|
|
map("gr", vim.lsp.buf.references, "References")
|
|
map("K", vim.lsp.buf.hover, "Hover")
|
|
map("<leader>rn", vim.lsp.buf.rename, "Rename")
|
|
map("<leader>ca", vim.lsp.buf.code_action, "Code action")
|
|
map("<leader>e", vim.diagnostic.open_float, "Line diagnostics")
|
|
end,
|
|
})
|
|
|
|
vim.diagnostic.config({ virtual_text = true, severity_sort = true })
|
|
|
|
-----------------------
|
|
---- FORMAT ON SAVE ----
|
|
-----------------------
|
|
|
|
require("conform").setup({
|
|
formatters_by_ft = {
|
|
nix = { "nixfmt" },
|
|
lua = { "stylua" },
|
|
sh = { "shfmt" },
|
|
bash = { "shfmt" },
|
|
},
|
|
format_on_save = {
|
|
timeout_ms = 1000,
|
|
lsp_format = "fallback",
|
|
},
|
|
})
|