{ ... }: { home-manager.users.user = { config, pkgs, lib, ... }: { imports = [ ./tmux.nix ]; custom.tmux.enable = true; home.username = "user"; home.stateVersion = "26.05"; programs = { starship.enable = true; fish = { enable = true; plugins = [ { name = "puffer"; src = pkgs.fetchFromGitHub { owner = "nickeb96"; repo = "puffer-fish"; rev = "83174b0"; sha256 = "sha256-Dhx5+XRxJvlhdnFyimNxFyFiASrGU4ZwyefsDwtKnSg="; }; } ]; interactiveShellInit = '' set fish_greeting bind ctrl-space "" ''; }; ssh = { enable = true; enableDefaultConfig = false; settings = { "*" = { serverAliveInterval = 60; serverAliveCountMax = 3; }; }; }; delta = { enable = true; options = { navigate = true; line-numbers = true; side-by-side = true; }; enableGitIntegration = true; }; git = { enable = true; lfs.enable = true; settings = { user = { email = "maia@imatos.dev"; name = "maia"; signingkey = "~/.ssh/id_ed25519.pub"; }; safe = { directory = "/etc/nixos"; }; gpg = { format = "ssh"; ssh.allowedSignersFile = "~/.config/git/allowed_signers"; }; commit.gpgsign = true; tag.gpgsign = true; core = { editor = "nvim"; whitespace = "fix,only-indent-error,trailing-space,space-before-tab"; quotepath = false; }; diff = { algorithm = "histogram"; renames = "copies"; tool = "nvim"; }; difftool = { prompt = false; nvim.cmd = "nvim -d $LOCAL $REMOTE"; }; merge = { conflictstyle = "zdiff3"; tool = "nvim"; }; mergetool = { prompt = false; keepBackup = false; nvim.cmd = "nvim -d $LOCAL $REMOTE $MERGED -c 'wincmd w' -c 'wincmd J'"; }; init = { defaultBranch = "master"; }; push = { autoSetupRemote = true; default = "current"; }; pull = { rebase = true; }; fetch = { prune = true; }; help = { autocorrect = "prompt"; }; }; }; neovim = { enable = true; defaultEditor = true; viAlias = true; vimAlias = false; vimdiffAlias = true; withPython3 = false; withRuby = false; plugins = with pkgs.vimPlugins; [ { plugin = auto-session; type = "lua"; config = '' require("auto-session").setup({ cwd_change_handling = true, suppressed_dirs = { "$HOME", "/etc/nixos", "$HOME/tmp" }, }) ''; } { plugin = blink-cmp; type = "lua"; config = '' require("blink.cmp").setup({ completion = { documentation = { auto_show = true }, }, keymap = { preset = "default", [""] = { "snippet_forward", "fallback" }, [""] = { "select_and_accept", "snippet_forward", "fallback" }, [""] = { "snippet_backward", "fallback" }, }, }) ''; } # { # plugin = comment-nvim; # type = "lua"; # config = '' # require('Comment').setup() # ''; # } { plugin = conform-nvim; type = "lua"; config = '' require("conform").setup({ formatters_by_ft = { c = { "clang-format" }, cpp = { "clang-format" }, lua = { "stylua" }, javascript = { "prettierd" }, nix = { "nixfmt" }, python = { "black" }, php = { "php_cs_fixer" }, zig = { "zigfmt" }, css = { "prettierd" }, scss = { "prettierd" }, less = { "prettierd" }, blade = { "blade-formatter" }, go = { "gofmt" }, wgsl = { "wgsl_fmt" }, odin = { "odinfmt" }, }, }) vim.api.nvim_create_autocmd("BufWritePre", { pattern = "*", callback = function(args) require("conform").format({ bufnr = args.buf }) end, }) vim.keymap.set("n", "rf", function() require("conform").format({ lsp_fallback = true, async = true, timeout_ms = 500, }) end, { desc = "conform format" }) ''; } leap-nvim { plugin = mini-icons; type = "lua"; config = ''require("mini.icons").setup()''; } { plugin = neotest; type = "lua"; config = '' require('neotest').setup({ output = { open_on_run = true }, adapters = { require('neotest-pest'), -- require('neotest-zig'), -- require('neotest-odin'), }, watch = { filter_path = function(path, root) return true end, }, }) vim.keymap.set('n', 'pn', function() require('neotest').run.run() end, { desc = "test nearest" }) vim.keymap.set('n', 'pe', function() require('neotest').run.run(vim.fn.expand('%')) end, { desc = "test file" }) ''; } { plugin = neotest-pest; type = "lua"; } # { # plugin = neotest-zig; # type = "lua"; # } { plugin = nvim-autopairs; type = "lua"; config = '' require('nvim-autopairs').setup() ''; } { plugin = nvim-dap; type = "lua"; config = '' local dap = require("dap") dap.adapters = { php = { type = "executable", command = "${pkgs.nodejs}/bin/node", args = { "${pkgs.vscode-extensions.xdebug.php-debug}/share/vscode/extensions/xdebug.php-debug/out/phpDebug.js" }, }, } dap.configurations = { php = { { type = 'php', request = 'launch', name = 'listen for xdebug', port = 9003, } }, } ''; } { plugin = nvim-dap-ui; type = "lua"; config = '' local dapui = require("dapui") dapui.setup() dap.listeners.before.attach.dapui_config = function() dapui.open() end dap.listeners.before.launch.dapui_config = function() dapui.open() end dap.listeners.before.event_terminated.dapui_config = function() dapui.close() end dap.listeners.before.event_exited.dapui_config = function() dapui.close() end ''; } { plugin = nvim-treesitter.withAllGrammars; type = "lua"; config = '' local treesitter = require("nvim-treesitter") treesitter.setup() vim.api.nvim_create_autocmd('FileType', { pattern = { 'c', 'lua', 'vim', 'vimdoc', 'query', 'elixir', 'heex', 'javascript', 'typescript', 'html', 'yaml', 'blade', 'php', 'scss', 'comment', 'cmake' , 'dockerfile', 'fish', 'fsharp', 'git_config', 'git_rebase', 'gitignore', 'glsl', 'go', 'gomod', 'graphql', 'haskell', 'hlsl', 'http', 'ini', 'javadoc', 'jq', 'jsdoc', 'json', 'json5', 'kitty', 'latex', 'markdown', 'nginx', 'nix', 'php', 'php_only', 'phpdoc', 'regex', 'rust', 'sql', 'ssh_config', 'tmux', 'vim', 'wgsl', 'yaml', 'zig', 'odin', }, callback = function() vim.treesitter.start() end, }) ''; } { plugin = nvim-treesitter-context; type = "lua"; config = ''require("treesitter-context").setup()''; } # { # plugin = nvim-treesitter-textobjectse # type = "lua"; # config = '' # vim.g.no_plugin_maps = true # require("treesitter-textobjects").setup() # ''; # } nvim-lspconfig nvim-nio { plugin = nvim-surround; type = "lua"; config = ''require("nvim-surround").setup()''; } { plugin = nvim-web-devicons; type = "lua"; config = ''require("nvim-web-devicons").setup()''; } { plugin = oil-nvim; type = "lua"; config = '' require("oil").setup() vim.keymap.set("n", "o", "Oil", { desc = "Oil" }) ''; } { plugin = opencode-nvim; type = "lua"; config = '' vim.o.autoread = true -- Recommended/example keymaps. vim.keymap.set({ "n", "x" }, "h", function() require("opencode").ask("@this: ", { submit = true }) end, { desc = "Ask opencode…" }) vim.keymap.set({ "n", "x" }, "", function() require("opencode").select() end, { desc = "Execute opencode action…" }) vim.keymap.set({ "n", "t" }, "", function() require("opencode").toggle() end, { desc = "Toggle opencode" }) vim.keymap.set({ "n", "x" }, "go", function() return require("opencode").operator("@this ") end, { desc = "Add range to opencode", expr = true }) vim.keymap.set("n", "", function() require("opencode").command("session.half.page.up") end, { desc = "Scroll opencode up" }) vim.keymap.set("n", "", function() require("opencode").command("session.half.page.down") end, { desc = "Scroll opencode down" }) -- You may want these if you stick with the opinionated "" and "" above — otherwise consider "o…". vim.keymap.set("n", "+", "", { desc = "Increment under cursor", noremap = true }) vim.keymap.set("n", "-", "", { desc = "Decrement under cursor", noremap = true }) ''; } phpactor plenary-nvim { plugin = render-markdown-nvim; type = "lua"; config = ''require("render-markdown").setup()''; } { plugin = snacks-nvim; type = "lua"; config = '' local snacks = require("snacks") snacks.setup({ bigfile = {}, dim = {}, image = {}, indent = {}, lazygit = {}, picker = { win = { input = { keys = { [""] = { "close", mode = { "n", "i" } }, }, }, }, }, quickfile = {}, notifier = {}, }) vim.keymap.set({ "n" }, "t", snacks.picker.grep, { desc = "grep picker" }) vim.keymap.set({ "n" }, "r", snacks.picker.buffers, { desc = "buffer picker" }) vim.keymap.set({ "n" }, "s", snacks.picker.files, { desc = "file picker" }) vim.keymap.set({ "n" }, "ln", snacks.picker.lsp_references, { desc = "lsp references" }) vim.keymap.set("n", "le", snacks.picker.lsp_implementations, { desc = "lsp implementations" }) -- vim.keymap.set("n", "lg", function() snacks.lazygit() end , { desc = "lazygit" }) ''; } { plugin = tabby-nvim; type = "lua"; config = '' require("tabby").setup({ preset = "active_wins_at_tail", options = { theme = { fill = "TabLineFill", head = "TabLine", current_tab = "TabLineSel", tab = "TabLine", win = "TabLine", tail = "TabLine", }, nerdfont = true, lualine_theme = nil, tab_name = { name_fallback = function(tabid) return tabid end, }, buf_name = { mode = "unique", }, }, }) vim.keymap.set("n", "to", "Tabby jump_to_tab", { desc = "Jump to tab" }) vim.keymap.set("n", "tf", "Tabby pick_window", { desc = "Search tab" }) ''; } { plugin = ts-autotag-nvim; type = "lua"; config = '' require("ts-autotag").setup() ''; } { plugin = trouble-nvim; type = "lua"; config = '' require("trouble").setup({}) vim.keymap.set("n", "id", "Trouble diagnostics toggle", { desc = "Trouble project" }) ''; } { plugin = undotree; type = "lua"; config = ''vim.keymap.set("n", "u", vim.cmd.UndotreeToggle, { desc = "undotree" })''; } vim-repeat { plugin = which-key-nvim; type = "lua"; config = '' local wk = require("which-key") wk.setup({ preset = "helix", win = { row = 0, col = 0.5 }, triggers = { { "", mode = { "n", "v" } }, { "", mode = { "n", "v" } }, } }) wk.add({ { "s", group = "Search..." }, { "l", group = "Launch..." }, { "t", group = "Tab..." }, { "g", group = "Go..." }, { "r", group = "Run..." }, { "n", group = "term..." }, }) -- vim.keymap.set({"t"}, "", wk.show, { desc = "Show which key in terminal mode" }) ''; } vim-fugitive ]; initLua = '' ${builtins.readFile ./neovim/settings.lua} ${builtins.readFile ./neovim/plugins.lua} vim.cmd.colorscheme("desert") -- require("custom") ''; }; }; xdg.configFile."containers/containers.conf".text = '' [engine] compose_warning_logs=false ''; xdg.configFile."git/allowed_signers".text = '' maia@imatos.dev namespaces="git" ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEnSlABByEEDWpHcJxUotTTlPA/jcuk8wWiDxS5BfZQs ''; }; }