Add config as an overlay

This commit is contained in:
2024-12-28 01:36:12 +01:00
parent d7462353b7
commit d2435f65cf
4 changed files with 31 additions and 23 deletions
+23 -15
View File
@@ -64,12 +64,19 @@
overlays = {
nixpkgs.overlays = [
(import ./overlays inputs)
neovim-nightly.overlays.default
nvim-overlay
];
};
mkSystem = import ./lib/mksystem.nix (inputs // {inherit overlays inputs;});
eachSystem = nixpkgs.lib.genAttrs nixpkgs.lib.systems.flakeExposed;
nvim-overlay = final: prev:
import ./nvim (inputs
// {
pkgs = prev.pkgs;
lib = nixpkgs.lib;
});
in {
nixosConfigurations.fuhen = mkSystem "fuhen" {
env = "river";
@@ -112,32 +119,33 @@
};
packages = eachSystem (system: let
pkgs = nixpkgs.legacyPackages.${system};
vim = import ./nvim (inputs
// {
inherit pkgs;
lib = nixpkgs.lib;
});
pkgs = import nixpkgs {
inherit system;
overlays = [nvim-overlay];
};
in rec {
default = nvim;
nvim = vim.nvim;
nvim = pkgs.nvim;
});
devShells = eachSystem (system: let
pkgs = nixpkgs.legacyPackages.${system};
vim = import ./nvim (inputs
// {
inherit pkgs;
lib = nixpkgs.lib;
});
pkgs = import nixpkgs {
inherit system;
overlays = [nvim-overlay];
};
in rec {
default = nvim-lua;
nvim-lua = pkgs.mkShell {
name = "nvim-lua";
shellHook = ''
ln -fs ${vim.luarc} .luarc.json
ln -fs ${pkgs.nvim-luarc} .luarc.json
'';
};
});
overlays = rec {
default = nvim;
nvim = nvim-overlay;
};
};
}
+1 -1
View File
@@ -23,9 +23,9 @@
glow
gh
yq
alejandra
nodePackages.http-server
nodePackages.live-server
nvim
]
++ lib.optionals pkgs.stdenv.isLinux [
usbutils
+5 -3
View File
@@ -1,11 +1,12 @@
{
pkgs,
lib,
neovim-nightly,
lz-nvim,
vim-lumen,
...
}: let
mkNvim = pkgs.callPackage ./nix/mknvim.nix {inherit pkgs;};
mkNvim = import ./nix/mknvim.nix {inherit pkgs lib;};
mkPlugin = src: pname:
pkgs.vimUtils.buildVimPlugin {
@@ -14,8 +15,6 @@
};
in
mkNvim {
name = "nvim";
withNodeJs = false;
withRuby = false;
withPython3 = false;
@@ -135,6 +134,9 @@ in
zls
lua-language-server
# nix formatter
alejandra
# Give access to gdbus for color-scheme detection (vim-lumen).
glib
];
+2 -4
View File
@@ -1,10 +1,8 @@
{
pkgs,
lib,
stdenv,
...
}: {
name ? "nvim",
package ? pkgs.neovim,
config,
plugins ? {
@@ -90,7 +88,7 @@
${builtins.readFile (config + "/init.lua")}
'';
in {
${name} = pkgs.wrapNeovimUnstable nvim {
nvim = pkgs.wrapNeovimUnstable nvim {
wrapRc = false;
wrapperArgs = builtins.concatStringsSep " " [
(lib.optionals (extraPackages != []) ''--prefix PATH : "${lib.makeBinPath extraPackages}"'')
@@ -100,5 +98,5 @@ in {
inherit withPython3 withNodeJs withPerl withRuby extraPython3Packages extraLuaPackages;
};
luarc = mkLuarc { nvim = package; inherit plugins; };
nvim-luarc = mkLuarc { nvim = package; inherit plugins; };
}