Add an nvim package

Now I can run `nix run .#nvim` to run Neovim with any configuration
changes without having to rebuild my whole NixOS configuration.
This commit is contained in:
Oliver Davies 2025-06-12 12:13:49 +01:00
parent e65f3e42a5
commit a068e0481f
3 changed files with 71 additions and 59 deletions

View file

@ -42,6 +42,12 @@
};
inherit (pkgs) mkShell;
neovimWithConfig = inputs.nixvim.legacyPackages.${system}.makeNixvimWithModule {
inherit pkgs;
module = import ./modules/home-manager/coding/neovim/nixvim.nix;
};
in
{
devShells.${system}.default = pkgs.mkShell {
@ -55,6 +61,8 @@
packages.${system} = {
default = mkShell { buildInputs = with pkgs; [ just ]; };
nvim = neovimWithConfig;
};
formatter.${system} = pkgs.nixfmt-rfc-style;

View file

@ -2,7 +2,6 @@
config,
inputs,
lib,
pkgs,
...
}:
@ -22,67 +21,10 @@ in
programs.nixvim = {
enable = true;
# TODO: re-add DAP.
# TODO: re-add snippets.
# TODO: re-configure spell.
viAlias = true;
vimAlias = true;
imports = [
./keymaps.nix
./options.nix
./plugins/cmp.nix
./plugins/conform.nix
./plugins/fidget.nix
./plugins/fugitive.nix
./plugins/gitsigns.nix
./plugins/harpoon.nix
./plugins/lint.nix
./plugins/lsp.nix
./plugins/lualine.nix
./plugins/luasnip.nix
./plugins/mini.nix
./plugins/nvim-autopairs.nix
./plugins/oil.nix
./plugins/phpactor.nix
./plugins/refactoring.nix
./plugins/telescope.nix
./plugins/treesitter.nix
./plugins/undotree.nix
./plugins/vim-dadbod.nix
./plugins/vim-highlightedyank.nix
./plugins/vim-test.nix
./plugins/web-devicons.nix
];
colorschemes.catppuccin = {
enable = true;
settings.flavour = "mocha";
};
extraPackages = with pkgs; [
nixfmt-rfc-style
stylua
];
filetype = {
extension = {
"neon.dist" = "yaml";
inc = "php";
install = "php";
module = "php";
neon = "yaml";
pcss = "scss";
theme = "php";
};
filename = {
"composer.lock" = "json";
};
};
globals.mapleader = " ";
imports = [ ./nixvim.nix ];
};
};
}

View file

@ -0,0 +1,62 @@
{ pkgs, ... }:
{
# TODO: re-add DAP.
# TODO: re-add snippets.
# TODO: re-configure spell.
imports = [
./keymaps.nix
./options.nix
./plugins/cmp.nix
./plugins/conform.nix
./plugins/fidget.nix
./plugins/fugitive.nix
./plugins/gitsigns.nix
./plugins/harpoon.nix
./plugins/lint.nix
./plugins/lsp.nix
./plugins/lualine.nix
./plugins/luasnip.nix
./plugins/mini.nix
./plugins/nvim-autopairs.nix
./plugins/oil.nix
./plugins/phpactor.nix
./plugins/refactoring.nix
./plugins/telescope.nix
./plugins/treesitter.nix
./plugins/undotree.nix
./plugins/vim-dadbod.nix
./plugins/vim-highlightedyank.nix
./plugins/vim-test.nix
./plugins/web-devicons.nix
];
colorschemes.catppuccin = {
enable = true;
settings.flavour = "mocha";
};
extraPackages = with pkgs; [
nixfmt-rfc-style
stylua
];
filetype = {
extension = {
"neon.dist" = "yaml";
inc = "php";
install = "php";
module = "php";
neon = "yaml";
pcss = "scss";
theme = "php";
};
filename = {
"composer.lock" = "json";
};
};
globals.mapleader = " ";
}