diff --git a/flake.lock b/flake.lock index c8f353c..90401ad 100644 --- a/flake.lock +++ b/flake.lock @@ -21,6 +21,29 @@ "type": "github" } }, + "beautysh": { + "inputs": { + "nixpkgs": [ + "nixvim", + "nixpkgs" + ], + "poetry2nix": "poetry2nix", + "utils": "utils_3" + }, + "locked": { + "lastModified": 1680308980, + "narHash": "sha256-aUEHV0jk2qIFP3jlsWYWhBbm+w/N9gzH3e4I5DcdB5s=", + "owner": "lovesegfault", + "repo": "beautysh", + "rev": "9845efc3ea3e86cc0d41465d720a47f521b2799c", + "type": "github" + }, + "original": { + "owner": "lovesegfault", + "repo": "beautysh", + "type": "github" + } + }, "blobs": { "flake": false, "locked": { @@ -147,6 +170,80 @@ "type": "github" } }, + "flake-compat_3": { + "flake": false, + "locked": { + "lastModified": 1673956053, + "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-utils": { + "inputs": { + "systems": "systems_3" + }, + "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_4" + }, + "locked": { + "lastModified": 1685518550, + "narHash": "sha256-o2d0KcvaXzTrPRIo0kOLV0/QXHhDQ5DTi+OxcjO8xqY=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "a1720a10a6cfe8234c0e93907ffe81be440f4cef", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "gitignore": { + "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": [ @@ -276,6 +373,22 @@ "type": "indirect" } }, + "nixpkgs-stable": { + "locked": { + "lastModified": 1685801374, + "narHash": "sha256-otaSUoFEMM+LjBI1XL/xGB5ao6IwnZOXc47qhIgJe8U=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "c37ca420157f4abc31e26f436c1145f8951ff373", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-23.05", + "repo": "nixpkgs", + "type": "github" + } + }, "nixpkgs-unstable": { "locked": { "lastModified": 1712791164, @@ -322,6 +435,82 @@ "type": "indirect" } }, + "nixvim": { + "inputs": { + "beautysh": "beautysh", + "flake-utils": "flake-utils", + "nixpkgs": [ + "nixpkgs" + ], + "pre-commit-hooks": "pre-commit-hooks" + }, + "locked": { + "lastModified": 1704297403, + "narHash": "sha256-g7+4SiXDGzIlWIfANyH1J5CeEaY+Alah6KOm6IO4nIk=", + "owner": "nix-community", + "repo": "nixvim", + "rev": "b3ea5256e07ee9105060cffa075028402946bd63", + "type": "github" + }, + "original": { + "owner": "nix-community", + "ref": "nixos-23.11", + "repo": "nixvim", + "type": "github" + } + }, + "poetry2nix": { + "inputs": { + "flake-utils": [ + "nixvim", + "beautysh", + "utils" + ], + "nixpkgs": [ + "nixvim", + "beautysh", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1658665240, + "narHash": "sha256-/wkx7D7enyBPRjIkK0w7QxLQhzEkb3UxNQnjyc3FTUI=", + "owner": "nix-community", + "repo": "poetry2nix", + "rev": "8b8edc85d24661d5a6d0d71d6a7011f3e699780f", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "poetry2nix", + "type": "github" + } + }, + "pre-commit-hooks": { + "inputs": { + "flake-compat": "flake-compat_3", + "flake-utils": "flake-utils_2", + "gitignore": "gitignore", + "nixpkgs": [ + "nixvim", + "nixpkgs" + ], + "nixpkgs-stable": "nixpkgs-stable" + }, + "locked": { + "lastModified": 1703939133, + "narHash": "sha256-Gxe+mfOT6bL7wLC/tuT2F+V+Sb44jNr8YsJ3cyIl4Mo=", + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "rev": "9d3d7e18c6bc4473d7520200d4ddab12f8402d38", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "type": "github" + } + }, "root": { "inputs": { "agenix": "agenix", @@ -333,6 +522,7 @@ "nixos-mailserver": "nixos-mailserver", "nixpkgs": "nixpkgs_3", "nixpkgs-unstable": "nixpkgs-unstable", + "nixvim": "nixvim", "secrets": "secrets", "thunderbird-gnome-theme": "thunderbird-gnome-theme" } @@ -383,6 +573,36 @@ "type": "github" } }, + "systems_3": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_4": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, "thunderbird-gnome-theme": { "flake": false, "locked": { @@ -431,6 +651,21 @@ "repo": "flake-utils", "type": "github" } + }, + "utils_3": { + "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 102efeb..e9ef595 100644 --- a/flake.nix +++ b/flake.nix @@ -24,6 +24,10 @@ url = "gitlab:simple-nixos-mailserver/nixos-mailserver/nixos-23.11"; inputs.nixpkgs.follows = "nixpkgs"; }; + nixvim = { + url = "github:nix-community/nixvim/nixos-23.11"; + inputs.nixpkgs.follows = "nixpkgs"; + }; secrets = { url = "git+ssh://git@git.vimium.com/jordan/nix-secrets.git"; flake = false; diff --git a/modules/editors/neovim/default.nix b/modules/editors/neovim/default.nix index 4245894..1e1b9e2 100644 --- a/modules/editors/neovim/default.nix +++ b/modules/editors/neovim/default.nix @@ -11,15 +11,113 @@ in { }; config = lib.mkIf cfg.enable { - user.packages = with pkgs.unstable; [ - lunarvim - ]; + home.programs.nixvim = { + enable = true; + defaultEditor = true; - env.EDITOR = "lvim"; + viAlias = true; + vimAlias = true; - environment.shellAliases = { - vim = "lvim"; - v = "lvim"; + options = { + number = true; + tabstop = 2; + shiftwidth = 2; + expandtab = true; + foldlevel = 99; + splitbelow = true; + splitright = true; + undofile = true; + }; + + clipboard = { + register = "unnamedplus"; + + providers.wl-copy.enable = true; + }; + + plugins.comment-nvim.enable = true; + + plugins.hmts.enable = true; + + plugins.lightline.enable = true; + + plugins.luasnip.enable = true; + + plugins.lsp = { + enable = true; + servers = { + bashls.enable = true; + ccls.enable = true; + cssls.enable = true; + eslint.enable = true; + gopls.enable = true; + html.enable = true; + lua-ls.enable = true; + pylsp.enable = true; + nixd.enable = true; + rust-analyzer = { + enable = true; + installCargo = true; + installRustc = true; + }; + tsserver.enable = true; + }; + }; + + plugins.nvim-autopairs.enable = true; + + plugins.nvim-cmp = { + enable = true; + autoEnableSources = true; + sources = [ + { name = "nvim_lsp"; } + { name = "path"; } + { name = "buffer"; } + ]; + }; + + plugins.telescope = { + enable = true; + keymaps = { + "ff" = "find_files"; + "fg" = "live_grep"; + "b" = "buffers"; + "fh" = "help_tags"; + "" = "git_files"; + "" = "live_grep"; + }; + keymapsSilent = true; + }; + + plugins.treesitter = { + enable = true; + + nixvimInjections = true; + + folding = true; + indent = true; + }; + + plugins.treesitter-refactor = { + enable = true; + highlightDefinitions = { + enable = true; + }; + }; + + plugins.undotree.enable = true; + + # plugins.gitsigns.enable = true; + # plugins.gitgutter.enable = true; + # plugins.goyo.enable = true; + # plugins.fugitive.enable = true; + # plugins.fzf-lua.enable = true; + # plugins.neo-tree.enable = true; + # plugins.none-ls.enable = true; + # plugins.nvim-tree.enable = true; + # plugins.oil.enable = true; + # plugins.project-nvim.enable = true; + # plugins.surround.enable = true; }; }; } diff --git a/modules/options.nix b/modules/options.nix index e577683..b9972f7 100644 --- a/modules/options.nix +++ b/modules/options.nix @@ -66,6 +66,10 @@ with lib; }; dconf.settings = mkAliasDefinitions options.dconf.settings; }; + + sharedModules = [ + inputs.nixvim.homeManagerModules.nixvim + ]; }; users.users.${config.user.name} = mkAliasDefinitions options.user;