diff --git a/flake.lock b/flake.lock index 623cc10..dc75bd3 100644 --- a/flake.lock +++ b/flake.lock @@ -1,28 +1,5 @@ { "nodes": { - "beautysh": { - "inputs": { - "nixpkgs": [ - "nixvim", - "nixpkgs" - ], - "poetry2nix": "poetry2nix", - "utils": "utils" - }, - "locked": { - "lastModified": 1680308980, - "narHash": "sha256-aUEHV0jk2qIFP3jlsWYWhBbm+w/N9gzH3e4I5DcdB5s=", - "owner": "lovesegfault", - "repo": "beautysh", - "rev": "9845efc3ea3e86cc0d41465d720a47f521b2799c", - "type": "github" - }, - "original": { - "owner": "lovesegfault", - "repo": "beautysh", - "type": "github" - } - }, "crane": { "inputs": { "flake-compat": [ @@ -75,11 +52,11 @@ "flake-compat_2": { "flake": false, "locked": { - "lastModified": 1673956053, - "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", + "lastModified": 1650374568, + "narHash": "sha256-Z+s0J8/r907g149rllvwhb4pKi8Wam5ij0st8PwAh+E=", "owner": "edolstra", "repo": "flake-compat", - "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", + "rev": "b4a34015c698c7793d592d66adbab377907a2be8", "type": "github" }, "original": { @@ -128,30 +105,12 @@ } }, "flake-utils_2": { - "inputs": { - "systems": "systems_2" - }, "locked": { - "lastModified": 1681202837, - "narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=", + "lastModified": 1656928814, + "narHash": "sha256-RIFfgBuKz6Hp89yRr7+NR5tzIAbn52h8vT6vXkYjZoM=", "owner": "numtide", "repo": "flake-utils", - "rev": "cfacdce06f30d2b68473a46042957675eebb3401", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "flake-utils_3": { - "locked": { - "lastModified": 1667395993, - "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f", + "rev": "7e2a3b3dfd9af950a856d66b0a7d01e3c18aa249", "type": "github" }, "original": { @@ -182,28 +141,6 @@ "type": "github" } }, - "gitignore_2": { - "inputs": { - "nixpkgs": [ - "nixvim", - "pre-commit-hooks", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1660459072, - "narHash": "sha256-8DFJjXG8zqoONA1vXtgeKXy68KdJL5UaXR8NtVMUbx8=", - "owner": "hercules-ci", - "repo": "gitignore.nix", - "rev": "a20de23b925fd8264fd7fad6454652e142fd7f73", - "type": "github" - }, - "original": { - "owner": "hercules-ci", - "repo": "gitignore.nix", - "type": "github" - } - }, "home-manager": { "inputs": { "nixpkgs": [ @@ -211,11 +148,11 @@ ] }, "locked": { - "lastModified": 1684321175, - "narHash": "sha256-V4EbM+jK7pvjKBaj0dgAiW9ultzDE27Nz5fRyu/ceMk=", + "lastModified": 1685171645, + "narHash": "sha256-CpJfOjvsbxQzevKiV8jWK/c+j/eW61HgvCrImeFeCpY=", "owner": "nix-community", "repo": "home-manager", - "rev": "59659243cd4ababda605e79b4a9c2e6d83e24c86", + "rev": "6a1922568337e7cf21175213d3aafd1ac79c9a2e", "type": "github" }, "original": { @@ -252,11 +189,11 @@ "rust-overlay": "rust-overlay" }, "locked": { - "lastModified": 1684327479, - "narHash": "sha256-MqFzPr5DwHlK4lcobLfniRtwMdEatPclNtjGOhuVnzE=", + "lastModified": 1685182442, + "narHash": "sha256-gPcAwOAoxYpP5An0V3HTI2JnAb2wb1u90IT2FbAG6SQ=", "owner": "nix-community", "repo": "lanzaboote", - "rev": "d93eebb9c6b377870684c00e012373e84a100d77", + "rev": "f641dcfc8b34729d241c95cc7e1c03b21b5b241b", "type": "github" }, "original": { @@ -265,18 +202,80 @@ "type": "github" } }, + "nix-flake-tests": { + "locked": { + "lastModified": 1677844186, + "narHash": "sha256-ErJZ/Gs1rxh561CJeWP5bohA2IcTq1rDneu1WT6CVII=", + "owner": "antifuchs", + "repo": "nix-flake-tests", + "rev": "bbd9216bd0f6495bb961a8eb8392b7ef55c67afb", + "type": "github" + }, + "original": { + "owner": "antifuchs", + "repo": "nix-flake-tests", + "type": "github" + } + }, + "nixneovim": { + "inputs": { + "home-manager": [ + "home-manager" + ], + "nix-flake-tests": "nix-flake-tests", + "nixneovimplugins": "nixneovimplugins", + "nixpkgs": [ + "nixpkgs" + ], + "nmd": "nmd", + "nmt": "nmt" + }, + "locked": { + "lastModified": 1685182616, + "narHash": "sha256-hhVjoqP6dpE4pb6SakYpV1zSlqs+6YILWFqsTdn4jdk=", + "owner": "adtya", + "repo": "nixneovim", + "rev": "194430f95b20ef03a8a23e74b48941427da93052", + "type": "github" + }, + "original": { + "owner": "adtya", + "repo": "nixneovim", + "type": "github" + } + }, + "nixneovimplugins": { + "inputs": { + "flake-compat": "flake-compat_2", + "flake-utils": "flake-utils_2", + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1685024299, + "narHash": "sha256-wxxxz9KarfaCwtz7emLPofIAIyH6ztv1+0P+UiLBKhE=", + "owner": "nixneovim", + "repo": "nixneovimplugins", + "rev": "d2583dd5bf808b11c7593908f5b4ca90fad20bf7", + "type": "github" + }, + "original": { + "owner": "nixneovim", + "repo": "nixneovimplugins", + "type": "github" + } + }, "nixpkgs": { "locked": { - "lastModified": 1684305980, - "narHash": "sha256-vd4SKXX1KZfSX6n3eoguJw/vQ+sBL8XGdgfxjEgLpKc=", + "lastModified": 1659190188, + "narHash": "sha256-LudYrDFPFaQMW0l68TYkPWRPKmqpxIFU1nWfylIp9AQ=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "e6e389917a8c778be636e67a67ec958f511cc55d", + "rev": "a3fddd46a7f3418d7e3940ded94701aba569161d", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixos-unstable", + "ref": "nixpkgs-unstable", "repo": "nixpkgs", "type": "github" } @@ -297,94 +296,51 @@ "type": "github" } }, - "nixpkgs-stable_2": { + "nixpkgs_2": { "locked": { - "lastModified": 1678872516, - "narHash": "sha256-/E1YwtMtFAu2KUQKV/1+KFuReYPANM2Rzehk84VxVoc=", + "lastModified": 1684935479, + "narHash": "sha256-6QMMsXMr2nhmOPHdti2j3KRHt+bai2zw+LJfdCl97Mk=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "9b8e5abb18324c7fe9f07cb100c3cd4a29cda8b8", + "rev": "f91ee3065de91a3531329a674a45ddcb3467a650", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixos-22.11", + "ref": "nixos-unstable", "repo": "nixpkgs", "type": "github" } }, - "nixvim": { - "inputs": { - "beautysh": "beautysh", - "flake-utils": "flake-utils_2", - "nixpkgs": [ - "nixpkgs" - ], - "pre-commit-hooks": "pre-commit-hooks" - }, + "nmd": { + "flake": false, "locked": { - "lastModified": 1684141492, - "narHash": "sha256-j2fWY7kbOETSNDtlX7whkq2APe44PijzgaCTWV8oE/I=", - "owner": "pta2002", - "repo": "nixvim", - "rev": "3600698abad00756947eb3a3d837beedf1c2f551", - "type": "github" + "lastModified": 1680213367, + "narHash": "sha256-NbSXxpFAK5IMcsQTK0vSGy099HExx3SEagqW4Lpc+X8=", + "owner": "rycee", + "repo": "nmd", + "rev": "abb15317ebd17e5a0a7dd105e2ce52f2700185a8", + "type": "gitlab" }, "original": { - "owner": "pta2002", - "repo": "nixvim", - "type": "github" + "owner": "rycee", + "repo": "nmd", + "type": "gitlab" } }, - "poetry2nix": { - "inputs": { - "flake-utils": [ - "nixvim", - "beautysh", - "utils" - ], - "nixpkgs": [ - "nixvim", - "beautysh", - "nixpkgs" - ] - }, + "nmt": { + "flake": false, "locked": { - "lastModified": 1658665240, - "narHash": "sha256-/wkx7D7enyBPRjIkK0w7QxLQhzEkb3UxNQnjyc3FTUI=", - "owner": "nix-community", - "repo": "poetry2nix", - "rev": "8b8edc85d24661d5a6d0d71d6a7011f3e699780f", + "lastModified": 1683843030, + "narHash": "sha256-2K9tFpypgSORyUTRAL7MFRKCXU4GykmhIDrrIydtPdI=", + "owner": "jooooscha", + "repo": "nmt", + "rev": "f30b96093eb056f1bcc60199545344b4e4a72c5a", "type": "github" }, "original": { - "owner": "nix-community", - "repo": "poetry2nix", - "type": "github" - } - }, - "pre-commit-hooks": { - "inputs": { - "flake-compat": "flake-compat_2", - "flake-utils": "flake-utils_3", - "gitignore": "gitignore_2", - "nixpkgs": [ - "nixvim", - "nixpkgs" - ], - "nixpkgs-stable": "nixpkgs-stable_2" - }, - "locked": { - "lastModified": 1682596858, - "narHash": "sha256-Hf9XVpqaGqe/4oDGr30W8HlsWvJXtMsEPHDqHZA6dDg=", - "owner": "cachix", - "repo": "pre-commit-hooks.nix", - "rev": "fb58866e20af98779017134319b5663b8215d912", - "type": "github" - }, - "original": { - "owner": "cachix", - "repo": "pre-commit-hooks.nix", + "owner": "jooooscha", + "repo": "nmt", "type": "github" } }, @@ -424,8 +380,8 @@ "home-manager": "home-manager", "impermanence": "impermanence", "lanzaboote": "lanzaboote", - "nixpkgs": "nixpkgs", - "nixvim": "nixvim" + "nixneovim": "nixneovim", + "nixpkgs": "nixpkgs_2" } }, "rust-overlay": { @@ -467,36 +423,6 @@ "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" - } - }, - "utils": { - "locked": { - "lastModified": 1678901627, - "narHash": "sha256-U02riOqrKKzwjsxc/400XnElV+UtPUQWpANPlyazjH0=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "93a2b84fc4b70d9e089d029deacc3583435c2ed6", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } } }, "root": "root", diff --git a/flake.nix b/flake.nix index f71b925..a0db5a6 100644 --- a/flake.nix +++ b/flake.nix @@ -20,9 +20,10 @@ inputs.nixpkgs.follows = "nixpkgs"; }; - nixvim = { - url = "github:pta2002/nixvim"; + nixneovim = { + url = "github:adtya/nixneovim"; inputs.nixpkgs.follows = "nixpkgs"; + inputs.home-manager.follows = "home-manager"; }; }; @@ -32,7 +33,7 @@ home-manager, impermanence, lanzaboote, - nixvim, + nixneovim, } @ inputs: { formatter."x86_64-linux" = nixpkgs.legacyPackages."x86_64-linux".alejandra; nixosConfigurations = let @@ -43,7 +44,7 @@ specialArgs = inputs; modules = [ { - nixpkgs.overlays = [(import ./packages)]; + nixpkgs.overlays = [(import ./packages) nixneovim.overlays.default]; nixpkgs.hostPlatform = nixpkgs.lib.mkDefault "x86_64-linux"; system.configurationRevision = nixpkgs.lib.mkIf (self ? rev) self.rev; } @@ -62,7 +63,7 @@ users.${user.primary.userName} = {pkgs, ...}: { imports = [ impermanence.nixosModules.home-manager.impermanence - nixvim.homeManagerModules.nixvim + nixneovim.nixosModules.default ./home/common ./home/desktop ]; diff --git a/home/desktop/programs/default.nix b/home/desktop/programs/default.nix index 4d22db9..192a7e4 100644 --- a/home/desktop/programs/default.nix +++ b/home/desktop/programs/default.nix @@ -7,7 +7,7 @@ ./gnupg.nix ./kitty.nix ./mpv.nix - ./nixvim.nix + ./neovim.nix ./tmux.nix ./virt-manager.nix ./yt-dlp.nix diff --git a/home/desktop/programs/neovim.nix b/home/desktop/programs/neovim.nix new file mode 100644 index 0000000..70ca9aa --- /dev/null +++ b/home/desktop/programs/neovim.nix @@ -0,0 +1,134 @@ +{ + pkgs, + ... +}: { + programs.nixneovim = { + enable = true; + extraLuaPreConfig = '' + vim.g.gitblame_date_format = '%r' + vim.g.gitblame_message_when_not_committed = ''' + + vim.opt.list = true + vim.opt.listchars:append "space:⋅" + vim.opt.listchars:append "eol:↴" + ''; + extraPlugins = with pkgs.vimExtraPlugins; [dracula-vim git-blame-nvim]; + colorscheme = "dracula"; + options = { + autowrite = true; + background = "dark"; + clipboard = "unnamedplus"; + expandtab = true; + laststatus = 2; + list = true; + showmode = false; + swapfile = false; + number = true; + relativenumber = true; + shiftwidth = 2; + signcolumn = "yes"; + smartindent = true; + tabstop = 2; + termguicolors = true; + updatetime = 100; + wrap = true; + splitright = true; + splitbelow = true; + }; + mappings = { + normal = { + "" = "'bp'"; + "" = "'bn'"; + "" = { + silent = true; + action = "'noh'"; + }; + "w" = { + silent = true; + action = "'bdeletebnext'"; + }; + "1" = { + silent = true; + action = "'NvimTreeToggle'"; + }; + "`" = { + silent = true; + action = "'split term://zsh'"; + }; + "ff" = { + silent = true; + action = "'Telescope find_files'"; + }; + "fg" = { + silent = true; + action = "'Telescope live_grep'"; + }; + "fb" = { + silent = true; + action = "'Telescope buffers'"; + }; + }; + }; + plugins = { + comment.enable = true; + fugitive.enable = true; + gitsigns.enable = true; + indent-blankline = { + enable = true; + showEndOfLine = true; + }; + telescope.enable = true; + nvim-tree = { + enable = true; + diagnostics.enable = true; + disableNetrw = true; + git.enable = true; + }; + bufferline = { + enable = true; + alwaysShowBufferline = true; + diagnostics = "nvim_lsp"; + separatorStyle = "slant"; + offsets = [ + { + filetype = "NvimTree"; + text = "File Explorer"; + separator = true; + } + ]; + }; + lualine = { + enable = true; + globalstatus = true; + }; + nvim-cmp = { + enable = true; + snippet.luasnip.enable = true; + sources = { + buffer.enable = true; + nvim_lsp.enable = true; + nvim_lsp_document_symbol.enable = true; + nvim_lsp_signature_help.enable = true; + treesitter.enable = true; + luasnip.enable = true; + }; + }; + luasnip.enable = true; + treesitter = { + enable = true; + installAllGrammars = true; + indent = true; + incrementalSelection.enable = true; + }; + treesitter-context.enable = true; + lsp = { + enable = true; + servers = { + gopls.enable = true; + nil.enable = true; + rust-analyzer.enable = true; + }; + }; + }; + }; +} diff --git a/home/desktop/programs/nixvim.nix b/home/desktop/programs/nixvim.nix deleted file mode 100644 index 6af976c..0000000 --- a/home/desktop/programs/nixvim.nix +++ /dev/null @@ -1,190 +0,0 @@ -{ - config, - pkgs, - ... -}: { - programs.nixvim = { - enable = true; - vimAlias = true; - viAlias = true; - extraConfigLuaPre = '' - vim.g.gitblame_date_format = '%r' - vim.g.gitblame_message_when_not_committed = ''' - - vim.opt.list = true - vim.opt.listchars:append "space:⋅" - vim.opt.listchars:append "eol:↴" - ''; - options = { - autowrite = true; - background = "dark"; - clipboard = "unnamedplus"; - expandtab = true; - laststatus = 2; - list = true; - showmode = false; - swapfile = false; - number = true; - relativenumber = true; - shiftwidth = 2; - signcolumn = "yes"; - smartindent = true; - tabstop = 2; - termguicolors = true; - updatetime = 100; - wrap = true; - splitright = true; - splitbelow = true; - }; - maps = { - normal = { - "" = ":bp"; - "" = ":bn"; - "" = { - silent = true; - action = ":noh"; - }; - "w" = { - silent = true; - action = ":bdelete:bnext"; - }; - "1" = { - silent = true; - action = ":NvimTreeToggle"; - }; - "`" = { - silent = true; - action = ":split term://zsh"; - }; - "ff" = { - silent = true; - action = "Telescope find_files"; - }; - "fg" = { - silent = true; - action = "Telescope live_grep"; - }; - "fb" = { - silent = true; - action = "Telescope buffers"; - }; - }; - }; - extraPlugins = with pkgs.vimPlugins; [dracula-nvim git-blame-nvim]; - colorscheme = "dracula"; - plugins = { - comment-nvim.enable = true; - fugitive.enable = true; - gitsigns.enable = true; - trouble.enable = true; - nvim-cmp = { - enable = true; - snippet.expand = "luasnip"; - sources = [ - {name = "buffer";} - {name = "nvim_lsp";} - {name = "nvim_lsp_document_symbol";} - {name = "nvim_lsp_signature_help";} - {name = "treesitter";} - {name = "luasnip";} - ]; - }; - cmp-buffer.enable = true; - cmp-nvim-lsp.enable = true; - cmp-nvim-lsp-document-symbol.enable = true; - cmp-nvim-lsp-signature-help.enable = true; - cmp-treesitter.enable = true; - cmp_luasnip.enable = true; - luasnip.enable = true; - bufferline = { - enable = true; - diagnostics = "nvim_lsp"; - offsets = [ - { - filetype = "NvimTree"; - separator = true; - } - ]; - separatorStyle = "slant"; - truncateNames = true; - }; - treesitter = { - enable = true; - grammarPackages = with config.programs.nixvim.plugins.treesitter.package.builtGrammars; [ - bash - dockerfile - gitcommit - gitignore - git_rebase - go - markdown - markdown_inline - nix - rust - toml - yaml - ]; - indent = true; - incrementalSelection.enable = true; - }; - treesitter-context = { - enable = true; - }; - treesitter-refactor = { - enable = true; - }; - telescope = { - enable = true; - extensions = { - fzy-native = { - enable = true; - }; - }; - }; - lualine = { - enable = true; - globalstatus = true; - }; - indent-blankline = { - enable = true; - showEndOfLine = true; - }; - nvim-tree = { - enable = true; - disableNetrw = true; - filesystemWatchers.enable = true; - }; - null-ls = { - enable = true; - sources = { - code_actions = { - shellcheck.enable = true; - }; - diagnostics = { - shellcheck.enable = true; - }; - formatting = { - alejandra.enable = true; - }; - }; - }; - lsp = { - enable = true; - servers = { - gopls = { - enable = true; - filetypes = ["go"]; - }; - nil_ls = { - enable = true; - filetypes = ["nix"]; - }; - rust-analyzer = { - enable = true; - filetypes = ["rs"]; - }; - }; - }; - }; - }; -}