diff options
| -rw-r--r-- | flake.lock | 19 | ||||
| -rw-r--r-- | flake.nix | 84 | ||||
| -rw-r--r-- | neovim.nix | 28 |
3 files changed, 79 insertions, 52 deletions
@@ -18,7 +18,24 @@ }, "root": { "inputs": { - "nixpkgs": "nixpkgs" + "nixpkgs": "nixpkgs", + "vim-tera": "vim-tera" + } + }, + "vim-tera": { + "flake": false, + "locked": { + "lastModified": 1716960700, + "narHash": "sha256-Zs3rRAwTp9iZc5oOkiR88j7LX7YmDrEELXt29h+j55w=", + "owner": "vkhitrin", + "repo": "vim-tera", + "rev": "235fb7e7e76dfffc0596fabc1e090880bce48844", + "type": "github" + }, + "original": { + "owner": "vkhitrin", + "repo": "vim-tera", + "type": "github" } } }, @@ -3,10 +3,19 @@ inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; + + vim-tera = { + url = "github:vkhitrin/vim-tera"; + flake = false; + }; }; outputs = - { self, nixpkgs }: + { + self, + nixpkgs, + vim-tera, + }: let inherit (nixpkgs) lib; @@ -25,27 +34,6 @@ system: let pkgs = nixpkgsFor.${system}; - fs = lib.fileset; - - root = fs.toSource { - root = ./.; - fileset = fs.unions [ - # ci workflows - ./.github - - # lua configuration - ./after - ./ftdetect - ./lua - ./plugin - ./selene.toml - ./nvim.yaml - - # nix - ./flake.nix - ./neovim.nix - ]; - }; in { check-format-and-lint = @@ -59,7 +47,7 @@ ]; } '' - cd ${root} + cd ${self} echo "running actionlint..." actionlint ./.github/workflows/* @@ -106,12 +94,50 @@ formatter = forAllSystems (system: nixpkgsFor.${system}.nixfmt-rfc-style); - packages = forAllSystems (system: { - getchvim = nixpkgsFor.${system}.callPackage ./neovim.nix { - version = self.shortRev or self.dirtyShortRev or "unknown"; - }; + packages = forAllSystems ( + system: + let + pkgs = nixpkgsFor.${system}; + + dateFrom = + flake: + let + # YYYYMMDD + date = builtins.substring 0 8 flake.lastModifiedDate; + # YYYY + year = builtins.substring 0 4 date; + # MM + month = builtins.substring 4 2 date; + # DD + day = builtins.substring 6 2 date; + in + builtins.concatStringsSep "-" [ + year + month + day + ]; - default = self.packages.${system}.getchvim; - }); + in + { + getchvim = pkgs.callPackage (self + "/neovim.nix") { + inherit (self.packages.${system}) getchoo-neovim-config vim-tera; + }; + + getchoo-neovim-config = pkgs.vimUtils.buildVimPlugin { + pname = "getchoo-neovim-config"; + version = "0-unstable-" + dateFrom self; + + src = self; + }; + + vim-tera = pkgs.vimUtils.buildVimPlugin { + pname = "vim-tera"; + version = "0-unstable-" + dateFrom vim-tera; + src = vim-tera; + }; + + default = self.packages.${system}.getchvim; + } + ); }; } @@ -1,43 +1,25 @@ { lib, neovimUtils, - vimUtils, vimPlugins, wrapNeovimUnstable, neovim-unwrapped, actionlint, + getchoo-neovim-config, glow, - ripgrep, nil, nixfmt-rfc-style, nodePackages, + ripgrep, shellcheck, shfmt, statix, typos-lsp, - version, + vim-tera, }: let - fs = lib.fileset; - vimPlugins-getchoo-nvim = vimUtils.buildVimPlugin { - pname = "getchoo-neovim-config"; - inherit version; - - src = fs.toSource { - root = ./.; - fileset = fs.intersection (fs.gitTracked ./.) ( - fs.unions [ - ./after - ./ftdetect - ./lua - ./plugin - ] - ); - }; - }; - plugins = with vimPlugins; [ - vimPlugins-getchoo-nvim + getchoo-neovim-config # coding nvim-cmp @@ -62,6 +44,8 @@ let nvim-treesitter.withAllGrammars + vim-tera + # ui bufferline-nvim # dependent on > nvim-web-devicons |
