From ff832f22700e6297a7abad2cedac9c2631d84328 Mon Sep 17 00:00:00 2001 From: Xory Date: Thu, 28 Aug 2025 16:22:22 +0300 Subject: [PATCH] stuff --- hosts/nixvm/config/nvim/init.lua | 99 ++++++++++++++++++++++++++++++++ hosts/nixvm/configuration.nix | 6 ++ hosts/nixvm/home.nix | 20 ++++++- 3 files changed, 123 insertions(+), 2 deletions(-) create mode 100644 hosts/nixvm/config/nvim/init.lua diff --git a/hosts/nixvm/config/nvim/init.lua b/hosts/nixvm/config/nvim/init.lua new file mode 100644 index 0000000..e1c8e95 --- /dev/null +++ b/hosts/nixvm/config/nvim/init.lua @@ -0,0 +1,99 @@ +-- Bootstrap lazy.nvim +local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" +if not (vim.uv or vim.loop).fs_stat(lazypath) then + local lazyrepo = "https://github.com/folke/lazy.nvim.git" + local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath }) + if vim.v.shell_error ~= 0 then + vim.api.nvim_echo({ + { "Failed to clone lazy.nvim:\n", "ErrorMsg" }, + { out, "WarningMsg" }, + { "\nPress any key to exit..." }, + }, true, {}) + vim.fn.getchar() + os.exit(1) + end +end +vim.opt.rtp:prepend(lazypath) + +require("lazy").setup({ + { "catppuccin/nvim", name = "catppuccin" }, + { "williamboman/mason.nvim", opts = {} }, + { "williamboman/mason-lspconfig.nvim", opts = {} }, + "neovim/nvim-lspconfig", + "mfussenegger/nvim-dap", + { "jay-babu/mason-nvim-dap.nvim", opts = {} }, + {"nvim-treesitter/nvim-treesitter", lazy = false, branch = "main", build = ":TSUpdate", opts = {}}, + { "nvim-tree/nvim-tree.lua", opts = {} }, + "nvim-tree/nvim-web-devicons", + "romgrk/barbar.nvim", + { "nvim-lualine/lualine.nvim", opts = {} }, + { "windwp/nvim-autopairs", opts = {} }, + "neovim/nvim-lspconfig", + "hrsh7th/cmp-nvim-lsp", + "hrsh7th/cmp-buffer", + "hrsh7th/cmp-path", + "hrsh7th/cmp-cmdline", + "hrsh7th/nvim-cmp", + "hrsh7th/vim-vsnip", + "voldikss/vim-floaterm", + { + 'IogaMaster/neocord', + event = "VeryLazy", + opts = {} + } +}) + +vim.o.tabstop = 2 +vim.o.shiftwidth = 2 +vim.o.expandtab = true +vim.o.smarttab = true +vim.o.cursorline = true +vim.o.laststatus = 3 +vim.o.background = "dark" +vim.o.termguicolors = true +vim.o.number = true +vim.o.relativenumber = true +vim.cmd.colorscheme "catppuccin-mocha" +vim.o.guifont = "CaskaydiaCove Nerd Font:h11" + +vim.diagnostic.config({ + virtual_text = true, -- Show inline error messages + signs = true, -- Show signs in the gutter + underline = true, -- Underline errors + update_in_insert = false, + severity_sort = true, +}) + +local cmp = require'cmp' +cmp.setup({ + snippet = { + expand = function(args) + vim.fn["vsnip#anonymous"](args.body) + end, + }, + mapping = cmp.mapping.preset.insert({ + [''] = cmp.mapping.scroll_docs(-4), + [''] = cmp.mapping.scroll_docs(4), + [''] = cmp.mapping.complete(), + [''] = cmp.mapping.abort(), + [''] = cmp.mapping.confirm({ select = true }), + }), + sources = cmp.config.sources({ + { name = 'nvim_lsp' }, + { name = 'vsnip' }, + }, { + { name = 'buffer' }, + }) +}) + +local capabilities = require("cmp_nvim_lsp").default_capabilities() + +require("mason-lspconfig").setup({ + function (server_name) + require("lspconfig")[server_name].setup({ + capabilities = capabilities + }) + end, +}) + + diff --git a/hosts/nixvm/configuration.nix b/hosts/nixvm/configuration.nix index fd5779f..0519d5a 100644 --- a/hosts/nixvm/configuration.nix +++ b/hosts/nixvm/configuration.nix @@ -114,6 +114,12 @@ services.qemuGuest.enable = true; services.spice-vdagentd.enable = true; + nix.gc = { + automatic = true; + dates = "weekly"; + options = "--delete-older-than 2d"; + }; + # Some programs need SUID wrappers, can be configured further or are # started in user sessions. # programs.mtr.enable = true; diff --git a/hosts/nixvm/home.nix b/hosts/nixvm/home.nix index cba7eb5..179d0b3 100644 --- a/hosts/nixvm/home.nix +++ b/hosts/nixvm/home.nix @@ -9,8 +9,12 @@ firefox ]; - home.stateVersion = "25.05"; - + home.file = { + ".config/nvim/init.lua" = { + enable = true; + source = ./config/nvim/init.lua; + }; + }; programs.zsh = { enable = true; enableCompletion = true; @@ -19,4 +23,16 @@ }; syntaxHighlighting.enable = true; }; + programs.starship.enable = true; + + programs.kitty = { + enable = true; + themeFile = "Catppuccin-Mocha"; + font = { + name = "Inconsolata Nerd Font"; + package = pkgs.nerd-fonts.inconsolata; + }; + }; + + home.stateVersion = "25.05"; }