~toastal/nvim-tree-sitter-unicode-conceal
Showing details for patch fbd9ab827892447c5ab9540141b258f0beaf5b78.
diff -rN -u old-nvim-tree-sitter-unicode-conceal/flake.nix new-nvim-tree-sitter-unicode-conceal/flake.nix --- old-nvim-tree-sitter-unicode-conceal/flake.nix 2024-11-24 23:05:35.468001918 +0000 +++ new-nvim-tree-sitter-unicode-conceal/flake.nix 2024-11-24 23:05:35.468001918 +0000 @@ -1,163 +1,209 @@ { - description = "Neovim plugin for Unicode character conceal via tree-sitter"; + description = "Neovim plugin for Unicode character conceal via tree-sitter"; - inputs = { - nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; - }; - - outputs = { self, nixpkgs, ... }@inputs: - let - name = "nvim-tree-sitter-unicode-conceal"; - - # neovim ∪ tree-sitter - supportedSystems = [ - "aarch64-linux" - "i686-linux" - "x86_64-linux" - "aarch64-darwin" - "x86_64-darwin" - ]; - - forAllSystems = nixpkgs.lib.genAttrs supportedSystems; - - nixpkgsFor = forAllSystems (system: import nixpkgs { - inherit system; - config = { - allowlistedLicenses = with nixpkgs.lib.licenses; [ - ]; - }; - overlays = [ self.overlays.vimPlugins ]; - }); - in - { - overlays = { - vimPlugins = final: prev: { - vimPlugins = prev.vimPlugins // { ${name} = self.packages.${prev.system}.${name}; }; - }; - }; - - packages = forAllSystems (system: - let pkgs = nixpkgsFor.${system}; inherit (pkgs) lib; in { - default = self.packages.${system}.${name}; - - ${name} = pkgs.vimUtils.buildVimPlugin { - inherit name; - namePrefix = ""; - src = lib.fileset.toSource { - root = ./.; - fileset = lib.fileset.unions [ - ./after - ./COPYING.txt - ./COPYING.LESSER.txt - ]; - }; - meta = { - license = lib.licenses.lgpl21; + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; + }; + + outputs = + { self, nixpkgs, ... }@inputs: + let + name = "nvim-tree-sitter-unicode-conceal"; + + # neovim ∪ tree-sitter + supportedSystems = [ + "aarch64-linux" + "i686-linux" + "x86_64-linux" + "aarch64-darwin" + "x86_64-darwin" + ]; + + forAllSystems = nixpkgs.lib.genAttrs supportedSystems; + + nixpkgsFor = forAllSystems ( + system: + import nixpkgs { + inherit system; + config = { + allowlistedLicenses = with nixpkgs.lib.licenses; [ ]; + }; + overlays = with self.overlays; [ + default + vimPlugins + ]; + } + ); + in + { + overlays = { + default = final: prev: { + nixfmt-3-space = prev.nixfmt-rfc-style.overrideAttrs ( + finalAttrs: prevAttrs: { + name = "nixfmt-3-space"; + src = + # needs an unstable patch post 2024-05-17 + final.fetchzip { + url = "https://github.com/NixOS/nixfmt/archive/3bcb63c13e7aaf0b8e14081cf0c14c44f62e840a.tar.gz"; + hash = "sha256-8QWhKKqpHSlHuvFW8wdWTbG0pJ6XtuxZQ3HhR4uPbRA="; + }; + version = "unstable-2024-05-17"; + patches = (prev.patches or [ ]) ++ [ + (final.fetchpatch { + url = "https://codeberg.org/toastal/nixfmt/commit/caec3cf06cead7d4e811fde59d0520c335b32927.patch"; + hash = "sha256-/i5RoxD644uXjQ/HYM8mbR66Mgmd9C2g/mgqeUSq5tU="; + }) + ]; + } + ); }; - }; - nvim-mod = pkgs.neovim.override { - configure = { - packages.myPlugins = with pkgs.vimPlugins; { - start = [ - lsp_lines-nvim - trouble-nvim - (nvim-treesitter.withPlugins ( - plugins: with plugins; [ - erlang - fish - lua - nickel - nix - ocaml - ocaml-interface - php - ] - )) - playground - self.packages."${system}"."${name}" - ]; - }; - customRC = '' - syntax off - set tabstop=4 - set shiftwidth=4 - set conceallevel=2 - let mapleader=' ' - let maplocalleader='-' - - autocmd BufNewFile,BufRead *.ncl setfiletype nickel - autocmd BufNewFile,BufRead *.nix setfiletype nix - - lua <<EOF - require('nvim-treesitter.configs').setup({ - highlight = { - enable = true, - }, - }) - require("lsp_lines").setup() - require("trouble").setup({ - height = 9, - fold_open = "▶", - fold_close = "▼", - padding = false, - auto_close = true, - signs = { - error = "☠", - warning = "‼", - hint = "✽", - information = "ℹ", - other = "⁇", - }, - use_diagnostic_signs = true, - }) - - vim.keymap.set("n", "<leader>xx", "<cmd>TroubleToggle<cr>", - {silent = true, noremap = true} - ) - vim.keymap.set("n", "<leader>xw", "<cmd>TroubleToggle workspace_diagnostics<cr>", - {silent = true, noremap = true} - ) - vim.keymap.set("n", "<leader>xd", "<cmd>TroubleToggle document_diagnostics<cr>", - {silent = true, noremap = true} - ) - vim.keymap.set("n", "<leader>xl", "<cmd>TroubleToggle loclist<cr>", - {silent = true, noremap = true} - ) - vim.keymap.set("n", "<leader>xq", "<cmd>TroubleToggle quickfix<cr>", - {silent = true, noremap = true} - ) - vim.keymap.set("n", "gR", "<cmd>TroubleToggle lsp_references<cr>", - {silent = true, noremap = true} - ) - EOF - ''; + vimPlugins = final: prev: { + vimPlugins = prev.vimPlugins // { + ${name} = self.packages.${prev.system}.${name}; + }; }; - }; - }); + }; - apps = forAllSystems (system: - let pkgs = nixpkgsFor.${system}; in { - default = self.apps.${system}.nvim-mod; - - nvim-mod = { - type = "app"; - program = "${self.packages.${system}.nvim-mod}/bin/nvim"; - }; - }); - - devShells = forAllSystems (system: - let pkgs = nixpkgsFor.${system}; in - { - ${name} = pkgs.mkShell { - inherit name; - buildInputs = with pkgs; [ - nixpkgs-fmt - topiary - ]; - }; - - default = self.devShells.${system}.${name}; - }); - }; + packages = forAllSystems ( + system: + let + pkgs = nixpkgsFor.${system}; + inherit (pkgs) lib; + in + { + default = self.packages.${system}.${name}; + + ${name} = pkgs.vimUtils.buildVimPlugin { + inherit name; + namePrefix = ""; + src = lib.fileset.toSource { + root = ./.; + fileset = lib.fileset.unions [ + ./after + ./COPYING.txt + ./COPYING.LESSER.txt + ]; + }; + meta = { + license = lib.licenses.lgpl21; + }; + }; + + nvim-mod = pkgs.neovim.override { + configure = { + packages.myPlugins = with pkgs.vimPlugins; { + start = [ + lsp_lines-nvim + trouble-nvim + (nvim-treesitter.withPlugins ( + plugins: with plugins; [ + erlang + fish + lua + nickel + nix + ocaml + ocaml-interface + php + ] + )) + playground + self.packages."${system}"."${name}" + ]; + }; + customRC = '' + syntax off + set tabstop=4 + set shiftwidth=4 + set conceallevel=2 + let mapleader=' ' + let maplocalleader='-' + + autocmd BufNewFile,BufRead *.ncl setfiletype nickel + autocmd BufNewFile,BufRead *.nix setfiletype nix + + lua <<EOF + require('nvim-treesitter.configs').setup({ + highlight = { + enable = true, + }, + }) + require("lsp_lines").setup() + require("trouble").setup({ + height = 9, + fold_open = "▶", + fold_close = "▼", + padding = false, + auto_close = true, + signs = { + error = "☠", + warning = "‼", + hint = "✽", + information = "ℹ", + other = "⁇", + }, + use_diagnostic_signs = true, + }) + + vim.keymap.set("n", "<leader>xx", "<cmd>TroubleToggle<cr>", + {silent = true, noremap = true} + ) + vim.keymap.set("n", "<leader>xw", "<cmd>TroubleToggle workspace_diagnostics<cr>", + {silent = true, noremap = true} + ) + vim.keymap.set("n", "<leader>xd", "<cmd>TroubleToggle document_diagnostics<cr>", + {silent = true, noremap = true} + ) + vim.keymap.set("n", "<leader>xl", "<cmd>TroubleToggle loclist<cr>", + {silent = true, noremap = true} + ) + vim.keymap.set("n", "<leader>xq", "<cmd>TroubleToggle quickfix<cr>", + {silent = true, noremap = true} + ) + vim.keymap.set("n", "gR", "<cmd>TroubleToggle lsp_references<cr>", + {silent = true, noremap = true} + ) + EOF + ''; + }; + }; + } + ); + + apps = forAllSystems ( + system: + let + pkgs = nixpkgsFor.${system}; + in + { + default = self.apps.${system}.nvim-mod; + + nvim-mod = { + type = "app"; + program = "${self.packages.${system}.nvim-mod}/bin/nvim"; + }; + } + ); + + devShells = forAllSystems ( + system: + let + pkgs = nixpkgsFor.${system}; + in + { + ${name} = pkgs.mkShell { + inherit name; + buildInputs = with pkgs; [ + nixfmt-3-space + topiary + ]; + }; + + default = self.devShells.${system}.${name}; + } + ); + + formatter = forAllSystems (system: nixpkgsFor.${system}.nixfmt-3-space); + }; }