From 9ed1af62e46318bb73adcf1533f825a7aad67b35 Mon Sep 17 00:00:00 2001 From: danny Date: Sat, 6 Sep 2025 21:37:48 +0800 Subject: [PATCH] feat: replace nvim with nvf --- flake.lock | 106 ++- flake.nix | 6 + home/config/nvim/lua/config/autocmds.lua | 15 - home/config/nvim/lua/config/keymaps.lua | 3 - home/config/nvim/lua/config/options.lua | 59 -- home/config/nvim/lua/plugins/blink.lua | 26 - home/config/nvim/lua/plugins/colorscheme.lua | 74 -- home/config/nvim/lua/plugins/conform.lua | 23 - home/config/nvim/lua/plugins/image.lua | 18 - home/config/nvim/lua/plugins/lazygit.lua | 22 - home/config/nvim/lua/plugins/live-preview.lua | 13 - home/config/nvim/lua/plugins/lsp.lua | 109 --- home/config/nvim/lua/plugins/noice.lua | 32 - home/config/nvim/lua/plugins/notify.lua | 13 - home/config/nvim/lua/plugins/nvim-lint.lua | 24 - home/config/nvim/lua/plugins/nvim-ufo.lua | 92 --- home/config/nvim/lua/plugins/snacks.lua | 48 -- home/config/nvim/lua/plugins/suda.lua | 7 - home/config/nvim/lua/plugins/typescript.lua | 270 ------- .../config/nvim/lua/plugins/venv-selector.lua | 23 - home/config/nvim/lua/plugins/yuck.lua | 5 - home/config/nvim/stylua.toml | 3 - home/presets/basic.nix | 2 +- home/scripts/memeSelector.nix | 66 ++ home/user/hyprland.nix | 1 + home/user/nvf.nix | 763 ++++++++++++++++++ home/user/nvim.nix | 393 --------- home/user/packages.nix | 2 +- home/user/waybar.nix | 2 +- system/dev/dn-pre7780/default.nix | 14 +- system/modules/stylix.nix | 31 +- system/modules/sunshine.nix | 12 + 32 files changed, 978 insertions(+), 1299 deletions(-) delete mode 100644 home/config/nvim/lua/config/autocmds.lua delete mode 100644 home/config/nvim/lua/config/keymaps.lua delete mode 100644 home/config/nvim/lua/config/options.lua delete mode 100644 home/config/nvim/lua/plugins/blink.lua delete mode 100644 home/config/nvim/lua/plugins/colorscheme.lua delete mode 100644 home/config/nvim/lua/plugins/conform.lua delete mode 100644 home/config/nvim/lua/plugins/image.lua delete mode 100644 home/config/nvim/lua/plugins/lazygit.lua delete mode 100644 home/config/nvim/lua/plugins/live-preview.lua delete mode 100644 home/config/nvim/lua/plugins/lsp.lua delete mode 100644 home/config/nvim/lua/plugins/noice.lua delete mode 100644 home/config/nvim/lua/plugins/notify.lua delete mode 100644 home/config/nvim/lua/plugins/nvim-lint.lua delete mode 100644 home/config/nvim/lua/plugins/nvim-ufo.lua delete mode 100644 home/config/nvim/lua/plugins/snacks.lua delete mode 100644 home/config/nvim/lua/plugins/suda.lua delete mode 100644 home/config/nvim/lua/plugins/typescript.lua delete mode 100644 home/config/nvim/lua/plugins/venv-selector.lua delete mode 100644 home/config/nvim/lua/plugins/yuck.lua delete mode 100644 home/config/nvim/stylua.toml create mode 100644 home/scripts/memeSelector.nix create mode 100644 home/user/nvf.nix delete mode 100644 home/user/nvim.nix create mode 100644 system/modules/sunshine.nix diff --git a/flake.lock b/flake.lock index 4a1d780..6305a7c 100644 --- a/flake.lock +++ b/flake.lock @@ -396,6 +396,22 @@ } }, "flake-compat_8": { + "flake": false, + "locked": { + "lastModified": 1751685974, + "narHash": "sha256-NKw96t+BgHIYzHUjkTK95FqYRVKB8DHpVhefWSz/kTw=", + "ref": "refs/heads/main", + "rev": "549f2762aebeff29a2e5ece7a7dc0f955281a1d1", + "revCount": 92, + "type": "git", + "url": "https://git.lix.systems/lix-project/flake-compat.git" + }, + "original": { + "type": "git", + "url": "https://git.lix.systems/lix-project/flake-compat.git" + } + }, + "flake-compat_9": { "flake": false, "locked": { "lastModified": 1747046372, @@ -475,6 +491,27 @@ } }, "flake-parts_4": { + "inputs": { + "nixpkgs-lib": [ + "nvf", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1756770412, + "narHash": "sha256-+uWLQZccFHwqpGqr2Yt5VsW/PbeJVTn9Dk6SHWhNRPw=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "4524271976b625a4a605beefd893f270620fd751", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-parts_5": { "inputs": { "nixpkgs-lib": [ "stylix", @@ -601,7 +638,7 @@ }, "flake-utils_6": { "inputs": { - "systems": "systems_11" + "systems": "systems_12" }, "locked": { "lastModified": 1731533236, @@ -1390,6 +1427,21 @@ "type": "github" } }, + "mnw": { + "locked": { + "lastModified": 1756659871, + "narHash": "sha256-v6Rh4aQ6RKjM2N02kK9Usn0Ix7+OY66vNpeklc1MnGE=", + "owner": "Gerg-L", + "repo": "mnw", + "rev": "ed6cc3e48557ba18266e598a5ebb6602499ada16", + "type": "github" + }, + "original": { + "owner": "Gerg-L", + "repo": "mnw", + "type": "github" + } + }, "neovim-nightly-overlay": { "inputs": { "flake-compat": "flake-compat_5", @@ -1740,6 +1792,30 @@ "type": "github" } }, + "nvf": { + "inputs": { + "flake-compat": "flake-compat_8", + "flake-parts": "flake-parts_4", + "mnw": "mnw", + "nixpkgs": [ + "nixpkgs" + ], + "systems": "systems_10" + }, + "locked": { + "lastModified": 1756870502, + "narHash": "sha256-0diPvHFwQbKvKkz0bmEVEoFIzL4rdD80CaApHaj6hzs=", + "owner": "NotAShelf", + "repo": "nvf", + "rev": "7b009c945d2f0213409aa0bae07c79d28b92d625", + "type": "github" + }, + "original": { + "owner": "NotAShelf", + "repo": "nvf", + "type": "github" + } + }, "pre-commit-hooks": { "inputs": { "flake-compat": "flake-compat_3", @@ -1833,6 +1909,7 @@ "nix-minecraft": "nix-minecraft", "nix-tmodloader": "nix-tmodloader", "nixpkgs": "nixpkgs_7", + "nvf": "nvf", "sops-nix": "sops-nix", "stylix": "stylix", "swww": "swww", @@ -1965,13 +2042,13 @@ "base16-helix": "base16-helix", "base16-vim": "base16-vim", "firefox-gnome-theme": "firefox-gnome-theme", - "flake-parts": "flake-parts_4", + "flake-parts": "flake-parts_5", "gnome-shell": "gnome-shell", "nixpkgs": [ "nixpkgs" ], "nur": "nur", - "systems": "systems_10", + "systems": "systems_11", "tinted-foot": "tinted-foot", "tinted-kitty": "tinted-kitty", "tinted-schemes": "tinted-schemes", @@ -1994,7 +2071,7 @@ }, "swww": { "inputs": { - "flake-compat": "flake-compat_8", + "flake-compat": "flake-compat_9", "nixpkgs": "nixpkgs_9", "rust-overlay": "rust-overlay_3" }, @@ -2057,6 +2134,21 @@ "type": "github" } }, + "systems_12": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, "systems_2": { "locked": { "lastModified": 1681028828, @@ -2345,11 +2437,11 @@ "nixpkgs": "nixpkgs_11" }, "locked": { - "lastModified": 1755788000, - "narHash": "sha256-wREYvAtnBT8OD6NI/TO1M6Nc9Q9uV23Sem5EjW/lFw0=", + "lastModified": 1756537342, + "narHash": "sha256-2WMNWyuGE6RCjHFg0KD4lQV9eRpJkgyQBuZR3Nih2rk=", "owner": "dachxy", "repo": "zen-browser-flake", - "rev": "99cc11ef1338b4bbba84308cdd07b0fd9d2dbbc4", + "rev": "7a385cf911db37e18b337d488bba7e10084cd8d5", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 291d7f7..bf99c40 100644 --- a/flake.nix +++ b/flake.nix @@ -112,6 +112,11 @@ url = "github:nix-community/stylix"; inputs.nixpkgs.follows = "nixpkgs"; }; + + nvf = { + url = "github:NotAShelf/nvf"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; outputs = @@ -281,6 +286,7 @@ inputs.hyprland.homeManagerModules.default inputs.caelestia-shell.homeManagerModules.default inputs.zen-browser.homeManagerModules.${system}.default + inputs.nvf.homeManagerModules.default { home = { homeDirectory = "/home/${username}"; diff --git a/home/config/nvim/lua/config/autocmds.lua b/home/config/nvim/lua/config/autocmds.lua deleted file mode 100644 index 983c8a2..0000000 --- a/home/config/nvim/lua/config/autocmds.lua +++ /dev/null @@ -1,15 +0,0 @@ --- Autocmds are automatically loaded on the VeryLazy event --- Default autocmds that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/autocmds.lua --- Add any additional autocmds here - -vim.api.nvim_create_autocmd("VimEnter", { - desc = "Auto select virtualenv Nvim open", - pattern = "*.py", - callback = function() - local venv = vim.fn.findfile("pyproject.toml", vim.fn.getcwd() .. ";") - if venv ~= "" then - require("venv-selector").retrieve_from_cache() - end - end, - once = true, -}) diff --git a/home/config/nvim/lua/config/keymaps.lua b/home/config/nvim/lua/config/keymaps.lua deleted file mode 100644 index 2c134f7..0000000 --- a/home/config/nvim/lua/config/keymaps.lua +++ /dev/null @@ -1,3 +0,0 @@ --- Keymaps are automatically loaded on the VeryLazy event --- Default keymaps that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/keymaps.lua --- Add any additional keymaps here diff --git a/home/config/nvim/lua/config/options.lua b/home/config/nvim/lua/config/options.lua deleted file mode 100644 index fadf791..0000000 --- a/home/config/nvim/lua/config/options.lua +++ /dev/null @@ -1,59 +0,0 @@ --- Options are automatically loaded before lazy.nvim startup --- Default options that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/options.lua --- Add any additional options here - -function GetAvailableWindowsShell() - local shellList = { "nu", "pwsh-preview", "pwsh", "powershell", "cmd" } - local length = #shellList - for i = 1, length do - local commandToCheck = "where " .. shellList[i] - local exitCode = os.execute(commandToCheck) - if exitCode == 0 then - return shellList[i] - end - end - - return shellList[length - 1] -end - -if package.config:sub(1, 1) == "\\" then - vim.o.shell = GetAvailableWindowsShell() -end - -vim.g.lazyvim_python_lsp = "pyright" -vim.g.lazyvim_python_ruff = "ruff" -vim.g.lazyvim_eslint_auto_format = true -vim.o.background = "dark" - --- Tab settings -vim.g.expandtab = true -vim.g.softtabstop = 2 -vim.g.shiftwidth = 2 - --- Markdown preview -vim.g.mkdp_auto_close = 0 -vim.g.mkdp_combine_preview = 1 -vim.g.mkdp_echo_preview_url = 1 -vim.g.mkdp_open_to_the_world = 1 -vim.g.mkdp_port = "20088" - --- Use osc52 as clipboard provider -local function paste() - return { vim.fn.split(vim.fn.getreg(""), "\n"), vim.fn.getregtype("") } -end -vim.g.clipboard = { - name = "OSC 52", - copy = { - ["+"] = require("vim.ui.clipboard.osc52").copy("+"), - ["*"] = require("vim.ui.clipboard.osc52").copy("*"), - }, - paste = { - ["+"] = paste, - ["*"] = paste, - }, -} --- To ALWAYS use the clipboard for ALL operations --- (instead of interacting with the "+" and/or "*" registers explicitly): -vim.opt.clipboard = "unnamedplus" - -vim.opt.spelllang = { "en", "cjk" } diff --git a/home/config/nvim/lua/plugins/blink.lua b/home/config/nvim/lua/plugins/blink.lua deleted file mode 100644 index 9c1139b..0000000 --- a/home/config/nvim/lua/plugins/blink.lua +++ /dev/null @@ -1,26 +0,0 @@ -return { - { - "saghen/blink.cmp", - ---@module "blink.cmp" - ---@type blink.cmp.Config - opts = { - snippets = { - expand = function(snippet, _) - return LazyVim.cmp.expand(snippet) - end, - }, - completion = { - menu = { - border = "rounded", - }, - documentation = { - auto_show = true, - auto_show_delay_ms = 200, - window = { - border = "rounded", - }, - }, - }, - }, - }, -} diff --git a/home/config/nvim/lua/plugins/colorscheme.lua b/home/config/nvim/lua/plugins/colorscheme.lua deleted file mode 100644 index de240dd..0000000 --- a/home/config/nvim/lua/plugins/colorscheme.lua +++ /dev/null @@ -1,74 +0,0 @@ -return { - { - "catppuccin/nvim", - name = "catppuccin", - opts = { - flavour = "macchiato", - background = { - light = "latte", - dark = "macchiato", - }, - transparent_background = true, - integrations = { - aerial = true, - alpha = true, - cmp = true, - dashboard = true, - flash = true, - gitsigns = true, - headlines = true, - illuminate = true, - indent_blankline = { enabled = true }, - leap = true, - lsp_trouble = true, - mason = true, - markdown = true, - mini = true, - native_lsp = { - enabled = true, - underlines = { - errors = { "undercurl" }, - hints = { "undercurl" }, - warnings = { "undercurl" }, - information = { "undercurl" }, - }, - }, - navic = { enabled = true, custom_bg = "lualine" }, - neotest = true, - neotree = true, - noice = true, - notify = true, - semantic_tokens = true, - telescope = true, - treesitter = true, - treesitter_context = true, - which_key = true, - }, - }, - priority = 1000, - }, - { - "folke/tokyonight.nvim", - name = "tokyonight", - }, - { - "embark-theme/vim", - name = "embark", - opts = { - transparent_background = true, - }, - }, - { - "ellisonleao/gruvbox.nvim", - name = "gruvbox", - priority = 1000, - }, - { - "luisiacc/gruvbox-baby", - name = "gruvbox-baby", - }, - { - "sainnhe/gruvbox-material", - name = "gruvbox-material", - }, -} diff --git a/home/config/nvim/lua/plugins/conform.lua b/home/config/nvim/lua/plugins/conform.lua deleted file mode 100644 index 2f67ff7..0000000 --- a/home/config/nvim/lua/plugins/conform.lua +++ /dev/null @@ -1,23 +0,0 @@ -return { - { - "stevearc/conform.nvim", - opts = { - formatters_by_ft = { - json = { "prettierd", "prettier", stop_after_first = true }, - jsonc = { "prettierd", "prettier", stop_after_first = true }, - verilog = { "verible" }, - }, - formatters = { - verible = { - command = "verible-verilog-format", - args = { "-" }, - range_args = function(self, ctx) - return { "--lines", ctx.range.start[1] .. "-" .. ctx.range["end"][1] } - end, - stdin = true, - cwd = require("conform.util").root_file({ ".git" }), - }, - }, - }, - }, -} diff --git a/home/config/nvim/lua/plugins/image.lua b/home/config/nvim/lua/plugins/image.lua deleted file mode 100644 index 5ee5da8..0000000 --- a/home/config/nvim/lua/plugins/image.lua +++ /dev/null @@ -1,18 +0,0 @@ -return { - { - "3rd/image.nvim", - opts = { - backend = "kitty", - processor = "magick_cli", - integrations = { - markdown = { - enabled = true, - clear_in_insert_mode = false, - download_remote_images = true, - only_render_image_at_cursor = false, - floating_windows = false, - }, - }, - }, - }, -} diff --git a/home/config/nvim/lua/plugins/lazygit.lua b/home/config/nvim/lua/plugins/lazygit.lua deleted file mode 100644 index 62c5e48..0000000 --- a/home/config/nvim/lua/plugins/lazygit.lua +++ /dev/null @@ -1,22 +0,0 @@ -return { - { - "kdheepak/lazygit.nvim", - lazy = false, - cmd = { - "LazyGit", - "LazyGitConfig", - "LazyGitCurrentFile", - "LazyGitFilter", - "LazyGitFilterCurrentFile", - }, - -- optional for floating window border decoration - dependencies = { - "nvim-lua/plenary.nvim", - }, - -- setting the keybinding for LazyGit with 'keys' is recommended in - -- order to load the plugin when the command is run for the first time - keys = { - { "gg", "LazyGit", desc = "LazyGit" }, - }, - }, -} diff --git a/home/config/nvim/lua/plugins/live-preview.lua b/home/config/nvim/lua/plugins/live-preview.lua deleted file mode 100644 index 23fc482..0000000 --- a/home/config/nvim/lua/plugins/live-preview.lua +++ /dev/null @@ -1,13 +0,0 @@ -return { - { - "brianhuster/live-preview.nvim", - dependencies = { - -- You can choose one of the following pickers - "ibhagwan/fzf-lua", - }, - cmd = "LivePreview", - keys = { { "cp", "LivePreview closeLivePreview start", desc = "Live Preview" } }, - opts = true, - enabled = true, - }, -} diff --git a/home/config/nvim/lua/plugins/lsp.lua b/home/config/nvim/lua/plugins/lsp.lua deleted file mode 100644 index 212bd50..0000000 --- a/home/config/nvim/lua/plugins/lsp.lua +++ /dev/null @@ -1,109 +0,0 @@ -local util = require("lspconfig.util") - -return { - { - "neovim/nvim-lspconfig", - event = "LazyFile", - opts = { - on_init = function(client) - local path = client.workspace_folders[1].name - if vim.uv.fs_stat(path .. "/.luarc.json") or vim.uv.fs_stat(path .. "/.luarc.jsonc") then - return - end - - client.config.settings.Lua = vim.tbl_deep_extend("force", client.config.settings.Lua, { - runtime = { - -- Tell the language server which version of Lua you're using - -- (most likely LuaJIT in the case of Neovim) - version = "LuaJIT", - }, - -- Make the server aware of Neovim runtime files - workspace = { - checkThirdParty = false, - library = { - vim.env.VIMRUNTIME, - -- Depending on the usage, you might want to add additional paths here. - "${3rd}/luv/library", - -- "${3rd}/busted/library", - }, - }, - }) - end, - ui = { - windows = { - default_options = { - border = "rounded", - }, - }, - }, - servers = { - -- biome = { - -- root_dir = function(fname) - -- return util.root_pattern("biome.json", "biome.jsonc")(fname) - -- or util.find_package_json_ancestor(fname) - -- or vim.fs.find("node_modules", { path = fname, upward = true })[1] - -- or util.find_node_modules_ancestor(fname) - -- or util.find_git_ancestor(fname) - -- end, - -- }, - nil_ls = false, - nginx_language_server = { - cmd = { "nginx-language-server" }, - filetypes = { "nginx" }, - rootPatterns = { "biome.json", "biome.jsonc" }, - }, - volar = { - init_options = { - vue = { - hybridMode = true, - }, - }, - settings = { - typescript = { - inlayHints = { - enumMemberValues = { - enabled = true, - }, - functionLikeReturnTypes = { - enabled = true, - }, - propertyDeclarationTypes = { - enabled = true, - }, - parameterTypes = { - enabled = true, - suppressWhenArgumentMatchesName = true, - }, - variableTypes = { - enabled = true, - }, - }, - }, - }, - }, - vtsls = {}, - stylelint_lsp = { - filetypes = { "css", "scss", "vue" }, - root_dir = util.root_pattern("packages.json", ".git"), - debounce = 100, - settings = { - stylelintplus = { - autoFixOnFormat = true, - autoFixOnSave = true, - }, - }, - on_attach = function(client) - client.server_capabilities.document_formatting = false - end, - }, - svls = { - root_dir = function(fname) - return vim.fs.dirname(vim.fs.find(".git", { path = fname, upward = true })[1]) - end, - cmd = { "verible-verilog-ls", "--rules_config_search" }, - filetypes = { "verilog", "systemverilog" }, - }, - }, - }, - }, -} diff --git a/home/config/nvim/lua/plugins/noice.lua b/home/config/nvim/lua/plugins/noice.lua deleted file mode 100644 index 06b95f8..0000000 --- a/home/config/nvim/lua/plugins/noice.lua +++ /dev/null @@ -1,32 +0,0 @@ -return { - { - "folke/noice.nvim", - opts = { - presets = { - lsp_doc_border = true, - }, - lsp = { - override = { - ["cmp.entry.get_documentation"] = true, - }, - }, - views = { - hover = { - border = { - style = "rounded", - }, - }, - confirm = { - border = { - style = "rounded", - }, - }, - popup = { - border = { - style = "rounded", - }, - }, - }, - }, - }, -} diff --git a/home/config/nvim/lua/plugins/notify.lua b/home/config/nvim/lua/plugins/notify.lua deleted file mode 100644 index fd0cc90..0000000 --- a/home/config/nvim/lua/plugins/notify.lua +++ /dev/null @@ -1,13 +0,0 @@ -return { - { - "rcarriga/nvim-notify", - opts = { - stages = "slide", - render = "wrapped-compact", - timeout = 2000, - top_down = false, - fps = 40, - background_colour = "#000000", - }, - }, -} diff --git a/home/config/nvim/lua/plugins/nvim-lint.lua b/home/config/nvim/lua/plugins/nvim-lint.lua deleted file mode 100644 index f358382..0000000 --- a/home/config/nvim/lua/plugins/nvim-lint.lua +++ /dev/null @@ -1,24 +0,0 @@ -local pattern = "[^:]+:(%d+):(%d+):(%w+):(.+)" -local groups = { "lnum", "col", "code", "message" } - -return { - { - "mfussenegger/nvim-lint", - opts = { - linters_by_ft = { - -- verilog = { "verible" }, - }, - linters = { - verible = { - cmd = "verible-verilog-lint", - stdin = false, - args = { "--rules_config_search" }, - stream = nil, - ignore_exitcode = false, - env = nil, - parser = require("lint.parser").from_pattern(pattern, groups), - }, - }, - }, - }, -} diff --git a/home/config/nvim/lua/plugins/nvim-ufo.lua b/home/config/nvim/lua/plugins/nvim-ufo.lua deleted file mode 100644 index 53d133f..0000000 --- a/home/config/nvim/lua/plugins/nvim-ufo.lua +++ /dev/null @@ -1,92 +0,0 @@ -local handler = function(virtText, lnum, endLnum, width, truncate) - local newVirtText = {} - local suffix = (" 󰁂 %d "):format(endLnum - lnum) - local sufWidth = vim.fn.strdisplaywidth(suffix) - local targetWidth = width - sufWidth - local curWidth = 0 - for _, chunk in ipairs(virtText) do - local chunkText = chunk[1] - local chunkWidth = vim.fn.strdisplaywidth(chunkText) - if targetWidth > curWidth + chunkWidth then - table.insert(newVirtText, chunk) - else - chunkText = truncate(chunkText, targetWidth - curWidth) - local hlGroup = chunk[2] - table.insert(newVirtText, { chunkText, hlGroup }) - chunkWidth = vim.fn.strdisplaywidth(chunkText) - -- str width returned from truncate() may less than 2nd argument, need padding - if curWidth + chunkWidth < targetWidth then - suffix = suffix .. (" "):rep(targetWidth - curWidth - chunkWidth) - end - break - end - curWidth = curWidth + chunkWidth - end - table.insert(newVirtText, { suffix, "MoreMsg" }) - return newVirtText -end - -return { - { - "kevinhwang91/nvim-ufo", - dependencies = { "kevinhwang91/promise-async" }, - opts = { - provider_selector = function() - return { "lsp", "indent" } - end, - fold_virt_text_handler = handler, - filetype_exclude = { "help", "alpha", "dashboard", "neo-tree", "Trouble", "lazy", "mason" }, - }, - config = function(_, opts) - vim.api.nvim_create_autocmd("FileType", { - group = vim.api.nvim_create_augroup("local_detach_ufo", { clear = true }), - pattern = opts.filetype_exclude, - callback = function() - require("ufo").detach() - end, - }) - - vim.o.foldcolumn = "1" - vim.o.foldlevel = 99 - vim.o.foldlevelstart = 99 - vim.o.foldenable = true - require("ufo").setup(opts) - end, - keys = { - { - "zR", - mode = { "n" }, - function() - require("ufo").openAllFolds() - end, - { desc = "Open all folds" }, - }, - { - "zM", - mode = { "n" }, - function() - require("ufo").closeAllFolds() - end, - { desc = "Close all folds" }, - }, - { - "zK", - function() - local winid = require("ufo").peekFoldedLinesUnderCursor() - if not winid then - vim.lsp.buf.hover() - end - end, - { desc = "Peek Fold" }, - }, - { - "zr", - mode = { "n" }, - function() - require("ufo").openFoldsExceptKinds() - end, - { desc = "Open fold" }, - }, - }, - }, -} diff --git a/home/config/nvim/lua/plugins/snacks.lua b/home/config/nvim/lua/plugins/snacks.lua deleted file mode 100644 index 221807f..0000000 --- a/home/config/nvim/lua/plugins/snacks.lua +++ /dev/null @@ -1,48 +0,0 @@ -return { - { - "folke/snacks.nvim", - opts = { - explorer = { - enabled = true, - }, - image = { - enabled = true, - math = { - enabled = true, - }, - }, - picker = { - enabled = true, - sources = { - explorer = { - layout = { layout = { position = "right" } }, - }, - files = { - ignored = true, - }, - git_files = { - untracked = true, - }, - }, - }, - notifier = { enabled = true }, - dashboard = { - enabled = true, - width = 60, - row = nil, - col = nil, - preset = { - header = [[ - ██████████ █████████ █████████ █████ █████ █████ █████ █████ █████ -░░███░░░░███ ███░░░░░███ ███░░░░░███░░███ ░░███ ░░███ ░░███ ░░███ ░░███ - ░███ ░░███ ░███ ░███ ███ ░░░ ░███ ░███ ░░███ ███ ░░███ ███ - ░███ ░███ ░███████████ ░███ ░███████████ ░░█████ ░░█████ - ░███ ░███ ░███░░░░░███ ░███ ░███░░░░░███ ███░███ ░░███ - ░███ ███ ░███ ░███ ░░███ ███ ░███ ░███ ███ ░░███ ░███ - ██████████ █████ █████ ░░█████████ █████ █████ █████ █████ █████ - ░░░░░░░░░░ ░░░░░ ░░░░░ ░░░░░░░░░ ░░░░░ ░░░░░ ░░░░░ ░░░░░ ░░░░░]], - }, - }, - }, - }, -} diff --git a/home/config/nvim/lua/plugins/suda.lua b/home/config/nvim/lua/plugins/suda.lua deleted file mode 100644 index e08666d..0000000 --- a/home/config/nvim/lua/plugins/suda.lua +++ /dev/null @@ -1,7 +0,0 @@ -return { - { - "lambdalisue/vim-suda", - cmd = { "SudaWrite", "SudaRead" }, - keys = { { "bs", "SudaWrite", desc = "Save Buffer as Root" } }, - }, -} diff --git a/home/config/nvim/lua/plugins/typescript.lua b/home/config/nvim/lua/plugins/typescript.lua deleted file mode 100644 index 933549f..0000000 --- a/home/config/nvim/lua/plugins/typescript.lua +++ /dev/null @@ -1,270 +0,0 @@ -return { - recommended = function() - return LazyVim.extras.wants({ - ft = { - "javascript", - "javascriptreact", - "javascript.jsx", - "typescript", - "typescriptreact", - "typescript.tsx", - }, - root = { "tsconfig.json", "package.json", "jsconfig.json" }, - }) - end, - - -- correctly setup lspconfig - { - "neovim/nvim-lspconfig", - opts = { - -- make sure mason installs the server - servers = { - --- @deprecated -- tsserver renamed to ts_ls but not yet released, so keep this for now - --- the proper approach is to check the nvim-lspconfig release version when it's released to determine the server name dynamically - tsserver = { - enabled = false, - }, - ts_ls = { - enabled = false, - }, - vtsls = { - -- explicitly add default filetypes, so that we can extend - -- them in related extras - filetypes = { - "javascript", - "javascriptreact", - "javascript.jsx", - "typescript", - "typescriptreact", - "typescript.tsx", - }, - settings = { - complete_function_calls = true, - vtsls = { - enableMoveToFileCodeAction = true, - autoUseWorkspaceTsdk = true, - experimental = { - maxInlayHintLength = 30, - completion = { - enableServerSideFuzzyMatch = true, - }, - }, - }, - typescript = { - updateImportsOnFileMove = { enabled = "always" }, - suggest = { - completeFunctionCalls = true, - }, - inlayHints = { - enumMemberValues = { enabled = true }, - functionLikeReturnTypes = { enabled = true }, - parameterNames = { enabled = "literals" }, - parameterTypes = { enabled = true }, - propertyDeclarationTypes = { enabled = true }, - variableTypes = { enabled = false }, - }, - }, - }, - keys = { - { - "gD", - function() - local params = vim.lsp.util.make_position_params() - LazyVim.lsp.execute({ - command = "typescript.goToSourceDefinition", - arguments = { params.textDocument.uri, params.position }, - open = true, - }) - end, - desc = "Goto Source Definition", - }, - { - "gR", - function() - LazyVim.lsp.execute({ - command = "typescript.findAllFileReferences", - arguments = { vim.uri_from_bufnr(0) }, - open = true, - }) - end, - desc = "File References", - }, - { - "co", - LazyVim.lsp.action["source.organizeImports"], - desc = "Organize Imports", - }, - { - "cM", - LazyVim.lsp.action["source.addMissingImports.ts"], - desc = "Add missing imports", - }, - { - "cu", - LazyVim.lsp.action["source.removeUnused.ts"], - desc = "Remove unused imports", - }, - { - "cD", - LazyVim.lsp.action["source.fixAll.ts"], - desc = "Fix all diagnostics", - }, - { - "cV", - function() - LazyVim.lsp.execute({ command = "typescript.selectTypeScriptVersion" }) - end, - desc = "Select TS workspace version", - }, - }, - }, - }, - setup = { - --- @deprecated -- tsserver renamed to ts_ls but not yet released, so keep this for now - --- the proper approach is to check the nvim-lspconfig release version when it's released to determine the server name dynamically - tsserver = function() - -- disable tsserver - return true - end, - ts_ls = function() - -- disable tsserver - return true - end, - vtsls = function(_, opts) - LazyVim.lsp.on_attach(function(client, buffer) - client.commands["_typescript.moveToFileRefactoring"] = function(command, ctx) - ---@type string, string, lsp.Range - local action, uri, range = unpack(command.arguments) - - local function move(newf) - client.request("workspace/executeCommand", { - command = command.command, - arguments = { action, uri, range, newf }, - }) - end - - local fname = vim.uri_to_fname(uri) - client.request("workspace/executeCommand", { - command = "typescript.tsserverRequest", - arguments = { - "getMoveToRefactoringFileSuggestions", - { - file = fname, - startLine = range.start.line + 1, - startOffset = range.start.character + 1, - endLine = range["end"].line + 1, - endOffset = range["end"].character + 1, - }, - }, - }, function(_, result) - ---@type string[] - local files = result.body.files - table.insert(files, 1, "Enter new path...") - vim.ui.select(files, { - prompt = "Select move destination:", - format_item = function(f) - return vim.fn.fnamemodify(f, ":~:.") - end, - }, function(f) - if f and f:find("^Enter new path") then - vim.ui.input({ - prompt = "Enter move destination:", - default = vim.fn.fnamemodify(fname, ":h") .. "/", - completion = "file", - }, function(newf) - return newf and move(newf) - end) - elseif f then - move(f) - end - end) - end) - end - end, "vtsls") - -- copy typescript settings to javascript - opts.settings.javascript = - vim.tbl_deep_extend("force", {}, opts.settings.typescript, opts.settings.javascript or {}) - end, - }, - }, - }, - - { - "mfussenegger/nvim-dap", - optional = true, - opts = function() - local dap = require("dap") - if not dap.adapters["pwa-node"] then - require("dap").adapters["pwa-node"] = { - type = "server", - host = "localhost", - port = "${port}", - executable = { - command = "js-debug", - args = { - "${port}", - }, - }, - } - end - if not dap.adapters["node"] then - dap.adapters["node"] = function(cb, config) - if config.type == "node" then - config.type = "pwa-node" - end - local nativeAdapter = dap.adapters["pwa-node"] - if type(nativeAdapter) == "function" then - nativeAdapter(cb, config) - else - cb(nativeAdapter) - end - end - end - - local js_filetypes = { "typescript", "javascript", "typescriptreact", "javascriptreact" } - - local vscode = require("dap.ext.vscode") - vscode.type_to_filetypes["node"] = js_filetypes - vscode.type_to_filetypes["pwa-node"] = js_filetypes - - for _, language in ipairs(js_filetypes) do - if not dap.configurations[language] then - dap.configurations[language] = { - { - type = "pwa-node", - request = "launch", - name = "Launch file", - program = "${file}", - cwd = "${workspaceFolder}", - }, - { - type = "pwa-node", - request = "attach", - name = "Attach", - processId = require("dap.utils").pick_process, - cwd = "${workspaceFolder}", - }, - } - end - end - end, - }, - - -- Filetype icons - { - "echasnovski/mini.icons", - opts = { - file = { - [".eslintrc.js"] = { glyph = "󰱺", hl = "MiniIconsYellow" }, - [".node-version"] = { glyph = "", hl = "MiniIconsGreen" }, - [".prettierrc"] = { glyph = "", hl = "MiniIconsPurple" }, - [".yarnrc.yml"] = { glyph = "", hl = "MiniIconsBlue" }, - ["eslint.config.js"] = { glyph = "󰱺", hl = "MiniIconsYellow" }, - ["package.json"] = { glyph = "", hl = "MiniIconsGreen" }, - ["tsconfig.json"] = { glyph = "", hl = "MiniIconsAzure" }, - ["tsconfig.build.json"] = { glyph = "", hl = "MiniIconsAzure" }, - ["yarn.lock"] = { glyph = "", hl = "MiniIconsBlue" }, - }, - }, - }, -} diff --git a/home/config/nvim/lua/plugins/venv-selector.lua b/home/config/nvim/lua/plugins/venv-selector.lua deleted file mode 100644 index da93b2b..0000000 --- a/home/config/nvim/lua/plugins/venv-selector.lua +++ /dev/null @@ -1,23 +0,0 @@ -return { - { - "mfussenegger/nvim-dap", - config = function() end, - }, - { - "linux-cultist/venv-selector.nvim", - dependencies = { - "neovim/nvim-lspconfig", - "mfussenegger/nvim-dap", - "mfussenegger/nvim-dap-python", --optional - { "nvim-telescope/telescope.nvim", branch = "0.1.x", dependencies = { "nvim-lua/plenary.nvim" } }, - }, - lazy = false, - branch = "regexp", -- This is the regexp branch, use this for the new version - config = function() - require("venv-selector").setup() - end, - keys = { - { "cv", "VenvSelect" }, - }, - }, -} diff --git a/home/config/nvim/lua/plugins/yuck.lua b/home/config/nvim/lua/plugins/yuck.lua deleted file mode 100644 index eb1a207..0000000 --- a/home/config/nvim/lua/plugins/yuck.lua +++ /dev/null @@ -1,5 +0,0 @@ -return { - { - "elkowar/yuck.vim", - }, -} diff --git a/home/config/nvim/stylua.toml b/home/config/nvim/stylua.toml deleted file mode 100644 index 5d6c50d..0000000 --- a/home/config/nvim/stylua.toml +++ /dev/null @@ -1,3 +0,0 @@ -indent_type = "Spaces" -indent_width = 2 -column_width = 120 \ No newline at end of file diff --git a/home/presets/basic.nix b/home/presets/basic.nix index 507e7de..ca535e3 100644 --- a/home/presets/basic.nix +++ b/home/presets/basic.nix @@ -8,7 +8,6 @@ ../user/environment.nix ../user/gtk.nix ../user/wlogout.nix - ../user/nvim.nix ../user/packages.nix ../user/zen-browser.nix ../user/shell.nix @@ -17,5 +16,6 @@ ../user/vscode.nix ../user/yazi.nix ../user/zellij.nix + ../user/nvf.nix ]; } diff --git a/home/scripts/memeSelector.nix b/home/scripts/memeSelector.nix new file mode 100644 index 0000000..f409548 --- /dev/null +++ b/home/scripts/memeSelector.nix @@ -0,0 +1,66 @@ +{ pkgs, ... }: +pkgs.writers.writePython3Bin "memeSelector" { libraries = with pkgs.python3Packages; [ requests ]; } + '' + import requests + import xml.etree.ElementTree as ET + import urllib.parse + import sys + import os + import tempfile + import subprocess + + BASE_URL = "https://nextcloud.net.dn/public.php/dav/files/pygHoPB5LxDZbeY/" + headers = {"Depth": "1"} + resp = requests.request( + "PROPFIND", + BASE_URL, + headers=headers, + verify="${"" + ../../system/extra/ca.crt}" + ) + + if resp.status_code not in (200, 207): + print(f"Error: Http {resp.status_code}") + sys.exit(1) + + root = ET.fromstring(resp.text) + ns = {"d": "DAV:"} + + files = [] + for href in root.findall(".//d:href", ns): + path = href.text + if not path: + continue + filename = urllib.parse.unquote(path.split("/")[-1]) + + if filename and not filename.endswith("/"): + files.append(filename) + + if not files: + print("No files found") + sys.exit(0) + + rofi = subprocess.run( + ["rofi", "-dmenu", "-p", "Meme"], + input="\n".join(files).encode(), + stdout=subprocess.PIPE + ) + + selected = rofi.stdout.decode().strip() + if not selected: + sys.exit(0) + + url = BASE_URL + urllib.parse.quote(selected) + tmpfile = os.path.join(tempfile.gettempdir(), selected) + + subprocess.run(["wget", "-q", "-O", tmpfile, url], check=True) + + with open(tmpfile, "rb") as f: + subprocess.run("wl-copy", stdin=f) + + subprocess.run([ + "notify-send", + "-i", tmpfile, + "Meme Copied: ", + f"{selected}" + ]) + '' diff --git a/home/user/hyprland.nix b/home/user/hyprland.nix index a1b2c01..4186803 100644 --- a/home/user/hyprland.nix +++ b/home/user/hyprland.nix @@ -59,6 +59,7 @@ in ); settings = { + "$mainMod" = mainMod; debug = { disable_logs = true; }; diff --git a/home/user/nvf.nix b/home/user/nvf.nix new file mode 100644 index 0000000..cced247 --- /dev/null +++ b/home/user/nvf.nix @@ -0,0 +1,763 @@ +{ + pkgs, + lib, + ... +}: let + inherit (lib.generators) mkLuaInline; + + suda-nvim = pkgs.vimUtils.buildVimPlugin { + name = "vim-suda"; + src = pkgs.fetchFromGitHub { + owner = "lambdalisue"; + repo = "vim-suda"; + rev = "9adda7d195222d4e2854efb2a88005a120296c47"; + hash = "sha256-46sy3rAdOCULVt1RkIoGdweoV3MqQaB33Et9MrxI6Lk="; + }; + }; +in { + programs.nvf = { + enable = true; + settings = { + vim = { + enableLuaLoader = true; + clipboard = { + enable = true; + providers = { + wl-copy.enable = true; + }; + registers = "unnamedplus"; + }; + + extraPlugins = with pkgs.vimPlugins; { + transparent = { + package = transparent-nvim; + setup = + # lua + '' + require("transparent").setup({ + extra_groups = { + "NormalFloat", + "NvimTreeNormal", + "TreesitterContext", + "FloatBorder", + "FoldColumn", + "Folded", + "BlinkCmpMenu", + "BlinkCmpBorder", + "BlinkCmpKind", + "WarningMsg", + "ErrorMsg", + "BlinkCmpMenuBorder", + "FzfLuaBackdrop", + "VertSplit", + "Pmenu", + "PmenuSbar", + "DiffText", + "DiffViewNormal", + "CursorColumn", + "ColorColumn", + "QuickFixLine", + "Error", + "NoiceScrollbar" + }, + }) + require("transparent").clear_prefix("NeoTree") + require("transparent").clear_prefix("GitGutter") + ''; + }; + suda = { + package = suda-nvim; + }; + }; + + keymaps = [ + # === Files === # + # Explorer + { + key = "e"; + mode = ["n"]; + action = ":Neotree toggle"; + silent = true; + desc = "Toggle file explorer"; + } + # Fzf lua + { + key = ""; + silent = true; + mode = ["n"]; + action = ":FzfLua files"; + nowait = true; + unique = true; + desc = "Find file"; + } + { + key = "/"; + mode = ["n"]; + action = ":FzfLua live_grep"; + nowait = true; + unique = true; + desc = "Live grep"; + } + # Lsp symbol document + { + key = "ss"; + silent = true; + mode = ["n"]; + action = ":FzfLua lsp_document_symbols"; + nowait = true; + unique = true; + desc = "Find symbols (document)"; + } + # Lsp symbol workspace + { + key = "sS"; + silent = true; + mode = ["n"]; + action = ":FzfLua lsp_workspace_symbols"; + unique = true; + nowait = true; + desc = "Find symbols (workspace)"; + } + + # === Buffer === # + { + key = "bo"; + mode = ["n"]; + action = ":BufferLineCloseOther"; + desc = "Close other buffer"; + } + { + key = "bS"; + mode = ["n"]; + action = ":SudaWrite"; + desc = "Save file as root"; + } + + # === General Control === # + # Save file + { + key = ""; + mode = [ + "n" + "i" + "v" + ]; + action = ":w"; + desc = "Save file"; + } + { + key = ""; + mode = ["i"]; + action = ""; + desc = "Shift left"; + } + { + key = "gd"; + mode = ["n"]; + action = ":FzfLua lsp_definitions"; + nowait = true; + desc = "Go to definition"; + } + { + key = "gD"; + mode = ["n"]; + action = ":FzfLua lsp_declarations"; + nowait = true; + desc = "Go to declaration"; + } + { + key = "gi"; + mode = ["n"]; + action = ":FzfLua lsp_implementations"; + nowait = true; + desc = "Go to implementation"; + } + { + key = "gr"; + mode = ["n"]; + action = ":FzfLua lsp_references"; + nowait = true; + desc = "List references"; + } + { + key = "n"; + mode = ["n"]; + action = ":NoiceAll"; + nowait = true; + desc = "Notifications"; + } + + # === Tab === # + { + key = ">"; + mode = ["v"]; + action = ">gv"; + silent = true; + desc = "Shift right"; + } + { + key = "<"; + mode = ["v"]; + action = " curWidth + chunkWidth then + table.insert(newVirtText, chunk) + else + chunkText = truncate(chunkText, targetWidth - curWidth) + local hlGroup = chunk[2] + table.insert(newVirtText, {chunkText, hlGroup}) + chunkWidth = vim.fn.strdisplaywidth(chunkText) + -- str width returned from truncate() may less than 2nd argument, need padding + if curWidth + chunkWidth < targetWidth then + suffix = suffix .. (' '):rep(targetWidth - curWidth - chunkWidth) + end + break + end + curWidth = curWidth + chunkWidth + end + table.insert(newVirtText, {suffix, 'MoreMsg'}) + return newVirtText + end + ''; + + provider_selector = + mkLuaInline + # lua + '' + function(bufnr, filetype, buftype) + return {'treesitter', 'indent'} + end + ''; + }; + }; + borders = { + enable = true; + plugins = { + lspsaga.enable = true; + fastaction.enable = true; + lsp-signature.enable = true; + which-key.enable = true; + }; + }; + }; + }; + }; + }; +} diff --git a/home/user/nvim.nix b/home/user/nvim.nix deleted file mode 100644 index 8da9fbb..0000000 --- a/home/user/nvim.nix +++ /dev/null @@ -1,393 +0,0 @@ -{ - lib, - pkgs, - inputs, - ... -}: -{ - home.packages = with pkgs; [ - gh - ripgrep - fd - lua-language-server - nodejs_22 - nixfmt-rfc-style - markdownlint-cli2 - shfmt - nixd - marksman - nginx-language-server - bash-language-server - tailwindcss-language-server - vscode-langservers-extracted - gopls - pyright - yaml-language-server - marksman - lazygit - - # formatter - prettierd - black - - # SystemVerilog - verible - ]; - - programs.neovim = { - enable = true; - package = inputs.neovim-nightly-overlay.packages.${pkgs.system}.default; - withPython3 = true; - extraPython3Packages = ( - ps: with ps; [ - debugpy - ] - ); - - withNodeJs = true; - - extraPackages = with pkgs; [ - lua-language-server - ripgrep - stylua - vue-language-server - dockerfile-language-server-nodejs - ruff - hadolint - cmake-language-server - cmake-lint - cmake-format - markdownlint-cli2 - marksman - csharpier - netcoredbg - black - prettierd - biome - eslint - typescript-language-server - typescript - vtsls - stylelint-lsp - stylelint - clang-tools - taplo - zls - vscode-js-debug - neocmakelsp - - ghostscript - ]; - - plugins = with pkgs.vimPlugins; [ - lazy-nvim - ]; - - extraLuaConfig = - let - plugins = with pkgs.vimPlugins; [ - LazyVim - - bufferline-nvim - cmp-buffer - cmp-nvim-lsp - cmp-path - cmp-git - blink-cmp - crates-nvim - conform-nvim - dashboard-nvim - dressing-nvim - flash-nvim - friendly-snippets - gitsigns-nvim - grug-far-nvim - indent-blankline-nvim - lazydev-nvim - lualine-nvim - luvit-meta - neotest - noice-nvim - nui-nvim - nvim-cmp - nvim-lint - nvim-lspconfig - nvim-snippets - nvim-treesitter - nvim-treesitter-context - nvim-treesitter-textobjects - nvim-ts-autotag - nvim-ts-context-commentstring - nvim-web-devicons - persistence-nvim - plenary-nvim - snacks-nvim - telescope-fzf-native-nvim - telescope-nvim - todo-comments-nvim - tokyonight-nvim - trouble-nvim - ts-comments-nvim - which-key-nvim - vim-markdown-toc - nvim-dap - nvim-dap-ui - nvim-dap-virtual-text - nvim-nio - one-small-step-for-vimkind - none-ls-nvim - render-markdown-nvim - markdown-preview-nvim - markdown-nvim - image-nvim - hover-nvim - - # Python - neotest-python - nvim-dap-python - - # C# - omnisharp-extended-lsp-nvim - neotest-dotnet - - # Cmake - cmake-tools-nvim - SchemaStore-nvim - - { - name = "LuaSnip"; - path = luasnip; - } - - { - name = "catppuccin"; - path = catppuccin-nvim; - } - { - name = "mini.ai"; - path = mini-nvim; - } - { - name = "mini.bufremove"; - path = mini-nvim; - } - { - name = "mini.comment"; - path = mini-nvim; - } - { - name = "mini.indentscope"; - path = mini-nvim; - } - { - name = "mini.pairs"; - path = mini-nvim; - } - { - name = "mini.surround"; - path = mini-nvim; - } - ]; - mkEntryFromDrv = - drv: - if lib.isDerivation drv then - { - name = "${lib.getName drv}"; - path = drv; - } - else - drv; - - lazyPath = pkgs.linkFarm "lazy-plugins" (builtins.map mkEntryFromDrv plugins); - in - # lua - '' - require("lazy").setup({ - defaults = { - lazy = true, - }, - dev = { - -- reuse files from pkgs.vimPlugins.* - path = "${lazyPath}", - patterns = { "" }, - -- fallback to download - fallback = true, - }, - spec = { - { "LazyVim/LazyVim", import = "lazyvim.plugins" }, - -- The following configs are needed for fixing lazyvim on nix - -- force enable telescope-fzf-native.nvim - -- { "nvim-telescope/telescope-fzf-native.nvim", enabled = true }, - - { import = "lazyvim.plugins.extras.coding.blink" }, - { import = "lazyvim.plugins.extras.coding.luasnip" }, - { import = "lazyvim.plugins.extras.coding.mini-surround" }, - { import = "lazyvim.plugins.extras.coding.yanky" }, - { import = "lazyvim.plugins.extras.coding.neogen" }, - { import = "lazyvim.plugins.extras.dap.core" }, - { import = "lazyvim.plugins.extras.dap.nlua" }, - { import = "lazyvim.plugins.extras.editor.dial" }, - -- { import = "lazyvim.plugins.extras.formatting.biome" }, - { import = "lazyvim.plugins.extras.formatting.black" }, - { import = "lazyvim.plugins.extras.formatting.prettier" }, - { import = "lazyvim.plugins.extras.lang.cmake" }, - { import = "lazyvim.plugins.extras.lang.docker" }, - { import = "lazyvim.plugins.extras.lang.git" }, - { import = "lazyvim.plugins.extras.lang.json" }, - { import = "lazyvim.plugins.extras.lang.nix" }, - { import = "lazyvim.plugins.extras.lang.go" }, - { import = "lazyvim.plugins.extras.lang.zig" }, - { import = "lazyvim.plugins.extras.lang.markdown" }, - { import = "lazyvim.plugins.extras.lang.nushell" }, - { import = "lazyvim.plugins.extras.lang.omnisharp" }, - { import = "lazyvim.plugins.extras.lang.clangd" }, - { import = "lazyvim.plugins.extras.lang.python" }, - { import = "lazyvim.plugins.extras.lang.rust" }, - { import = "lazyvim.plugins.extras.lang.tailwind" }, - { import = "lazyvim.plugins.extras.lang.toml" }, - { import = "lazyvim.plugins.extras.lang.yaml" }, - { import = "lazyvim.plugins.extras.linting.eslint" }, - { import = "lazyvim.plugins.extras.ui.mini-animate" }, - { import = "lazyvim.plugins.extras.ui.mini-indentscope" }, - { import = "lazyvim.plugins.extras.ui.smear-cursor" }, - { import = "lazyvim.plugins.extras.ui.treesitter-context" }, - { import = "lazyvim.plugins.extras.util.dot" }, - { import = "lazyvim.plugins.extras.util.mini-hipatterns" }, - { import = "lazyvim.plugins.extras.util.project" }, - { import = "lazyvim.plugins.extras.util.rest" }, - { import = "lazyvim.plugins.extras.editor.refactoring" }, - { import = "lazyvim.plugins.extras.editor.harpoon2" }, - { import = "lazyvim.plugins.extras.editor.snacks_explorer" }, - { import = "lazyvim.plugins.extras.editor.snacks_picker" }, - - -- import/override your plugins - { import = "plugins" }, - - -- Vue & Typescript - { - "neovim/nvim-lspconfig", - opts = function(_, opts) - table.insert(opts.servers.vtsls.filetypes, "vue") - LazyVim.extend(opts.servers.vtsls, "settings.vtsls.tsserver.globalPlugins", { - { - name = "@vue/typescript-plugin", - location = "${pkgs.vue-language-server}/lib/node_modules/@vue/language-server", - languages = { "vue" }, - configNamespace = "typescript", - enableForWorkspaceTypeScriptVersions = true, - }, - }) - end - }, - - -- Python debugpy - { - { - "mfussenegger/nvim-dap-python", - config = function () - require("dap-python").setup("python3") - end - }, - }, - - -- Nix - { - "neovim/nvim-lspconfig", - opts = { - servers = { - nixd = { - cmd = { "nixd" }, - filetypes = { "nix" }, - settings = { - nixd = { - nixpkgs = { - expr = "import { }", - }, - formatting = { - command = { "nixfmt" }, - }, - } - } - } - } - } - }, - - -- disable mason.nvim, use config.extraPackages - { "williamboman/mason-lspconfig.nvim", enabled = false }, - { "williamboman/mason.nvim", enabled = false }, - { "jay-babu/mason-nvim-dap.nvim", enabled = false }, - - -- put this line at the end of spec to clear ensure_installed - { "nvim-treesitter/nvim-treesitter", opts = function(_, opts) opts.ensure_installed = {} end }, - }, - }) - ''; - }; - - xdg.configFile."nvim/parser".source = - let - parsers = pkgs.symlinkJoin { - name = "treesitter-parsers"; - paths = - (pkgs.vimPlugins.nvim-treesitter.withPlugins ( - plugins: with plugins; [ - c - cpp - c_sharp - lua - bash - comment - css - scss - nu - ninja - rst - - # rust - rust - ron - - # docker - dockerfile - - fish - - # cmake - cmake - - # git - gitattributes - gitignore - git_config - gitcommit - git_rebase - - go - gomod - gowork - gosum - - hcl - javascript - jq - json5 - lua - make - markdown - nix - python - toml - typescript - vue - yaml - zig - - ] - )).dependencies; - }; - in - "${parsers}/parser"; - - xdg.configFile."nvim/lua".source = ../config/nvim/lua; -} diff --git a/home/user/packages.nix b/home/user/packages.nix index 184e5b8..7e5e0fa 100644 --- a/home/user/packages.nix +++ b/home/user/packages.nix @@ -31,7 +31,7 @@ settings = { unfocused-split-opacity = 0.85; desktop-notifications = false; - background-opacity = 0; + background-opacity = 0.4; background-blur = false; wait-after-command = false; diff --git a/home/user/waybar.nix b/home/user/waybar.nix index 880849e..444ca68 100644 --- a/home/user/waybar.nix +++ b/home/user/waybar.nix @@ -129,7 +129,7 @@ in #memory, #cpu, #pulseaudio { - font-size: ${toString (osConfig.stylix.fonts.sizes.desktop + 2)}px; + font-size: ${toString (osConfig.stylix.fonts.sizes.desktop + 1)}px; } /* Main bar */ diff --git a/system/dev/dn-pre7780/default.nix b/system/dev/dn-pre7780/default.nix index e7ae368..fe0e989 100644 --- a/system/dev/dn-pre7780/default.nix +++ b/system/dev/dn-pre7780/default.nix @@ -11,6 +11,7 @@ let "desc:ASUSTek COMPUTER INC ASUS VG32VQ1B 0x00002271" "desc:Acer Technologies XV272U V3 1322131231233" ]; + memeSelector = pkgs.callPackage ../../../home/scripts/memeSelector.nix { }; in { networking.firewall.allowedTCPPortRanges = [ @@ -26,6 +27,7 @@ in imports = [ ./hardware-configuration.nix ../../modules/presets/basic.nix + ../../modules/sunshine.nix # Nvidia GPU Driver (import ../../modules/nvidia.nix { @@ -52,10 +54,16 @@ in ../../modules/davinci-resolve.nix ../../modules/webcam.nix + ../../modules/postgresql.nix ./nginx.nix - ]; + # Live Sync D + services.postgresql = { + ensureUsers = [ { name = "${username}"; } ]; + ensureDatabases = [ "livesyncd" ]; + }; + # Power Management services.tlp = { enable = true; @@ -65,6 +73,7 @@ in }; environment.systemPackages = with pkgs; [ + memeSelector rustdesk ((blender.override { cudaSupport = true; }).overrideAttrs (prev: { postInstall = '' @@ -161,6 +170,9 @@ in misc = { vrr = 0; }; + bind = [ + "$mainMod ctrl, M, exec, ${memeSelector}/bin/memeSelector" + ]; }; }; } diff --git a/system/modules/stylix.nix b/system/modules/stylix.nix index 28c15b2..d7225a5 100644 --- a/system/modules/stylix.nix +++ b/system/modules/stylix.nix @@ -3,16 +3,14 @@ config, username, ... -}: -let +}: let caskaydia = { name = "CaskaydiaCove Nerd Font Mono"; package = pkgs.nerd-fonts.caskaydia-cove; }; - sf-pro-display-bold = pkgs.callPackage ../../pkgs/fonts/sf-pro-display-bold { }; -in -{ + sf-pro-display-bold = pkgs.callPackage ../../pkgs/fonts/sf-pro-display-bold {}; +in { stylix = { enable = true; base16Scheme = "${pkgs.base16-schemes}/share/themes/gruvbox-material-dark-medium.yaml"; @@ -39,17 +37,14 @@ in }; fonts = { - packages = ( - with pkgs; - [ - font-awesome - jetbrains-mono - noto-fonts-cjk-sans - noto-fonts-cjk-serif - noto-fonts-emoji - sf-pro-display-bold - ] - ); + packages = with pkgs; [ + font-awesome + jetbrains-mono + noto-fonts-cjk-sans + noto-fonts-cjk-serif + noto-fonts-emoji + sf-pro-display-bold + ]; fontDir.enable = true; }; @@ -67,6 +62,10 @@ in hyprlock.enable = false; hyprland.enable = false; rofi.enable = false; + nvf = { + enable = true; + transparentBackground = true; + }; }; }; } diff --git a/system/modules/sunshine.nix b/system/modules/sunshine.nix new file mode 100644 index 0000000..4ce0a5e --- /dev/null +++ b/system/modules/sunshine.nix @@ -0,0 +1,12 @@ +{ config, ... }: +{ + services.sunshine = { + enable = true; + autoStart = true; + capSysAdmin = true; + openFirewall = true; + settings = { + sunshine_name = config.networking.hostName; + }; + }; +}