summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorseth <[email protected]>2024-08-23 17:04:15 -0400
committerseth <[email protected]>2024-08-23 17:07:01 -0400
commit779793ea450464e15cfc84dced17c905ccaca5ce (patch)
tree63eb903392096a9d31ba693e7b3af90c9977888c
parent597bdd129fd706c500bb7378ae4a48afe646c10c (diff)
start using vim-tera
-rw-r--r--flake.lock19
-rw-r--r--flake.nix84
-rw-r--r--neovim.nix28
3 files changed, 79 insertions, 52 deletions
diff --git a/flake.lock b/flake.lock
index c0c0f20..417cfe5 100644
--- a/flake.lock
+++ b/flake.lock
@@ -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"
}
}
},
diff --git a/flake.nix b/flake.nix
index dbde118..cc72977 100644
--- a/flake.nix
+++ b/flake.nix
@@ -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;
+ }
+ );
};
}
diff --git a/neovim.nix b/neovim.nix
index 41e639a..4b62e6c 100644
--- a/neovim.nix
+++ b/neovim.nix
@@ -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