summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorseth <[email protected]>2024-07-13 20:12:35 -0400
committerseth <[email protected]>2024-07-14 13:47:39 -0400
commit5ec30e9a2b9047713c060c90a5e7930fafc2a3d6 (patch)
tree4c10736c3f5a69d2e214575f0ed1fc0e6d3f2f90
parentc9fb0eded5c69af78a1af12e5fdce7b347c40da3 (diff)
flatten plugin structure
-rw-r--r--.editorconfig12
-rw-r--r--.gitignore10
-rw-r--r--after/plugin/globals.lua (renamed from config/after/plugin/globals.lua)0
-rw-r--r--after/plugin/keymaps.lua (renamed from config/after/plugin/keymaps.lua)0
-rw-r--r--config/default.nix19
-rw-r--r--flake.nix82
-rw-r--r--ftdetect/just.lua (renamed from config/ftdetect/just.lua)0
-rw-r--r--lua/getchoo/efmls.lua (renamed from config/lua/getchoo/efmls.lua)0
-rw-r--r--lua/getchoo/init.lua (renamed from config/lua/getchoo/init.lua)0
-rw-r--r--neovim.nix43
-rw-r--r--plugin/bufferline.lua (renamed from config/plugin/bufferline.lua)0
-rw-r--r--plugin/catppuccin.lua (renamed from config/plugin/catppuccin.lua)0
-rw-r--r--plugin/cmp.lua (renamed from config/plugin/cmp.lua)0
-rw-r--r--plugin/dressing.lua (renamed from config/plugin/dressing.lua)0
-rw-r--r--plugin/fidget.lua (renamed from config/plugin/fidget.lua)0
-rw-r--r--plugin/flash.lua (renamed from config/plugin/flash.lua)0
-rw-r--r--plugin/gitsigns.lua (renamed from config/plugin/gitsigns.lua)0
-rw-r--r--plugin/ibl.lua (renamed from config/plugin/ibl.lua)0
-rw-r--r--plugin/lsp-format.lua (renamed from config/plugin/lsp-format.lua)0
-rw-r--r--plugin/lsp.lua (renamed from config/plugin/lsp.lua)0
-rw-r--r--plugin/lualine.lua (renamed from config/plugin/lualine.lua)0
-rw-r--r--plugin/mini.lua (renamed from config/plugin/mini.lua)0
-rw-r--r--plugin/telescope.lua (renamed from config/plugin/telescope.lua)0
-rw-r--r--plugin/treesitter.lua (renamed from config/plugin/treesitter.lua)0
-rw-r--r--plugin/trouble.lua (renamed from config/plugin/trouble.lua)0
-rw-r--r--plugin/which-key.lua (renamed from config/plugin/which-key.lua)0
26 files changed, 75 insertions, 91 deletions
diff --git a/.editorconfig b/.editorconfig
deleted file mode 100644
index 54ba4d1..0000000
--- a/.editorconfig
+++ /dev/null
@@ -1,12 +0,0 @@
-root = true
-
-[*]
-charset = utf-8
-end_of_line = lf
-indent_style = tab
-insert_final_newline = true
-trim_trailing_whitespace = true
-
-[*.{lock,nix}]
-indent_size = 2
-indent_style = space
diff --git a/.gitignore b/.gitignore
index a3149df..e3b6f2a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,10 +1,4 @@
# nix build results
-result*
+result
+result-*
repl-result-out*
-
-# dev shell artifacts
-.direnv
-.pre-commit-config.yaml
-
-# vimnix artifacts
-generated.lua
diff --git a/config/after/plugin/globals.lua b/after/plugin/globals.lua
index f2d5650..f2d5650 100644
--- a/config/after/plugin/globals.lua
+++ b/after/plugin/globals.lua
diff --git a/config/after/plugin/keymaps.lua b/after/plugin/keymaps.lua
index 9ff505a..9ff505a 100644
--- a/config/after/plugin/keymaps.lua
+++ b/after/plugin/keymaps.lua
diff --git a/config/default.nix b/config/default.nix
deleted file mode 100644
index ece45ef..0000000
--- a/config/default.nix
+++ /dev/null
@@ -1,19 +0,0 @@
-{
- lib,
- vimUtils,
- version,
-}:
-vimUtils.buildVimPlugin {
- pname = "neovim-config";
- inherit version;
-
- src = lib.fileset.toSource {
- root = ./.;
- fileset = lib.fileset.unions [
- ./after
- ./ftdetect
- ./lua
- ./plugin
- ];
- };
-}
diff --git a/flake.nix b/flake.nix
index 68234c8..dbde118 100644
--- a/flake.nix
+++ b/flake.nix
@@ -1,11 +1,15 @@
{
description = "getchoo's neovim config";
- inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
+ inputs = {
+ nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
+ };
outputs =
{ self, nixpkgs }:
let
+ inherit (nixpkgs) lib;
+
systems = [
"x86_64-linux"
"aarch64-linux"
@@ -13,7 +17,7 @@
"aarch64-darwin"
];
- forAllSystems = nixpkgs.lib.genAttrs systems;
+ forAllSystems = lib.genAttrs systems;
nixpkgsFor = forAllSystems (system: nixpkgs.legacyPackages.${system});
in
{
@@ -21,19 +25,41 @@
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-formatting =
- pkgs.runCommand "check-formatting"
+ check-format-and-lint =
+ pkgs.runCommand "check-format-and-lint"
{
nativeBuildInputs = [
pkgs.actionlint
pkgs.nixfmt-rfc-style
- pkgs.stylua
+ pkgs.selene
+ pkgs.statix
];
}
''
- cd ${./.}
+ cd ${root}
echo "running actionlint..."
actionlint ./.github/workflows/*
@@ -41,31 +67,15 @@
echo "running nixfmt..."
nixfmt --check .
- echo "running stylua..."
- stylua --check .
-
- touch $out
- '';
-
- check-lint =
- pkgs.runCommand "check-lint"
- {
- nativeBuildInputs = [
- pkgs.selene
- pkgs.statix
- ];
- }
- ''
- cd ${./.}
-
- echo "running selene..."
- selene .
+ echo "running selene...."
+ selene **/*.lua
echo "running statix..."
statix check .
touch $out
'';
+
}
);
@@ -96,24 +106,12 @@
formatter = forAllSystems (system: nixpkgsFor.${system}.nixfmt-rfc-style);
- packages = forAllSystems (
- system:
- let
- pkgs = nixpkgsFor.${system};
-
- packages' = self.packages.${system};
+ packages = forAllSystems (system: {
+ getchvim = nixpkgsFor.${system}.callPackage ./neovim.nix {
version = self.shortRev or self.dirtyShortRev or "unknown";
- in
- {
- getchvim = pkgs.callPackage ./neovim.nix {
- inherit version;
- inherit (packages') vimPlugins-getchoo-nvim;
- };
+ };
- vimPlugins-getchoo-nvim = pkgs.callPackage ./config { inherit version; };
-
- default = packages'.getchvim;
- }
- );
+ default = self.packages.${system}.getchvim;
+ });
};
}
diff --git a/config/ftdetect/just.lua b/ftdetect/just.lua
index 4c7098a..4c7098a 100644
--- a/config/ftdetect/just.lua
+++ b/ftdetect/just.lua
diff --git a/config/lua/getchoo/efmls.lua b/lua/getchoo/efmls.lua
index 92d61e9..92d61e9 100644
--- a/config/lua/getchoo/efmls.lua
+++ b/lua/getchoo/efmls.lua
diff --git a/config/lua/getchoo/init.lua b/lua/getchoo/init.lua
index a919bc8..a919bc8 100644
--- a/config/lua/getchoo/init.lua
+++ b/lua/getchoo/init.lua
diff --git a/neovim.nix b/neovim.nix
index 096c32d..465f805 100644
--- a/neovim.nix
+++ b/neovim.nix
@@ -1,6 +1,7 @@
{
lib,
neovimUtils,
+ vimUtils,
vimPlugins,
wrapNeovimUnstable,
neovim-unwrapped,
@@ -14,11 +15,30 @@
shellcheck,
statix,
typos-lsp,
- vimPlugins-getchoo-nvim,
- ...
+ version,
}:
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
+
bufferline-nvim
# dependent on >
nvim-web-devicons
@@ -78,20 +98,23 @@ let
typos-lsp
];
- neovimConfig = neovimUtils.makeNeovimConfig { plugins = plugins ++ [ vimPlugins-getchoo-nvim ]; };
-in
-wrapNeovimUnstable neovim-unwrapped (
- neovimConfig
- // {
+ baseConfig = neovimUtils.makeNeovimConfig {
+ withRuby = false;
+ inherit plugins;
+ };
+
+ config = baseConfig // {
+ # init our configuration
luaRcContent = ''
require("getchoo")
'';
- wrapperArgs = neovimConfig.wrapperArgs ++ [
+ wrapperArgs = baseConfig.wrapperArgs ++ [
"--suffix"
"PATH"
":"
"${lib.makeBinPath extraPackages}"
];
- }
-)
+ };
+in
+wrapNeovimUnstable neovim-unwrapped config
diff --git a/config/plugin/bufferline.lua b/plugin/bufferline.lua
index f6e68ef..f6e68ef 100644
--- a/config/plugin/bufferline.lua
+++ b/plugin/bufferline.lua
diff --git a/config/plugin/catppuccin.lua b/plugin/catppuccin.lua
index 79b84ec..79b84ec 100644
--- a/config/plugin/catppuccin.lua
+++ b/plugin/catppuccin.lua
diff --git a/config/plugin/cmp.lua b/plugin/cmp.lua
index 10c750f..10c750f 100644
--- a/config/plugin/cmp.lua
+++ b/plugin/cmp.lua
diff --git a/config/plugin/dressing.lua b/plugin/dressing.lua
index dc926fe..dc926fe 100644
--- a/config/plugin/dressing.lua
+++ b/plugin/dressing.lua
diff --git a/config/plugin/fidget.lua b/plugin/fidget.lua
index 59fbb0c..59fbb0c 100644
--- a/config/plugin/fidget.lua
+++ b/plugin/fidget.lua
diff --git a/config/plugin/flash.lua b/plugin/flash.lua
index f3e1c15..f3e1c15 100644
--- a/config/plugin/flash.lua
+++ b/plugin/flash.lua
diff --git a/config/plugin/gitsigns.lua b/plugin/gitsigns.lua
index 7f6f457..7f6f457 100644
--- a/config/plugin/gitsigns.lua
+++ b/plugin/gitsigns.lua
diff --git a/config/plugin/ibl.lua b/plugin/ibl.lua
index d780c74..d780c74 100644
--- a/config/plugin/ibl.lua
+++ b/plugin/ibl.lua
diff --git a/config/plugin/lsp-format.lua b/plugin/lsp-format.lua
index e21bdfd..e21bdfd 100644
--- a/config/plugin/lsp-format.lua
+++ b/plugin/lsp-format.lua
diff --git a/config/plugin/lsp.lua b/plugin/lsp.lua
index 356add3..356add3 100644
--- a/config/plugin/lsp.lua
+++ b/plugin/lsp.lua
diff --git a/config/plugin/lualine.lua b/plugin/lualine.lua
index 8a8f87a..8a8f87a 100644
--- a/config/plugin/lualine.lua
+++ b/plugin/lualine.lua
diff --git a/config/plugin/mini.lua b/plugin/mini.lua
index 1911516..1911516 100644
--- a/config/plugin/mini.lua
+++ b/plugin/mini.lua
diff --git a/config/plugin/telescope.lua b/plugin/telescope.lua
index d50d742..d50d742 100644
--- a/config/plugin/telescope.lua
+++ b/plugin/telescope.lua
diff --git a/config/plugin/treesitter.lua b/plugin/treesitter.lua
index 4668fe8..4668fe8 100644
--- a/config/plugin/treesitter.lua
+++ b/plugin/treesitter.lua
diff --git a/config/plugin/trouble.lua b/plugin/trouble.lua
index e1e7768..e1e7768 100644
--- a/config/plugin/trouble.lua
+++ b/plugin/trouble.lua
diff --git a/config/plugin/which-key.lua b/plugin/which-key.lua
index e6d5ecc..e6d5ecc 100644
--- a/config/plugin/which-key.lua
+++ b/plugin/which-key.lua