diff --git a/flake.lock b/flake.lock index febfaed..8ec369a 100644 --- a/flake.lock +++ b/flake.lock @@ -513,6 +513,22 @@ "type": "github" } }, + "libgit2": { + "flake": false, + "locked": { + "lastModified": 1700492800, + "narHash": "sha256-bGNcbA6AMUWhpuagnVWR1ZBdbUcZVdZtbMaRxY5JiCU=", + "owner": "libgit2", + "repo": "libgit2", + "rev": "d9475611fec95cacec30fbd2c334b270e5265d3b", + "type": "github" + }, + "original": { + "owner": "libgit2", + "repo": "libgit2", + "type": "github" + } + }, "lowdown-src": { "flake": false, "locked": { @@ -616,17 +632,16 @@ "nixpkgs": "nixpkgs_6" }, "locked": { - "lastModified": 1698364851, - "narHash": "sha256-UQqC71YP6B5uOQ8HZRWQsbiMDKIROLhSNlnFPnDP27Y=", + "lastModified": 1701993865, + "narHash": "sha256-2BksxNhmUG+MFCejvXeIPivJ8273r6aS5sqC4W8pjw8=", "owner": "nix-community", "repo": "neovim-nightly-overlay", - "rev": "dacbb092b5d6e97127b3e57007474a5c47305164", + "rev": "3094e82f5b8b3ccf6ddd4917e881209faea35d90", "type": "github" }, "original": { "owner": "nix-community", "repo": "neovim-nightly-overlay", - "rev": "dacbb092b5d6e97127b3e57007474a5c47305164", "type": "github" } }, @@ -668,22 +683,23 @@ "nix-super": { "inputs": { "flake-compat": "flake-compat_2", + "libgit2": "libgit2", "lowdown-src": "lowdown-src", "nixpkgs": "nixpkgs_7", "nixpkgs-regression": "nixpkgs-regression" }, "locked": { - "lastModified": 1697392285, - "narHash": "sha256-1IBnF9IuStUWoAKJ74HNhV46+9Cbf/yZP6h6hJOJ1Cg=", + "lastModified": 1700941252, + "narHash": "sha256-2c8miJcsG24YEtXOSjvgW0ES1ND5DpY+ymGPq3S56YE=", "owner": "privatevoid-net", "repo": "nix-super", - "rev": "ba035e1ea339a97e6ba6a1dd79e0c0e334240234", + "rev": "c076362db8b438c921d9bbe196ede50205f788c6", "type": "github" }, "original": { "owner": "privatevoid-net", "repo": "nix-super", - "rev": "ba035e1ea339a97e6ba6a1dd79e0c0e334240234", + "rev": "c076362db8b438c921d9bbe196ede50205f788c6", "type": "github" } }, @@ -1049,6 +1065,7 @@ "rofi-wayland": "rofi-wayland", "smartcolumn-nvim": "smartcolumn-nvim", "stable": "stable", + "statuscol-nvim": "statuscol-nvim", "telekasten-nvim": "telekasten-nvim", "timers": "timers" } @@ -1085,6 +1102,23 @@ "type": "github" } }, + "statuscol-nvim": { + "flake": false, + "locked": { + "lastModified": 1700946586, + "narHash": "sha256-g36X+9hoOhHlw/DRSYdidQpHTx3ibjXNHJvONi29Yk8=", + "owner": "luukvbaal", + "repo": "statuscol.nvim", + "rev": "fb56a46dc446d3e9b61c269dd4aadbfd509223a7", + "type": "github" + }, + "original": { + "owner": "luukvbaal", + "ref": "0.10", + "repo": "statuscol.nvim", + "type": "github" + } + }, "systems": { "locked": { "lastModified": 1681028828, diff --git a/flake.nix b/flake.nix index e77e7d2..43692cf 100644 --- a/flake.nix +++ b/flake.nix @@ -21,7 +21,7 @@ nix-index-database.inputs.nixpkgs.follows = "nixpkgs"; # Programs - nix-super.url = "github:privatevoid-net/nix-super/ba035e1ea339a97e6ba6a1dd79e0c0e334240234"; + nix-super.url = "github:privatevoid-net/nix-super/c076362db8b438c921d9bbe196ede50205f788c6"; rofi-wayland.flake = false; rofi-wayland.url = "github:lbonn/rofi/wayland"; timers.url = "git+https://gitea.moritzboeh.me/moritz/timers.git"; @@ -36,7 +36,7 @@ }; hmts-nvim.flake = false; hmts-nvim.url = "github:calops/hmts.nvim"; - neovim-nightly-overlay.url = "github:nix-community/neovim-nightly-overlay/dacbb092b5d6e97127b3e57007474a5c47305164"; # HACK: because upstream is broken + neovim-nightly-overlay.url = "github:nix-community/neovim-nightly-overlay"; nix-lazy-nvim.url = "git+https://git.moritzboeh.me/moritz/NixLazy.nvim"; nvim-lspconfig.flake = false; nvim-lspconfig.url = "github:neovim/nvim-lspconfig"; @@ -52,6 +52,8 @@ none-ls-nvim.url = "github:nvimtools/none-ls.nvim"; neotest-python.flake = false; neotest-python.url = "github:MoritzBoehme/neotest-python/fix-runtimepath-search"; + statuscol-nvim.flake = false; + statuscol-nvim.url = "github:luukvbaal/statuscol.nvim/0.10"; # HACK: fix for neovim-nightly # Hyprland hypr-contrib.url = "github:hyprwm/contrib"; diff --git a/modules/programs/nvim/plugins/coding.nix b/modules/programs/nvim/plugins/coding.nix index a4ace75..12621d9 100644 --- a/modules/programs/nvim/plugins/coding.nix +++ b/modules/programs/nvim/plugins/coding.nix @@ -316,5 +316,21 @@ with builtins; cmd = [ "ConformInfo" "Format" ]; conf = readFile ./lua/conform.lua; } + { + plugin = neogen; + keys = [ + { key = "cg"; cmd = "Neogen"; desc = "Test"; } + ]; + opts = { + languages = { + python = { + template = { + annotation_convention = "reST"; + }; + }; + }; + }; + cmd = [ "Neogen" ]; + } ]; } diff --git a/modules/programs/nvim/plugins/lua/nvim-lspconfig.lua b/modules/programs/nvim/plugins/lua/nvim-lspconfig.lua index 99decf0..d34588f 100644 --- a/modules/programs/nvim/plugins/lua/nvim-lspconfig.lua +++ b/modules/programs/nvim/plugins/lua/nvim-lspconfig.lua @@ -81,7 +81,7 @@ local on_attach_def = function(client, bufnr) function() require("telescope.builtin").lsp_type_definitions({ reuse_win = true }) end, - "Goto type defininition", + "Goto type definition", }, r = { "Telescope lsp_references", "Goto references" }, D = { vim.lsp.buf.declaration, "Goto declaration" }, @@ -129,7 +129,6 @@ local servers = { "gopls", "nil_ls", "nixd", - "pylsp", "ruff_lsp", "typst_lsp", } @@ -137,6 +136,18 @@ for _, lsp in ipairs(servers) do lspconfig_setup(lsp, {}) end +lspconfig_setup("pylsp", { + settings = { + pylsp = { + plugins = { + rope_autoimport = { + enabled = true, + }, + }, + }, + }, +}) + lspconfig_setup("rust_analyzer", { settings = { ["rust-analyzer"] = { diff --git a/modules/programs/nvim/plugins/treesitter.nix b/modules/programs/nvim/plugins/treesitter.nix index 29fd25d..93d89d6 100644 --- a/modules/programs/nvim/plugins/treesitter.nix +++ b/modules/programs/nvim/plugins/treesitter.nix @@ -60,8 +60,8 @@ with builtins; require('nvim-treesitter.configs').setup(final_opts) ''; dependencies = [ - { plugin = nvim-ts-context-commentstring; } { plugin = nvim-treesitter-textobjects; } + { plugin = nvim-ts-context-commentstring; opts = { }; } ]; } { diff --git a/overlays/vimPlugins.nix b/overlays/vimPlugins.nix index f76f56c..fc07f32 100644 --- a/overlays/vimPlugins.nix +++ b/overlays/vimPlugins.nix @@ -35,6 +35,11 @@ with lib.my; src = inputs.nvim-treesitter; }); + statuscol-nvim = prev.vimPlugins.statuscol-nvim.overrideAttrs (_: { + version = mkVersionInput inputs.statuscol-nvim; + src = inputs.statuscol-nvim; + }); + # HACK: to fix error in nixpkgs version of nvim-lspconfig nvim-lspconfig = prev.vimPlugins.nvim-lspconfig.overrideAttrs (_: { version = mkVersionInput inputs.nvim-lspconfig; diff --git a/templates/python/.envrc b/templates/python/.envrc index 8c7c1c9..1d953f4 100644 --- a/templates/python/.envrc +++ b/templates/python/.envrc @@ -1,6 +1 @@ -use flake -export PYTHONPATH="$(pwd)/src:$PYTHONPATH" -if [ ! -z $NIX_LD ]; then - export LD_LIBRARY_PATH=$NIX_LD_LIBRARY_PATH -fi -layout poetry +use nix diff --git a/templates/python/flake.nix b/templates/python/flake.nix deleted file mode 100644 index 8a0943a..0000000 --- a/templates/python/flake.nix +++ /dev/null @@ -1,15 +0,0 @@ -{ - description = "Simple python flake"; - - inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; - - outputs = inputs@{ flake-parts, ... }: - flake-parts.lib.mkFlake { inherit inputs; } { - systems = [ "x86_64-linux" "aarch64-linux" "aarch64-darwin" "x86_64-darwin" ]; - perSystem = { config, self', inputs', pkgs, system, ... }: { - devShells.default = pkgs.mkShell { - buildInputs = with pkgs; [ python3 poetry ]; - }; - }; - }; -} diff --git a/templates/python/shell.nix b/templates/python/shell.nix new file mode 100644 index 0000000..65e0220 --- /dev/null +++ b/templates/python/shell.nix @@ -0,0 +1,14 @@ +{ pkgs ? import { } }: + +let + poetry2nix = import (fetchTarball "https://github.com/nix-community/poetry2nix/archive/master.tar.gz") { }; + project = + poetry2nix.mkPoetryApplication { + projectDir = ./.; + preferWheels = true; + }; +in +pkgs.mkShell { + inputsFrom = [ project ]; + packages = [ pkgs.poetry ]; +}