summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config/default.nix19
-rw-r--r--flake.nix54
-rw-r--r--neovim.nix38
3 files changed, 78 insertions, 33 deletions
diff --git a/config/default.nix b/config/default.nix
new file mode 100644
index 0000000..ece45ef
--- /dev/null
+++ b/config/default.nix
@@ -0,0 +1,19 @@
+{
+ 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 a4ea185..168c9a6 100644
--- a/flake.nix
+++ b/flake.nix
@@ -18,9 +18,14 @@
"aarch64-darwin"
];
- forAllSystems = fn: nixpkgs.lib.genAttrs systems (system: fn nixpkgs.legacyPackages.${system});
+ forAllSystems = fn:
+ nixpkgs.lib.genAttrs systems (system:
+ fn {
+ inherit system;
+ pkgs = nixpkgs.legacyPackages.${system};
+ });
in {
- checks = forAllSystems (pkgs: let
+ checks = forAllSystems ({pkgs, ...}: let
flake-checks' = flake-checks.lib.mkChecks {
root = ./.;
inherit pkgs;
@@ -36,30 +41,47 @@
;
});
- devShells = forAllSystems (pkgs: {
+ devShells = forAllSystems ({
+ pkgs,
+ system,
+ }: {
default = pkgs.mkShellNoCC {
- packages = with pkgs; [
- actionlint
+ packages = [
+ pkgs.actionlint
# lua
- lua-language-server
- selene
- stylua
+ pkgs.lua-language-server
+ pkgs.selene
+ pkgs.stylua
# nix
- self.formatter.${pkgs.system}
- deadnix
- nil
- statix
+ self.formatter.${system}
+ pkgs.deadnix
+ pkgs.nil
+ pkgs.statix
];
};
});
- formatter = forAllSystems (pkgs: pkgs.alejandra);
+ formatter = forAllSystems ({pkgs, ...}: pkgs.alejandra);
- packages = forAllSystems (pkgs: rec {
- getchvim = import ./neovim.nix self pkgs;
- default = getchvim;
+ packages = forAllSystems ({
+ pkgs,
+ system,
+ }: let
+ packages' = self.packages.${system};
+ 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;
});
};
}
diff --git a/neovim.nix b/neovim.nix
index b42ccbd..648c58b 100644
--- a/neovim.nix
+++ b/neovim.nix
@@ -1,19 +1,23 @@
-self: {
+{
lib,
- pkgs,
+ neovimUtils,
+ vimPlugins,
+ wrapNeovimUnstable,
+ neovim-unwrapped,
+ actionlint,
+ alejandra,
+ beautysh,
+ ripgrep,
+ efm-langserver,
+ nil,
+ nodePackages,
+ shellcheck,
+ statix,
+ typos-lsp,
+ vimPlugins-getchoo-nvim,
...
}: let
- config = pkgs.vimUtils.buildVimPlugin {
- pname = "neovim-config";
- version = self.shortRev or self.dirtyShortRev or "unknown-dirty";
-
- src = lib.fileset.toSource {
- root = ./config;
- fileset = lib.fileset.gitTracked ./config;
- };
- };
-
- plugins = with pkgs.vimPlugins; [
+ plugins = with vimPlugins; [
bufferline-nvim
# dependent on >
nvim-web-devicons
@@ -57,7 +61,7 @@ self: {
which-key-nvim
];
- extraPackages = with pkgs; [
+ extraPackages = [
# cmp
ripgrep
@@ -76,11 +80,11 @@ self: {
typos-lsp
];
- neovimConfig = pkgs.neovimUtils.makeNeovimConfig {
- plugins = plugins ++ [config];
+ neovimConfig = neovimUtils.makeNeovimConfig {
+ plugins = plugins ++ [vimPlugins-getchoo-nvim];
};
in
- pkgs.wrapNeovimUnstable pkgs.neovim-unwrapped (
+ wrapNeovimUnstable neovim-unwrapped (
neovimConfig
// {
luaRcContent = ''