feat(nvim): setup for ipynb dev work
All checks were successful
/ check (push) Successful in 26s
/ build (audiomenu) (push) Successful in 1s
/ build (docs) (push) Successful in 2s
/ build (jpassmenu) (push) Successful in 2s
/ build (nixosConfigurations.vm.config.system.build.toplevel) (push) Successful in 16s
/ build (nvim) (push) Successful in 11s

Setup:
- molten (run python code)
- otter (lsp in markdown codeblocks)
- jupytext (convert .ipynb files to .md files transparently)
- image (display images inside neovim (e.g. matplotlib graphs))
This commit is contained in:
Jalil David Salamé Messina 2024-10-05 22:37:58 +02:00
parent f3c04248cf
commit d816faa25b
Signed by: jalil
GPG key ID: F016B9E770737A0B
3 changed files with 31 additions and 12 deletions

View file

@ -1,24 +1,22 @@
{ inputs, ... }:
let
standalone = ../nvim/standalone.nix;
in
{
flake.overlays.nixvim = inputs.nixvim.overlays.default;
perSystem =
{ pkgs, system, ... }:
{
# Check standalone nvim build
checks.nvim = inputs.nixvim.lib.${system}.check.mkTestDerivationFromNixvimModule {
let
nixvimLib = inputs.nixvim.lib.${system};
nixvim = inputs.nixvim.legacyPackages.${system};
module = {
inherit pkgs;
module = ../nvim/standalone.nix;
};
in
{
# Check standalone nvim build
checks.nvim = nixvimLib.check.mkTestDerivationFromNixvimModule module;
# Nvim standalone module
packages.nvim = inputs.nixvim.legacyPackages.${system}.makeNixvimWithModule {
inherit pkgs;
module = standalone;
};
packages.nvim = nixvim.makeNixvimWithModule module;
};
}

View file

@ -5,7 +5,7 @@
...
}:
let
inherit (helpers) mkRaw;
inherit (helpers) mkRaw enableExceptInTests;
in
{
config.plugins = {
@ -160,6 +160,15 @@ in
};
};
gitsigns.enable = true;
image.enable = enableExceptInTests;
jupytext = {
enable = true;
settings.custom_language_formatting.python = {
extension = "md";
style = "markdown";
force_ft = "markdown";
};
};
lint = {
enable = true;
lintersByFt = {
@ -214,6 +223,15 @@ in
enable = true;
settings.update_events = "TextChanged,TextChangedI";
};
molten = {
enable = true;
settings = {
image_provider = "image.nvim";
virt_text_output = true;
molten_auto_open_output = false;
molten_virt_lines_off_by_1 = true;
};
};
noice = {
enable = true;
lsp.override = {
@ -245,6 +263,7 @@ in
mode = "virtualtext";
};
};
otter.enable = true;
rustaceanvim = {
enable = true;
# Install through rustup
@ -260,6 +279,7 @@ in
treesitter = {
enable = true;
settings = {
highlight.enable = true;
indent.enable = true;
incremental_election.enable = true;
};

View file

@ -62,6 +62,7 @@
pkgs.unstable.typos
pkgs.unstable.yamlfmt
];
extraPython3Packages = p: [ p.jupytext ];
extraConfigLuaPre =
# lua
''