diff --git a/flake.lock b/flake.lock index 8d18527..cfc55dd 100644 --- a/flake.lock +++ b/flake.lock @@ -1,136 +1,5 @@ { "nodes": { - "devshell": { - "inputs": { - "flake-utils": "flake-utils", - "nixpkgs": [ - "nixvim", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1711099426, - "narHash": "sha256-HzpgM/wc3aqpnHJJ2oDqPBkNsqWbW0WfWUO8lKu8nGk=", - "owner": "numtide", - "repo": "devshell", - "rev": "2d45b54ca4a183f2fdcf4b19c895b64fbf620ee8", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "devshell", - "type": "github" - } - }, - "flake-compat": { - "locked": { - "lastModified": 1696426674, - "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", - "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", - "revCount": 57, - "type": "tarball", - "url": "https://api.flakehub.com/f/pinned/edolstra/flake-compat/1.0.1/018afb31-abd1-7bff-a5e4-cff7e18efb7a/source.tar.gz" - }, - "original": { - "type": "tarball", - "url": "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz" - } - }, - "flake-compat_2": { - "flake": false, - "locked": { - "lastModified": 1696426674, - "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", - "owner": "edolstra", - "repo": "flake-compat", - "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", - "type": "github" - }, - "original": { - "owner": "edolstra", - "repo": "flake-compat", - "type": "github" - } - }, - "flake-parts": { - "inputs": { - "nixpkgs-lib": [ - "nixvim", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1712014858, - "narHash": "sha256-sB4SWl2lX95bExY2gMFG5HIzvva5AVMJd4Igm+GpZNw=", - "owner": "hercules-ci", - "repo": "flake-parts", - "rev": "9126214d0a59633752a136528f5f3b9aa8565b7d", - "type": "github" - }, - "original": { - "owner": "hercules-ci", - "repo": "flake-parts", - "type": "github" - } - }, - "flake-utils": { - "inputs": { - "systems": "systems" - }, - "locked": { - "lastModified": 1701680307, - "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "4022d587cbbfd70fe950c1e2083a02621806a725", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "flake-utils_2": { - "inputs": { - "systems": "systems_2" - }, - "locked": { - "lastModified": 1710146030, - "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "gitignore": { - "inputs": { - "nixpkgs": [ - "nixvim", - "pre-commit-hooks", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1709087332, - "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=", - "owner": "hercules-ci", - "repo": "gitignore.nix", - "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", - "type": "github" - }, - "original": { - "owner": "hercules-ci", - "repo": "gitignore.nix", - "type": "github" - } - }, "home-manager": { "inputs": { "nixpkgs": [ @@ -151,48 +20,6 @@ "type": "github" } }, - "home-manager_2": { - "inputs": { - "nixpkgs": [ - "nixvim", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1712989663, - "narHash": "sha256-r2X/DIAyKOLiHoncjcxUk1TENWDTTaigRBaY53Cts/w=", - "owner": "nix-community", - "repo": "home-manager", - "rev": "40ab43ae98cb3e6f07eaeaa3f3ed56d589da21b0", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "home-manager", - "type": "github" - } - }, - "nix-darwin": { - "inputs": { - "nixpkgs": [ - "nixvim", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1711763326, - "narHash": "sha256-sXcesZWKXFlEQ8oyGHnfk4xc9f2Ip0X/+YZOq3sKviI=", - "owner": "lnl7", - "repo": "nix-darwin", - "rev": "36524adc31566655f2f4d55ad6b875fb5c1a4083", - "type": "github" - }, - "original": { - "owner": "lnl7", - "repo": "nix-darwin", - "type": "github" - } - }, "nixpkgs": { "locked": { "lastModified": 1713248628, @@ -225,96 +52,11 @@ "type": "github" } }, - "nixvim": { - "inputs": { - "devshell": "devshell", - "flake-compat": "flake-compat", - "flake-parts": "flake-parts", - "home-manager": "home-manager_2", - "nix-darwin": "nix-darwin", - "nixpkgs": [ - "nixpkgs" - ], - "pre-commit-hooks": "pre-commit-hooks" - }, - "locked": { - "lastModified": 1713294906, - "narHash": "sha256-xJJZdCBzVFpVppaYyUK4lTTNOnbAxrjhodoJL3Oi91E=", - "owner": "nix-community", - "repo": "nixvim", - "rev": "514a51877df9fe41ffc38c5237e3c4e5327e7607", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "nixvim", - "type": "github" - } - }, - "pre-commit-hooks": { - "inputs": { - "flake-compat": "flake-compat_2", - "flake-utils": "flake-utils_2", - "gitignore": "gitignore", - "nixpkgs": [ - "nixvim", - "nixpkgs" - ], - "nixpkgs-stable": [ - "nixvim", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1712897695, - "narHash": "sha256-nMirxrGteNAl9sWiOhoN5tIHyjBbVi5e2tgZUgZlK3Y=", - "owner": "cachix", - "repo": "pre-commit-hooks.nix", - "rev": "40e6053ecb65fcbf12863338a6dcefb3f55f1bf8", - "type": "github" - }, - "original": { - "owner": "cachix", - "repo": "pre-commit-hooks.nix", - "type": "github" - } - }, "root": { "inputs": { "home-manager": "home-manager", "nixpkgs": "nixpkgs", - "nixpkgs-stable": "nixpkgs-stable", - "nixvim": "nixvim" - } - }, - "systems": { - "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, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" + "nixpkgs-stable": "nixpkgs-stable" } } }, diff --git a/flake.nix b/flake.nix index 5faf1eb..cc31b88 100644 --- a/flake.nix +++ b/flake.nix @@ -10,11 +10,6 @@ url = "github:nix-community/home-manager"; inputs.nixpkgs.follows = "nixpkgs"; }; - - nixvim = { - url = "github:nix-community/nixvim"; - inputs.nixpkgs.follows = "nixpkgs"; - }; }; outputs = { self, nixpkgs, nixpkgs-stable, home-manager, ... }@inputs: @@ -34,7 +29,6 @@ }; modules = [ ./nixos/configuration.nix - inputs.nixvim.nixosModules.nixvim ]; }; diff --git a/home-manager/modules/bundle.nix b/home-manager/modules/bundle.nix index 3f58742..a259120 100644 --- a/home-manager/modules/bundle.nix +++ b/home-manager/modules/bundle.nix @@ -5,6 +5,7 @@ ./htop.nix ./alacritty.nix ./qt.nix + ./nvim.nix ./wms/hyprland.nix ./wms/waybar.nix diff --git a/home-manager/modules/nvim.nix b/home-manager/modules/nvim.nix new file mode 100644 index 0000000..92edfba --- /dev/null +++ b/home-manager/modules/nvim.nix @@ -0,0 +1,11 @@ +{ pkgs, ... }: { + xdg.configFile.nvim = { + source = pkgs.fetchFromGitHub { + owner = "AstroNvim"; + repo = "template"; + rev = "60a8ea905787c27cbd854985e47dc2195e763732"; + sha256 = "03bxdzs9zjm1xd0aqwsckm1d2hbz8bsfw6ac5fzx319a2hyiwfp9"; + }; + recursive = true; + }; +} diff --git a/nixos/modules/bundle.nix b/nixos/modules/bundle.nix index 2a9dae9..6459836 100644 --- a/nixos/modules/bundle.nix +++ b/nixos/modules/bundle.nix @@ -11,6 +11,5 @@ ./hyprland.nix ./trim.nix ./bluetooth.nix - ./nixvim/nixvim.nix ]; } diff --git a/nixos/modules/nixvim/autocmds.nix b/nixos/modules/nixvim/autocmds.nix deleted file mode 100644 index 4fca334..0000000 --- a/nixos/modules/nixvim/autocmds.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ - programs.nixvim = { - autoCmd = [ - { - event = [ "VimEnter" ]; - command = ":TransparentEnable"; - } - ]; - }; -} diff --git a/nixos/modules/nixvim/keymaps.nix b/nixos/modules/nixvim/keymaps.nix deleted file mode 100644 index 4d7b8d9..0000000 --- a/nixos/modules/nixvim/keymaps.nix +++ /dev/null @@ -1,68 +0,0 @@ -{ config, lib, ... }: { - programs.nixvim = { - globals = { - mapleader = "\\"; - maplocalleader = "\\"; - }; - - keymaps = let - normal = - lib.mapAttrsToList - (key: action: { - mode = "n"; - inherit action key; - }) - { - # Open Neotree - "n" = ":Neotree"; - - # Esc to clear search results - "" = ":noh"; - - # fix Y behaviour - Y = "y$"; - - # back and fourth between the two most recent files - "" = ":b#"; - - # close by Ctrl+x - "" = ":close"; - - # save by \+s or Ctrl+s - "s" = ":w"; - "" = ":w"; - - # navigate windows - "h" = "h"; - "j" = "j"; - "k" = "k"; - "l" = "l"; - - # resize with arrows - "" = ":resize -2"; - "" = ":resize +2"; - "" = ":vertical resize +2"; - "" = ":vertical resize -2"; - - # move current line up/down - # M = Alt key - "" = ":move-2"; - "" = ":move+"; - }; - visual = - lib.mapAttrsToList - (key: action: { - mode = "v"; - inherit action key; - }) - { - # move selected line / block of text in visual mode - "K" = ":m '<-2gv=gv"; - "J" = ":m '>+1gv=gv"; - }; - in - config.nixvim.helpers.keymaps.mkKeymaps - {options.silent = true;} - (normal ++ visual); - }; -} diff --git a/nixos/modules/nixvim/nixvim.nix b/nixos/modules/nixvim/nixvim.nix deleted file mode 100644 index df97be1..0000000 --- a/nixos/modules/nixvim/nixvim.nix +++ /dev/null @@ -1,16 +0,0 @@ -{ - - imports = [ - ./opts.nix - ./keymaps.nix - ./autocmds.nix - ./plugins/plugins-bundle.nix - ]; - - programs.nixvim = { - enable = true; - - defaultEditor = true; - colorschemes.oxocarbon.enable = true; - }; -} diff --git a/nixos/modules/nixvim/opts.nix b/nixos/modules/nixvim/opts.nix deleted file mode 100644 index d3d7822..0000000 --- a/nixos/modules/nixvim/opts.nix +++ /dev/null @@ -1,64 +0,0 @@ -{ - programs.nixvim = { - - clipboard = { - register = "unnamedplus"; - providers.wl-copy.enable = true; - }; - - opts = { - updatetime = 100; # Faster completion - - relativenumber = true; # Relative line numbers - number = true; # Display the absolute line number of the current line - - hidden = true; # Keep closed buffer open in the background - - mouse = "a"; # Enable mouse control - mousemodel = "extend"; # Mouse right-click extends the current selection - - splitbelow = true; # A new window is put below the current one - splitright = true; # A new window is put right of the current one - - swapfile = false; # Disable the swap file - - modeline = true; # Tags such as 'vim:ft=sh' - modelines = 100; # Sets the type of modelines - - undofile = true; # Automatically save and restore undo history - - incsearch = true; # Incremental search: show match for partly typed search command - - inccommand = "split"; # Search and replace: preview changes in quickfix list - ignorecase = true; # When the search query is lower-case, match both lower and upper-case - smartcase = true; # Override the 'ignorecase' option if the search pattern contains upper - - scrolloff = 12; # Number of screen lines to show around the cursor - - cursorline = false; # Highlight the screen line of the cursor - cursorcolumn = false; # Highlight the screen column of the cursor - signcolumn = "yes"; # Whether to show the signcolumn - colorcolumn = "100"; # Columns to highlight - - laststatus = 3; # When to use a status line for the last window - - fileencoding = "utf-8"; # File-content encoding for the current buffer - - termguicolors = false; # Disables 24-bit RGB color in the |TUI| - - spell = false; # Highlight spelling mistakes (local to window) - wrap = false; # Prevent text from wrapping - - tabstop = 2; # Number of spaces a in the text stands for (local to buffer) - shiftwidth = 2; # Number of spaces used for each step of (auto)indent (local to buffer) - expandtab = true; # Expand to spaces in Insert mode (local to buffer) - autoindent = true; # Do clever autoindenting - - textwidth = 0; # Maximum width of text that is being inserted. A longer line will be - - foldlevel = 99; # Folds with a level higher than this number will be closed - - completeopt = ["menu" "menuone" "noselect"]; # For CMP plugin - }; - }; -} diff --git a/nixos/modules/nixvim/plugins/barbar.nix b/nixos/modules/nixvim/plugins/barbar.nix deleted file mode 100644 index 218fc90..0000000 --- a/nixos/modules/nixvim/plugins/barbar.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ - programs.nixvim.plugins.barbar = { - enable = true; - keymaps = { - silent = true; - - next = ""; - previous = ""; - # close = ""; - }; - }; -} diff --git a/nixos/modules/nixvim/plugins/cmp.nix b/nixos/modules/nixvim/plugins/cmp.nix deleted file mode 100644 index 66afc03..0000000 --- a/nixos/modules/nixvim/plugins/cmp.nix +++ /dev/null @@ -1,32 +0,0 @@ -{ - programs.nixvim.plugins.cmp = { - enable = true; - - settings = { - snippet.expand = "function(args) require('luasnip').lsp_expand(args.body) end"; - - mapping = { - "" = "cmp.mapping.scroll_docs(-4)"; - "" = "cmp.mapping.scroll_docs(4)"; - "" = "cmp.mapping.complete()"; - "" = "cmp.mapping.close()"; - "" = "cmp.mapping(cmp.mapping.select_next_item(), {'i', 's'})"; - "" = "cmp.mapping(cmp.mapping.select_prev_item(), {'i', 's'})"; - "" = "cmp.mapping.confirm({ select = true })"; - }; - - sources = [ - {name = "path";} - {name = "nvim_lsp";} - {name = "cmp_tabby";} - {name = "luasnip";} - { - name = "buffer"; - # Words from other open buffers can also be suggested. - option.get_bufnrs.__raw = "vim.api.nvim_list_bufs"; - } - {name = "neorg";} - ]; - }; - }; -} diff --git a/nixos/modules/nixvim/plugins/comment.nix b/nixos/modules/nixvim/plugins/comment.nix deleted file mode 100644 index 5aa38ad..0000000 --- a/nixos/modules/nixvim/plugins/comment.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ - programs.nixvim.plugins.comment = { - enable = true; - - settings = { - opleader.line = "gcc"; - toggler.line = "gcc"; - }; - }; -} diff --git a/nixos/modules/nixvim/plugins/floaterm.nix b/nixos/modules/nixvim/plugins/floaterm.nix deleted file mode 100644 index 7185d66..0000000 --- a/nixos/modules/nixvim/plugins/floaterm.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ - programs.nixvim.plugins.floaterm = { - enable = true; - - width = 0.8; - height = 0.8; - - title = ""; - - keymaps.toggle = ""; - }; -} diff --git a/nixos/modules/nixvim/plugins/lsp.nix b/nixos/modules/nixvim/plugins/lsp.nix deleted file mode 100644 index 045f7ed..0000000 --- a/nixos/modules/nixvim/plugins/lsp.nix +++ /dev/null @@ -1,46 +0,0 @@ -{ - programs.nixvim.plugins = { - - treesitter = { - enable = true; - nixvimInjections = true; - folding = true; - indent = true; - }; - - treesitter-refactor = { - enable = true; - highlightDefinitions = { - enable = true; - # Set to false if you have an `updatetime` of ~100. - clearOnCursorMove = false; - }; - }; - - hmts.enable = true; - - # lspkind = { - # enable = true; - # - # cmp = { - # enable = true; - # menu = { - # nvim_lsp = "[LSP]"; - # nvim_lua = "[api]"; - # path = "[path]"; - # luasnip = "[snip]"; - # buffer = "[buffer]"; - # neorg = "[neorg]"; - # cmp_tabby = "[Tabby]"; - # }; - # }; - # }; - - lsp = { - enable = true; - servers = { - nil_ls.enable = true; - }; - }; - }; -} diff --git a/nixos/modules/nixvim/plugins/lualine.nix b/nixos/modules/nixvim/plugins/lualine.nix deleted file mode 100644 index 4fa95d7..0000000 --- a/nixos/modules/nixvim/plugins/lualine.nix +++ /dev/null @@ -1,47 +0,0 @@ -{ - programs.nixvim.plugins.lualine = { - - enable = true; - globalstatus = true; - - # +-------------------------------------------------+ - # | A | B | C X | Y | Z | - # +-------------------------------------------------+ - - sections = { - lualine_a = ["mode"]; - lualine_b = ["branch"]; - lualine_c = ["filename" "diff"]; - - lualine_x = [ - "diagnostics" - - # Show active language server - { - name.__raw = '' - function() - local msg = "" - local buf_ft = vim.api.nvim_buf_get_option(0, 'filetype') - local clients = vim.lsp.get_active_clients() - if next(clients) == nil then - return msg - end - for _, client in ipairs(clients) do - local filetypes = client.config.filetypes - if filetypes and vim.fn.index(filetypes, buf_ft) ~= -1 then - return client.name - end - end - return msg - end - ''; - icon = " "; - # color.fg = "#ffffff"; - } - "encoding" - "fileformat" - "filetype" - ]; - }; - }; -} diff --git a/nixos/modules/nixvim/plugins/mini.nix b/nixos/modules/nixvim/plugins/mini.nix deleted file mode 100644 index bd41a68..0000000 --- a/nixos/modules/nixvim/plugins/mini.nix +++ /dev/null @@ -1,20 +0,0 @@ -{ - programs.nixvim.plugins.mini = { - enable = true; - - modules = { - align = {}; - basics = { - options.extra_ui = true; - }; - clue = {}; - cursorword = {}; - doc = {}; - extra = {}; - indentscope = {}; - trailspace = {}; - misc = {}; - surround = {}; - }; - }; -} diff --git a/nixos/modules/nixvim/plugins/neotree.nix b/nixos/modules/nixvim/plugins/neotree.nix deleted file mode 100644 index b0c19be..0000000 --- a/nixos/modules/nixvim/plugins/neotree.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ - programs.nixvim.plugins.neo-tree = { - enable = true; - filesystem.followCurrentFile.enabled = true; - closeIfLastWindow = true; - }; -} diff --git a/nixos/modules/nixvim/plugins/nix.nix b/nixos/modules/nixvim/plugins/nix.nix deleted file mode 100644 index 295695a..0000000 --- a/nixos/modules/nixvim/plugins/nix.nix +++ /dev/null @@ -1,3 +0,0 @@ -{ - programs.nixvim.plugins.nix.enable = true; -} diff --git a/nixos/modules/nixvim/plugins/plugins-bundle.nix b/nixos/modules/nixvim/plugins/plugins-bundle.nix deleted file mode 100644 index 9dd1140..0000000 --- a/nixos/modules/nixvim/plugins/plugins-bundle.nix +++ /dev/null @@ -1,15 +0,0 @@ -{ - imports = [ - ./lualine.nix - ./transparent.nix - ./neotree.nix - ./mini.nix - ./comment.nix - ./floaterm.nix - ./telescope.nix - ./barbar.nix - ./nix.nix - ./lsp.nix - ./cmp.nix - ]; -} diff --git a/nixos/modules/nixvim/plugins/telescope.nix b/nixos/modules/nixvim/plugins/telescope.nix deleted file mode 100644 index 1309eca..0000000 --- a/nixos/modules/nixvim/plugins/telescope.nix +++ /dev/null @@ -1,29 +0,0 @@ -{ - programs.nixvim.plugins.telescope = { - enable = true; - - keymaps = { - "ff" = "find_files"; - "b" = "buffers"; - "fh" = "help_tags"; - "gf" = "git_files"; - "of" = "oldfiles"; - # "fg" = "live_grep"; - # "fd" = "diagnostics"; - }; - - keymapsSilent = true; - - settings.defaults = { - file_ignore_patterns = [ - "^.git/" - "^.mypy_cache/" - "^__pycache__/" - "^output/" - "^data/" - "%.ipynb" - ]; - set_env.COLORTERM = "truecolor"; - }; - }; -} diff --git a/nixos/modules/nixvim/plugins/transparent.nix b/nixos/modules/nixvim/plugins/transparent.nix deleted file mode 100644 index d2139ee..0000000 --- a/nixos/modules/nixvim/plugins/transparent.nix +++ /dev/null @@ -1,3 +0,0 @@ -{ - programs.nixvim.plugins.transparent.enable = true; -} diff --git a/nixos/packages.nix b/nixos/packages.nix index 9bde3a8..3930626 100644 --- a/nixos/packages.nix +++ b/nixos/packages.nix @@ -65,6 +65,7 @@ tldr bat xdg-utils + neovim # GUI utils feh