mirror of
https://github.com/NotAShelf/neovim-flake.git
synced 2025-01-10 03:09:48 +01:00
Compare commits
No commits in common. "a85bf963e6c3725d813667c8233d0a4ee3dcd9ee" and "12fd9d69dc50f9053a99b40bc88da9af5b0b2ef7" have entirely different histories.
a85bf963e6
...
12fd9d69dc
29 changed files with 659 additions and 386 deletions
1
.github/workflows/cachix.yml
vendored
1
.github/workflows/cachix.yml
vendored
|
@ -19,6 +19,7 @@ jobs:
|
||||||
package:
|
package:
|
||||||
- default
|
- default
|
||||||
- nix
|
- nix
|
||||||
|
- tidal
|
||||||
- maximal
|
- maximal
|
||||||
steps:
|
steps:
|
||||||
- uses: easimon/maximize-build-space@v10
|
- uses: easimon/maximize-build-space@v10
|
||||||
|
|
|
@ -15,6 +15,10 @@ inputs: let
|
||||||
configuration.imports = modules;
|
configuration.imports = modules;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
tidalConfig = {
|
||||||
|
config.vim.languages.tidal.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
mainConfig = isMaximal: {
|
mainConfig = isMaximal: {
|
||||||
config.vim = {
|
config.vim = {
|
||||||
viAlias = true;
|
viAlias = true;
|
||||||
|
@ -54,16 +58,7 @@ inputs: let
|
||||||
enableTreesitter = true;
|
enableTreesitter = true;
|
||||||
enableExtraDiagnostics = true;
|
enableExtraDiagnostics = true;
|
||||||
|
|
||||||
# Nim LSP is broken on Darwin and therefore
|
|
||||||
# should be disabled by default. Users may still enable
|
|
||||||
# `vim.languages.vim` to enable it, this does not restrict
|
|
||||||
# that.
|
|
||||||
# See: <https://github.com/PMunch/nimlsp/issues/178#issue-2128106096>
|
|
||||||
nim.enable = false;
|
|
||||||
|
|
||||||
nix.enable = true;
|
nix.enable = true;
|
||||||
|
|
||||||
markdown.enable = isMaximal;
|
|
||||||
html.enable = isMaximal;
|
html.enable = isMaximal;
|
||||||
css.enable = isMaximal;
|
css.enable = isMaximal;
|
||||||
sql.enable = isMaximal;
|
sql.enable = isMaximal;
|
||||||
|
@ -71,11 +66,13 @@ inputs: let
|
||||||
ts.enable = isMaximal;
|
ts.enable = isMaximal;
|
||||||
svelte.enable = isMaximal;
|
svelte.enable = isMaximal;
|
||||||
go.enable = isMaximal;
|
go.enable = isMaximal;
|
||||||
elixir.enable = isMaximal;
|
|
||||||
zig.enable = isMaximal;
|
zig.enable = isMaximal;
|
||||||
python.enable = isMaximal;
|
python.enable = isMaximal;
|
||||||
dart.enable = isMaximal;
|
dart.enable = isMaximal;
|
||||||
|
elixir.enable = isMaximal;
|
||||||
bash.enable = isMaximal;
|
bash.enable = isMaximal;
|
||||||
|
terraform.enable = isMaximal;
|
||||||
|
nim.enable = false;
|
||||||
tailwind.enable = isMaximal;
|
tailwind.enable = isMaximal;
|
||||||
typst.enable = isMaximal;
|
typst.enable = isMaximal;
|
||||||
clang = {
|
clang = {
|
||||||
|
@ -85,14 +82,14 @@ inputs: let
|
||||||
|
|
||||||
rust = {
|
rust = {
|
||||||
enable = isMaximal;
|
enable = isMaximal;
|
||||||
crates.enable = isMaximal;
|
crates.enable = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
visuals = {
|
visuals = {
|
||||||
enable = true;
|
enable = true;
|
||||||
nvimWebDevicons.enable = true;
|
nvimWebDevicons.enable = true;
|
||||||
scrollBar.enable = isMaximal;
|
scrollBar.enable = true;
|
||||||
smoothScroll.enable = true;
|
smoothScroll.enable = true;
|
||||||
cellularAutomaton.enable = false;
|
cellularAutomaton.enable = false;
|
||||||
fidget-nvim.enable = true;
|
fidget-nvim.enable = true;
|
||||||
|
@ -255,5 +252,5 @@ inputs: let
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
in {
|
in {
|
||||||
inherit neovimConfiguration mainConfig;
|
inherit neovimConfiguration mainConfig tidalConfig;
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,7 @@ Below are the commands you may run to try out different configurations provided
|
||||||
configurations are provided:
|
configurations are provided:
|
||||||
|
|
||||||
- Nix
|
- Nix
|
||||||
|
- Tidal
|
||||||
- Maximal
|
- Maximal
|
||||||
|
|
||||||
You may try out any of the provided configurations using the `nix run` command on a system where Nix is installed.
|
You may try out any of the provided configurations using the `nix run` command on a system where Nix is installed.
|
||||||
|
@ -21,6 +22,7 @@ once you garbage collect.
|
||||||
|
|
||||||
```console
|
```console
|
||||||
$ nix run github:notashelf/nvf#nix
|
$ nix run github:notashelf/nvf#nix
|
||||||
|
$ nix run github:notashelf/nvf#tidal
|
||||||
$ nix run github:notashelf/nvf#maximal
|
$ nix run github:notashelf/nvf#maximal
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -31,6 +33,10 @@ $ nix run github:notashelf/nvf#maximal
|
||||||
`Nix` configuration by default provides LSP/diagnostic support for Nix alongisde a set of visual and functional plugins.
|
`Nix` configuration by default provides LSP/diagnostic support for Nix alongisde a set of visual and functional plugins.
|
||||||
By running `nix run .#`, which is the default package, you will build Neovim with this config.
|
By running `nix run .#`, which is the default package, you will build Neovim with this config.
|
||||||
|
|
||||||
|
#### Tidal {#sec-configs-tidal}
|
||||||
|
|
||||||
|
Tidal is an alternative config that adds vim-tidal on top of the plugins from the Nix configuration.
|
||||||
|
|
||||||
#### Maximal {#sec-configs-maximal}
|
#### Maximal {#sec-configs-maximal}
|
||||||
|
|
||||||
`Maximal` is the ultimate configuration that will enable support for more commonly used language as well as additional
|
`Maximal` is the ultimate configuration that will enable support for more commonly used language as well as additional
|
||||||
|
|
|
@ -6,8 +6,8 @@ Release notes for release 0.7
|
||||||
|
|
||||||
[ItsSorae](https://github.com/ItsSorae):
|
[ItsSorae](https://github.com/ItsSorae):
|
||||||
|
|
||||||
- Added support for [typst](https://typst.app/) under `vim.languages.typst`
|
- Added support for [typst](https://typst.app/) under `vim.languages.typst`.
|
||||||
This will enable the `typst-lsp` language server, and the `typstfmt` formatter
|
This will enable the `typst-lsp` language server, and the `typstfmt` formatter.
|
||||||
|
|
||||||
[frothymarrow](https://github.com/frothymarrow):
|
[frothymarrow](https://github.com/frothymarrow):
|
||||||
|
|
||||||
|
@ -18,16 +18,3 @@ Release notes for release 0.7
|
||||||
[horriblename](https://github.com/horriblename):
|
[horriblename](https://github.com/horriblename):
|
||||||
|
|
||||||
- Fix broken treesitter-context keybinds in visual mode
|
- Fix broken treesitter-context keybinds in visual mode
|
||||||
|
|
||||||
[NotAShelf](https://github.com/notashelf)
|
|
||||||
|
|
||||||
- Add `deno fmt` as the default Markdown formatter. This will be enabled
|
|
||||||
automatically if you have autoformatting enabled, but can be disabled manually
|
|
||||||
if you choose to.
|
|
||||||
|
|
||||||
- Refactor `programs.languages.elixir` to use lspconfig and none-ls for LSP and
|
|
||||||
formatter setups respectively. Diagnostics support is considered, and may be
|
|
||||||
added once the [credo](https://github.com/rrrene/credo) linter has been added
|
|
||||||
to nixpkgs. A pull request is currently open.
|
|
||||||
|
|
||||||
- Remove vim-tidal and friends
|
|
||||||
|
|
183
flake.lock
183
flake.lock
|
@ -1,5 +1,22 @@
|
||||||
{
|
{
|
||||||
"nodes": {
|
"nodes": {
|
||||||
|
"dirt-samples-src": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1667426233,
|
||||||
|
"narHash": "sha256-Zl2bi9QofcrhU63eMtg+R6lhV9ExQS/0XNTJ+oq65Uo=",
|
||||||
|
"owner": "tidalcycles",
|
||||||
|
"repo": "dirt-samples",
|
||||||
|
"rev": "92f2145e661b397e62ca0ff3965819e7c7db0dad",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "tidalcycles",
|
||||||
|
"ref": "master",
|
||||||
|
"repo": "dirt-samples",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"flake-compat": {
|
"flake-compat": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
|
@ -163,6 +180,22 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs_3": {
|
"nixpkgs_3": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1693844670,
|
||||||
|
"narHash": "sha256-t69F2nBB8DNQUWHD809oJZJVE+23XBrth4QZuVd6IE0=",
|
||||||
|
"owner": "NixOS",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "3c15feef7770eb5500a4b8792623e2d6f598c9c1",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "NixOS",
|
||||||
|
"ref": "nixos-unstable",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nixpkgs_4": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1702350026,
|
"lastModified": 1702350026,
|
||||||
"narHash": "sha256-A+GNZFZdfl4JdDphYKBJ5Ef1HOiFsP18vQe9mqjmUis=",
|
"narHash": "sha256-A+GNZFZdfl4JdDphYKBJ5Ef1HOiFsP18vQe9mqjmUis=",
|
||||||
|
@ -546,14 +579,30 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"plugin-elixir-ls": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1713724318,
|
||||||
|
"narHash": "sha256-1kLMxznNRRJ7M10zkuWexA/sPFaN449M0SKUjLrnc8c=",
|
||||||
|
"owner": "elixir-lsp",
|
||||||
|
"repo": "elixir-ls",
|
||||||
|
"rev": "8486de473a219dcdb72408702f8d56d0227c7366",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "elixir-lsp",
|
||||||
|
"repo": "elixir-ls",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"plugin-elixir-tools": {
|
"plugin-elixir-tools": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1714657398,
|
"lastModified": 1713617654,
|
||||||
"narHash": "sha256-U6db1n/RIpT7Dd54e9iI/PjO1BhDpMyNPfaph+dUk7k=",
|
"narHash": "sha256-pJgtW51FLs+Yr+tlQckRmGkRnSUQNI3fEROn3D51mMs=",
|
||||||
"owner": "elixir-tools",
|
"owner": "elixir-tools",
|
||||||
"repo": "elixir-tools.nvim",
|
"repo": "elixir-tools.nvim",
|
||||||
"rev": "51eddb03a7a8c9f00d6415b356a4d3b75d8e75b6",
|
"rev": "3c4f8344a341818417b3d75c04eb96d894cb4640",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -1780,6 +1829,7 @@
|
||||||
"plugin-diffview-nvim": "plugin-diffview-nvim",
|
"plugin-diffview-nvim": "plugin-diffview-nvim",
|
||||||
"plugin-dracula": "plugin-dracula",
|
"plugin-dracula": "plugin-dracula",
|
||||||
"plugin-dressing-nvim": "plugin-dressing-nvim",
|
"plugin-dressing-nvim": "plugin-dressing-nvim",
|
||||||
|
"plugin-elixir-ls": "plugin-elixir-ls",
|
||||||
"plugin-elixir-tools": "plugin-elixir-tools",
|
"plugin-elixir-tools": "plugin-elixir-tools",
|
||||||
"plugin-fidget-nvim": "plugin-fidget-nvim",
|
"plugin-fidget-nvim": "plugin-fidget-nvim",
|
||||||
"plugin-flutter-tools": "plugin-flutter-tools",
|
"plugin-flutter-tools": "plugin-flutter-tools",
|
||||||
|
@ -1856,6 +1906,7 @@
|
||||||
"plugin-which-key": "plugin-which-key",
|
"plugin-which-key": "plugin-which-key",
|
||||||
"rnix-lsp": "rnix-lsp",
|
"rnix-lsp": "rnix-lsp",
|
||||||
"systems": "systems_2",
|
"systems": "systems_2",
|
||||||
|
"tidalcycles": "tidalcycles",
|
||||||
"zig": "zig"
|
"zig": "zig"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -1884,6 +1935,23 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"superdirt-src": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1611740180,
|
||||||
|
"narHash": "sha256-GtnqZeMFqFkVhgx2Exu0wY687cHa7mNnVCgjQd6fiIA=",
|
||||||
|
"owner": "musikinformatik",
|
||||||
|
"repo": "superdirt",
|
||||||
|
"rev": "7abb62e89649daa1232b9cbd6427241868abd30e",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "musikinformatik",
|
||||||
|
"ref": "master",
|
||||||
|
"repo": "superdirt",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"systems": {
|
"systems": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1681028828,
|
"lastModified": 1681028828,
|
||||||
|
@ -1914,6 +1982,62 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"systems_3": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1681028828,
|
||||||
|
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"tidal-src": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1654350756,
|
||||||
|
"narHash": "sha256-tONM5SYYBca0orTLH1EUOilSC1FCluWrFt8AetUx+YQ=",
|
||||||
|
"owner": "tidalcycles",
|
||||||
|
"repo": "tidal",
|
||||||
|
"rev": "fda9c1ecb3722698935245e5409ef8ccdfca16c8",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "tidalcycles",
|
||||||
|
"ref": "main",
|
||||||
|
"repo": "tidal",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"tidalcycles": {
|
||||||
|
"inputs": {
|
||||||
|
"dirt-samples-src": "dirt-samples-src",
|
||||||
|
"nixpkgs": "nixpkgs_3",
|
||||||
|
"superdirt-src": "superdirt-src",
|
||||||
|
"tidal-src": "tidal-src",
|
||||||
|
"utils": "utils_2",
|
||||||
|
"vim-tidal-src": "vim-tidal-src",
|
||||||
|
"vowel-src": "vowel-src"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1694087816,
|
||||||
|
"narHash": "sha256-GMV5ONQhLwa6xRYhZkmwc2W2jbjAfHfB/OR9vR0+PFA=",
|
||||||
|
"owner": "mitchmindtree",
|
||||||
|
"repo": "tidalcycles.nix",
|
||||||
|
"rev": "1b1c4df5303e07930d23e8361ab8253ebec0c7bb",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "mitchmindtree",
|
||||||
|
"repo": "tidalcycles.nix",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"utils": {
|
"utils": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1656928814,
|
"lastModified": 1656928814,
|
||||||
|
@ -1929,11 +2053,62 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"utils_2": {
|
||||||
|
"inputs": {
|
||||||
|
"systems": "systems_3"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1692799911,
|
||||||
|
"narHash": "sha256-3eihraek4qL744EvQXsK1Ha6C3CR7nnT8X2qWap4RNk=",
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"rev": "f9e7cf818399d17d347f847525c5a5a8032e4e44",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"vim-tidal-src": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1685703852,
|
||||||
|
"narHash": "sha256-8gyk17YLeKpLpz3LRtxiwbpsIbZka9bb63nK5/9IUoA=",
|
||||||
|
"owner": "tidalcycles",
|
||||||
|
"repo": "vim-tidal",
|
||||||
|
"rev": "e440fe5bdfe07f805e21e6872099685d38e8b761",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "tidalcycles",
|
||||||
|
"repo": "vim-tidal",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"vowel-src": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1641306144,
|
||||||
|
"narHash": "sha256-zfF6cvAGDNYWYsE8dOIo38b+dIymd17Pexg0HiPFbxM=",
|
||||||
|
"owner": "supercollider-quarks",
|
||||||
|
"repo": "vowel",
|
||||||
|
"rev": "ab59caa870201ecf2604b3efdd2196e21a8b5446",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "supercollider-quarks",
|
||||||
|
"ref": "master",
|
||||||
|
"repo": "vowel",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"zig": {
|
"zig": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-compat": "flake-compat",
|
"flake-compat": "flake-compat",
|
||||||
"flake-utils": "flake-utils_2",
|
"flake-utils": "flake-utils_2",
|
||||||
"nixpkgs": "nixpkgs_3"
|
"nixpkgs": "nixpkgs_4"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1713960597,
|
"lastModified": 1713960597,
|
||||||
|
|
34
flake.nix
34
flake.nix
|
@ -76,7 +76,6 @@
|
||||||
|
|
||||||
# Flake inputs
|
# Flake inputs
|
||||||
inputs = {
|
inputs = {
|
||||||
## Basic Inputs
|
|
||||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||||
flake-parts.url = "github:hercules-ci/flake-parts";
|
flake-parts.url = "github:hercules-ci/flake-parts";
|
||||||
flake-utils.url = "github:numtide/flake-utils";
|
flake-utils.url = "github:numtide/flake-utils";
|
||||||
|
@ -99,7 +98,13 @@
|
||||||
inputs.flake-utils.follows = "flake-utils";
|
inputs.flake-utils.follows = "flake-utils";
|
||||||
};
|
};
|
||||||
|
|
||||||
## Plugins
|
### Plugins
|
||||||
|
# Tidal cycles
|
||||||
|
tidalcycles = {
|
||||||
|
url = "github:mitchmindtree/tidalcycles.nix";
|
||||||
|
inputs.vim-tidal-src.url = "github:tidalcycles/vim-tidal";
|
||||||
|
};
|
||||||
|
|
||||||
# LSP plugins
|
# LSP plugins
|
||||||
plugin-nvim-lspconfig = {
|
plugin-nvim-lspconfig = {
|
||||||
url = "github:neovim/nvim-lspconfig";
|
url = "github:neovim/nvim-lspconfig";
|
||||||
|
@ -178,11 +183,26 @@
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
plugin-elixir-ls = {
|
||||||
|
url = "github:elixir-lsp/elixir-ls";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
|
|
||||||
plugin-elixir-tools = {
|
plugin-elixir-tools = {
|
||||||
url = "github:elixir-tools/elixir-tools.nvim";
|
url = "github:elixir-tools/elixir-tools.nvim";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
plugin-glow-nvim = {
|
||||||
|
url = "github:ellisonleao/glow.nvim";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
plugin-image-nvim = {
|
||||||
|
url = "github:3rd/image.nvim";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
|
|
||||||
# Copying/Registers
|
# Copying/Registers
|
||||||
plugin-registers = {
|
plugin-registers = {
|
||||||
url = "github:tversteeg/registers.nvim";
|
url = "github:tversteeg/registers.nvim";
|
||||||
|
@ -482,16 +502,6 @@
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
plugin-glow-nvim = {
|
|
||||||
url = "github:ellisonleao/glow.nvim";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-image-nvim = {
|
|
||||||
url = "github:3rd/image.nvim";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
# Note-taking
|
# Note-taking
|
||||||
plugin-obsidian-nvim = {
|
plugin-obsidian-nvim = {
|
||||||
url = "github:epwalsh/obsidian.nvim";
|
url = "github:epwalsh/obsidian.nvim";
|
||||||
|
|
|
@ -1,11 +1,21 @@
|
||||||
{lib, ...}: let
|
{lib, ...}: {
|
||||||
inherit (lib.meta) getExe;
|
perSystem = {
|
||||||
in {
|
system,
|
||||||
perSystem = {config, ...}: {
|
config,
|
||||||
apps = {
|
...
|
||||||
nix.program = getExe config.packages.nix;
|
}: {
|
||||||
maximal.program = getExe config.packages.maximal;
|
apps =
|
||||||
default = config.apps.nix;
|
{
|
||||||
};
|
nix.program = lib.getExe config.packages.nix;
|
||||||
|
maximal.program = lib.getExe config.packages.maximal;
|
||||||
|
default = config.apps.nix;
|
||||||
|
}
|
||||||
|
// (
|
||||||
|
if !(builtins.elem system ["aarch64-darwin" "x86_64-darwin"])
|
||||||
|
then {
|
||||||
|
tidal.program = lib.getExe config.packages.tidal;
|
||||||
|
}
|
||||||
|
else {}
|
||||||
|
);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
legacyPackages = import inputs.nixpkgs {
|
legacyPackages = import inputs.nixpkgs {
|
||||||
inherit system;
|
inherit system;
|
||||||
overlays = [
|
overlays = [
|
||||||
|
inputs.tidalcycles.overlays.default
|
||||||
inputs.self.overlays.default
|
inputs.self.overlays.default
|
||||||
(_: _: {
|
(_: _: {
|
||||||
rnix-lsp = inputs'.rnix-lsp.defaultPackage;
|
rnix-lsp = inputs'.rnix-lsp.defaultPackage;
|
||||||
|
|
|
@ -9,11 +9,13 @@
|
||||||
|
|
||||||
nixConfig = mainConfig false;
|
nixConfig = mainConfig false;
|
||||||
maximalConfig = mainConfig true;
|
maximalConfig = mainConfig true;
|
||||||
|
tidalConfig = {config.vim.tidal.enable = true;};
|
||||||
in {
|
in {
|
||||||
flake.overlays.default = _final: prev: {
|
flake.overlays.default = _final: prev: {
|
||||||
inherit neovimConfiguration;
|
inherit neovimConfiguration;
|
||||||
neovim-nix = buildPkg prev [nixConfig];
|
neovim-nix = buildPkg prev [nixConfig];
|
||||||
neovim-maximal = buildPkg prev [maximalConfig];
|
neovim-maximal = buildPkg prev [maximalConfig];
|
||||||
|
neovim-tidal = buildPkg prev [tidalConfig];
|
||||||
devPkg = buildPkg pkgs [nixConfig {config.vim.languages.html.enable = pkgs.lib.mkForce true;}];
|
devPkg = buildPkg pkgs [nixConfig {config.vim.languages.html.enable = pkgs.lib.mkForce true;}];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,50 +7,56 @@
|
||||||
}: let
|
}: let
|
||||||
docs = import ../docs {inherit pkgs inputs;};
|
docs = import ../docs {inherit pkgs inputs;};
|
||||||
in {
|
in {
|
||||||
packages = {
|
packages =
|
||||||
# Documentation
|
{
|
||||||
docs = docs.manual.html;
|
# Documentation
|
||||||
docs-html = docs.manual.html;
|
docs = docs.manual.html;
|
||||||
docs-manpages = docs.manPages;
|
docs-html = docs.manual.html;
|
||||||
docs-json = docs.options.json;
|
docs-manpages = docs.manPages;
|
||||||
|
docs-json = docs.options.json;
|
||||||
|
|
||||||
# Build and open the built manual in your system browser
|
# Build and open the built manual in your system browser
|
||||||
docs-html-wrapped = pkgs.writeScriptBin "docs-html-wrapped" ''
|
docs-html-wrapped = pkgs.writeScriptBin "docs-html-wrapped" ''
|
||||||
#!${pkgs.stdenv.shell}
|
#!${pkgs.stdenv.shell}
|
||||||
# use xdg-open to open the docs in the browser
|
# use xdg-open to open the docs in the browser
|
||||||
${pkgs.xdg_utils}/bin/xdg-open ${docs.manual.html}
|
${pkgs.xdg_utils}/bin/xdg-open ${docs.manual.html}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
# Exposed neovim configurations
|
# Exposed neovim configurations
|
||||||
nix = config.legacyPackages.neovim-nix;
|
nix = config.legacyPackages.neovim-nix;
|
||||||
maximal = config.legacyPackages.neovim-maximal;
|
maximal = config.legacyPackages.neovim-maximal;
|
||||||
default = config.legacyPackages.neovim-nix;
|
default = config.legacyPackages.neovim-nix;
|
||||||
|
|
||||||
# Published docker images
|
# Published docker images
|
||||||
docker-nix = let
|
docker-nix = let
|
||||||
inherit (pkgs) bash gitFull buildEnv dockerTools;
|
inherit (pkgs) bash gitFull buildEnv dockerTools;
|
||||||
inherit (config.legacyPackages) neovim-nix;
|
inherit (config.legacyPackages) neovim-nix;
|
||||||
in
|
in
|
||||||
dockerTools.buildImage {
|
dockerTools.buildImage {
|
||||||
name = "nvf";
|
name = "nvf";
|
||||||
tag = "latest";
|
tag = "latest";
|
||||||
|
|
||||||
copyToRoot = buildEnv {
|
copyToRoot = buildEnv {
|
||||||
name = "neovim-root";
|
name = "neovim-root";
|
||||||
pathsToLink = ["/bin"];
|
pathsToLink = ["/bin"];
|
||||||
paths = [
|
paths = [
|
||||||
neovim-nix
|
neovim-nix
|
||||||
gitFull
|
gitFull
|
||||||
bash
|
bash
|
||||||
];
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
config = {
|
||||||
|
Cmd = ["${neovim-nix}/bin/nvim"];
|
||||||
|
WorkingDir = "/home/neovim/demo";
|
||||||
|
Volumes = {"/home/neovim/demo" = {};};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
}
|
||||||
config = {
|
// (
|
||||||
Cmd = ["${neovim-nix}/bin/nvim"];
|
if !(builtins.elem system ["aarch64-darwin" "x86_64-darwin"])
|
||||||
WorkingDir = "/home/neovim/demo";
|
then {tidal = config.legacyPackages.neovim-tidal;}
|
||||||
Volumes = {"/home/neovim/demo" = {};};
|
else {}
|
||||||
};
|
);
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,11 +0,0 @@
|
||||||
{lib, ...}: let
|
|
||||||
inherit (lib.modules) mkRemovedOptionModule;
|
|
||||||
in {
|
|
||||||
imports = [
|
|
||||||
# 2024-06-06
|
|
||||||
(mkRemovedOptionModule ["vim" "tidal"] ''
|
|
||||||
Tidalcycles language support has been removed as of 2024-06-06 as it was long unmaintained. If
|
|
||||||
you depended on this functionality, please open an issue.
|
|
||||||
'')
|
|
||||||
];
|
|
||||||
}
|
|
|
@ -53,13 +53,7 @@
|
||||||
"warnings"
|
"warnings"
|
||||||
];
|
];
|
||||||
|
|
||||||
# Extra modules, such as deprecation warnings
|
allModules = concatLists [neovim plugins wrapper];
|
||||||
# or renames in one place.
|
|
||||||
extra = map (p: ./extra + "/${p}") [
|
|
||||||
"deprecations.nix"
|
|
||||||
];
|
|
||||||
|
|
||||||
allModules = concatLists [neovim plugins wrapper extra];
|
|
||||||
|
|
||||||
pkgsModule = {config, ...}: {
|
pkgsModule = {config, ...}: {
|
||||||
config = {
|
config = {
|
||||||
|
|
|
@ -1,17 +1,15 @@
|
||||||
{
|
{
|
||||||
config,
|
|
||||||
pkgs,
|
pkgs,
|
||||||
|
config,
|
||||||
lib,
|
lib,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (builtins) attrNames;
|
inherit (builtins) attrNames;
|
||||||
inherit (lib.options) mkOption mkEnableOption literalExpression;
|
inherit (lib.options) mkOption mkEnableOption literalExpression;
|
||||||
inherit (lib.modules) mkIf mkMerge;
|
|
||||||
inherit (lib.lists) isList;
|
inherit (lib.lists) isList;
|
||||||
inherit (lib.types) enum either package listOf str bool;
|
inherit (lib.types) enum either package listOf str bool;
|
||||||
inherit (lib.nvim.languages) diagnosticsToLua;
|
|
||||||
inherit (lib.nvim.types) diagnostics mkGrammarOption;
|
|
||||||
inherit (lib.nvim.lua) expToLua;
|
inherit (lib.nvim.lua) expToLua;
|
||||||
|
inherit (lib.nvim.types) diagnostics mkGrammarOption;
|
||||||
|
|
||||||
cfg = config.vim.languages.bash;
|
cfg = config.vim.languages.bash;
|
||||||
|
|
||||||
|
@ -57,7 +55,6 @@
|
||||||
ls_sources,
|
ls_sources,
|
||||||
null_ls.builtins.diagnostics.shellcheck.with({
|
null_ls.builtins.diagnostics.shellcheck.with({
|
||||||
command = "${pkg}/bin/shellcheck",
|
command = "${pkg}/bin/shellcheck",
|
||||||
diagnostics_format = "#{m} [#{c}]"
|
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
'';
|
'';
|
||||||
|
@ -117,30 +114,4 @@ in {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable (mkMerge [
|
|
||||||
(mkIf cfg.treesitter.enable {
|
|
||||||
vim.treesitter.enable = true;
|
|
||||||
vim.treesitter.grammars = [cfg.treesitter.package];
|
|
||||||
})
|
|
||||||
|
|
||||||
(mkIf cfg.lsp.enable {
|
|
||||||
vim.lsp.lspconfig.enable = true;
|
|
||||||
vim.lsp.lspconfig.sources.bash-lsp = servers.${cfg.lsp.server}.lspConfig;
|
|
||||||
})
|
|
||||||
|
|
||||||
(mkIf cfg.format.enable {
|
|
||||||
vim.lsp.null-ls.enable = true;
|
|
||||||
vim.lsp.null-ls.sources.bash-format = formats.${cfg.format.type}.nullConfig;
|
|
||||||
})
|
|
||||||
|
|
||||||
(mkIf cfg.extraDiagnostics.enable {
|
|
||||||
vim.lsp.null-ls.enable = true;
|
|
||||||
vim.lsp.null-ls.sources = diagnosticsToLua {
|
|
||||||
lang = "bash";
|
|
||||||
config = cfg.extraDiagnostics.types;
|
|
||||||
inherit diagnosticsProviders;
|
|
||||||
};
|
|
||||||
})
|
|
||||||
]);
|
|
||||||
}
|
}
|
83
modules/plugins/languages/bash/config.nix
Normal file
83
modules/plugins/languages/bash/config.nix
Normal file
|
@ -0,0 +1,83 @@
|
||||||
|
{
|
||||||
|
pkgs,
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
inherit (lib.lists) isList;
|
||||||
|
inherit (lib.modules) mkIf mkMerge;
|
||||||
|
inherit (lib.nvim.lua) expToLua;
|
||||||
|
inherit (lib.nvim.languages) diagnosticsToLua;
|
||||||
|
|
||||||
|
cfg = config.vim.languages.bash;
|
||||||
|
diagnosticsProviders = {
|
||||||
|
shellcheck = {
|
||||||
|
package = pkgs.shellcheck;
|
||||||
|
nullConfig = pkg: ''
|
||||||
|
table.insert(
|
||||||
|
ls_sources,
|
||||||
|
null_ls.builtins.diagnostics.shellcheck.with({
|
||||||
|
command = "${pkg}/bin/shellcheck",
|
||||||
|
})
|
||||||
|
)
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
formats = {
|
||||||
|
shfmt = {
|
||||||
|
package = pkgs.shfmt;
|
||||||
|
nullConfig = ''
|
||||||
|
table.insert(
|
||||||
|
ls_sources,
|
||||||
|
null_ls.builtins.formatting.shfmt.with({
|
||||||
|
command = "${pkgs.shfmt}/bin/shfmt",
|
||||||
|
})
|
||||||
|
)
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
servers = {
|
||||||
|
bash-ls = {
|
||||||
|
package = pkgs.nodePackages.bash-language-server;
|
||||||
|
lspConfig = ''
|
||||||
|
lspconfig.bashls.setup{
|
||||||
|
capabilities = capabilities;
|
||||||
|
on_attach = default_on_attach;
|
||||||
|
cmd = ${
|
||||||
|
if isList cfg.lsp.package
|
||||||
|
then expToLua cfg.lsp.package
|
||||||
|
else ''{"${cfg.lsp.package}/bin/bash-language-server", "start"}''
|
||||||
|
};
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
in {
|
||||||
|
config = mkIf cfg.enable (mkMerge [
|
||||||
|
(mkIf cfg.treesitter.enable {
|
||||||
|
vim.treesitter.enable = true;
|
||||||
|
vim.treesitter.grammars = [cfg.treesitter.package];
|
||||||
|
})
|
||||||
|
|
||||||
|
(mkIf cfg.lsp.enable {
|
||||||
|
vim.lsp.lspconfig.enable = true;
|
||||||
|
vim.lsp.lspconfig.sources.bash-lsp = servers.${cfg.lsp.server}.lspConfig;
|
||||||
|
})
|
||||||
|
|
||||||
|
(mkIf cfg.format.enable {
|
||||||
|
vim.lsp.null-ls.enable = true;
|
||||||
|
vim.lsp.null-ls.sources.bash-format = formats.${cfg.format.type}.nullConfig;
|
||||||
|
})
|
||||||
|
|
||||||
|
(mkIf cfg.extraDiagnostics.enable {
|
||||||
|
vim.lsp.null-ls.enable = true;
|
||||||
|
vim.lsp.null-ls.sources = diagnosticsToLua {
|
||||||
|
lang = "bash";
|
||||||
|
config = cfg.extraDiagnostics.types;
|
||||||
|
inherit diagnosticsProviders;
|
||||||
|
};
|
||||||
|
})
|
||||||
|
]);
|
||||||
|
}
|
6
modules/plugins/languages/bash/default.nix
Normal file
6
modules/plugins/languages/bash/default.nix
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./bash.nix
|
||||||
|
./config.nix
|
||||||
|
];
|
||||||
|
}
|
76
modules/plugins/languages/dart/config.nix
Normal file
76
modules/plugins/languages/dart/config.nix
Normal file
|
@ -0,0 +1,76 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
inherit (lib.lists) isList;
|
||||||
|
inherit (lib.modules) mkIf mkMerge;
|
||||||
|
inherit (lib.strings) optionalString;
|
||||||
|
inherit (lib.trivial) boolToString;
|
||||||
|
inherit (lib.nvim.lua) expToLua;
|
||||||
|
inherit (lib.nvim.dag) entryAnywhere;
|
||||||
|
|
||||||
|
cfg = config.vim.languages.dart;
|
||||||
|
ftcfg = cfg.flutter-tools;
|
||||||
|
servers = {
|
||||||
|
dart = {
|
||||||
|
package = pkgs.dart;
|
||||||
|
lspConfig = ''
|
||||||
|
lspconfig.dartls.setup{
|
||||||
|
capabilities = capabilities;
|
||||||
|
on_attach=default_on_attach;
|
||||||
|
cmd = ${
|
||||||
|
if isList cfg.lsp.package
|
||||||
|
then expToLua cfg.lsp.package
|
||||||
|
else ''{"${cfg.lsp.package}/bin/dart", "language-server", "--protocol=lsp"}''
|
||||||
|
};
|
||||||
|
${optionalString (cfg.lsp.opts != null) "init_options = ${cfg.lsp.dartOpts}"}
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
in {
|
||||||
|
config = mkIf cfg.enable (mkMerge [
|
||||||
|
(mkIf cfg.treesitter.enable {
|
||||||
|
vim.treesitter.enable = true;
|
||||||
|
vim.treesitter.grammars = [cfg.treesitter.package];
|
||||||
|
})
|
||||||
|
|
||||||
|
(mkIf cfg.lsp.enable {
|
||||||
|
vim.lsp.lspconfig.enable = true;
|
||||||
|
|
||||||
|
vim.lsp.lspconfig.sources.dart-lsp = servers.${cfg.lsp.server}.lspConfig;
|
||||||
|
})
|
||||||
|
|
||||||
|
(mkIf ftcfg.enable {
|
||||||
|
vim.startPlugins =
|
||||||
|
if ftcfg.enableNoResolvePatch
|
||||||
|
then ["flutter-tools-patched"]
|
||||||
|
else ["flutter-tools"];
|
||||||
|
|
||||||
|
vim.luaConfigRC.flutter-tools = entryAnywhere ''
|
||||||
|
require('flutter-tools').setup {
|
||||||
|
lsp = {
|
||||||
|
color = { -- show the derived colours for dart variables
|
||||||
|
enabled = ${boolToString ftcfg.color.enable}, -- whether or not to highlight color variables at all, only supported on flutter >= 2.10
|
||||||
|
background = ${boolToString ftcfg.color.highlightBackground}, -- highlight the background
|
||||||
|
foreground = ${boolToString ftcfg.color.highlightForeground}, -- highlight the foreground
|
||||||
|
virtual_text = ${boolToString ftcfg.color.virtualText.enable}, -- show the highlight using virtual text
|
||||||
|
virtual_text_str = ${ftcfg.color.virtualText.character} -- the virtual text character to highlight
|
||||||
|
},
|
||||||
|
|
||||||
|
capabilities = capabilities,
|
||||||
|
on_attach = default_on_attach;
|
||||||
|
flags = lsp_flags,
|
||||||
|
},
|
||||||
|
${optionalString cfg.dap.enable ''
|
||||||
|
debugger = {
|
||||||
|
enabled = true,
|
||||||
|
},
|
||||||
|
''}
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
})
|
||||||
|
]);
|
||||||
|
}
|
|
@ -1,23 +1,18 @@
|
||||||
{
|
{
|
||||||
config,
|
config,
|
||||||
pkgs,
|
|
||||||
lib,
|
lib,
|
||||||
|
pkgs,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (builtins) attrNames;
|
inherit (builtins) attrNames;
|
||||||
inherit (lib.modules) mkIf mkMerge;
|
|
||||||
inherit (lib.trivial) boolToString;
|
|
||||||
inherit (lib.lists) isList;
|
inherit (lib.lists) isList;
|
||||||
inherit (lib.options) mkEnableOption mkOption;
|
inherit (lib.options) mkEnableOption mkOption;
|
||||||
inherit (lib.types) enum either listOf package nullOr str bool;
|
inherit (lib.types) enum either listOf package nullOr str bool;
|
||||||
inherit (lib.strings) optionalString;
|
inherit (lib.strings) optionalString;
|
||||||
inherit (lib.nvim.lua) expToLua;
|
inherit (lib.nvim.lua) expToLua;
|
||||||
inherit (lib.nvim.types) mkGrammarOption;
|
inherit (lib.nvim.types) mkGrammarOption;
|
||||||
inherit (lib.nvim.dag) entryAnywhere;
|
|
||||||
|
|
||||||
cfg = config.vim.languages.dart;
|
cfg = config.vim.languages.dart;
|
||||||
ftcfg = cfg.flutter-tools;
|
|
||||||
|
|
||||||
defaultServer = "dart";
|
defaultServer = "dart";
|
||||||
servers = {
|
servers = {
|
||||||
dart = {
|
dart = {
|
||||||
|
@ -53,16 +48,15 @@ in {
|
||||||
default = defaultServer;
|
default = defaultServer;
|
||||||
};
|
};
|
||||||
package = mkOption {
|
package = mkOption {
|
||||||
|
description = "Dart LSP server package, or the command to run as a list of strings";
|
||||||
|
example = ''[lib.getExe pkgs.jdt-language-server "-data" "~/.cache/jdtls/workspace"]'';
|
||||||
type = either package (listOf str);
|
type = either package (listOf str);
|
||||||
default = servers.${cfg.lsp.server}.package;
|
default = servers.${cfg.lsp.server}.package;
|
||||||
example = ''[lib.getExe pkgs.jdt-language-server "-data" "~/.cache/jdtls/workspace"]'';
|
|
||||||
description = "Dart LSP server package, or the command to run as a list of strings";
|
|
||||||
};
|
};
|
||||||
|
|
||||||
opts = mkOption {
|
opts = mkOption {
|
||||||
|
description = "Options to pass to Dart LSP server";
|
||||||
type = nullOr str;
|
type = nullOr str;
|
||||||
default = null;
|
default = null;
|
||||||
description = "Options to pass to Dart LSP server";
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -76,26 +70,23 @@ in {
|
||||||
|
|
||||||
flutter-tools = {
|
flutter-tools = {
|
||||||
enable = mkOption {
|
enable = mkOption {
|
||||||
|
description = "Enable flutter-tools for flutter support";
|
||||||
type = bool;
|
type = bool;
|
||||||
default = config.vim.languages.enableLSP;
|
default = config.vim.languages.enableLSP;
|
||||||
description = "Enable flutter-tools for flutter support";
|
|
||||||
};
|
};
|
||||||
|
|
||||||
enableNoResolvePatch = mkOption {
|
enableNoResolvePatch = mkOption {
|
||||||
|
description = ''
|
||||||
|
Patch flutter-tools so that it doesn't resolve symlinks when detecting flutter path.
|
||||||
|
This is required if you want to use a flutter package built with nix.
|
||||||
|
If you are using a flutter SDK installed from a different source and encounter the error "`dart` missing from PATH", disable this option.
|
||||||
|
'';
|
||||||
type = bool;
|
type = bool;
|
||||||
default = true;
|
default = true;
|
||||||
description = ''
|
|
||||||
Whether to patch flutter-tools so that it doesn't resolve
|
|
||||||
symlinks when detecting flutter path.
|
|
||||||
|
|
||||||
This is required if you want to use a flutter package built with nix.
|
|
||||||
If you are using a flutter SDK installed from a different source
|
|
||||||
and encounter the error "`dart` missing from PATH", disable this option.
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
|
|
||||||
color = {
|
color = {
|
||||||
enable = mkEnableOption "highlighting color variables";
|
enable = mkEnableOption "Whether or mot to highlight color variables at all";
|
||||||
|
|
||||||
highlightBackground = mkOption {
|
highlightBackground = mkOption {
|
||||||
type = bool;
|
type = bool;
|
||||||
|
@ -121,47 +112,4 @@ in {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable (mkMerge [
|
|
||||||
(mkIf cfg.treesitter.enable {
|
|
||||||
vim.treesitter.enable = true;
|
|
||||||
vim.treesitter.grammars = [cfg.treesitter.package];
|
|
||||||
})
|
|
||||||
|
|
||||||
(mkIf cfg.lsp.enable {
|
|
||||||
vim.lsp.lspconfig.enable = true;
|
|
||||||
|
|
||||||
vim.lsp.lspconfig.sources.dart-lsp = servers.${cfg.lsp.server}.lspConfig;
|
|
||||||
})
|
|
||||||
|
|
||||||
(mkIf ftcfg.enable {
|
|
||||||
vim.startPlugins =
|
|
||||||
if ftcfg.enableNoResolvePatch
|
|
||||||
then ["flutter-tools-patched"]
|
|
||||||
else ["flutter-tools"];
|
|
||||||
|
|
||||||
vim.luaConfigRC.flutter-tools = entryAnywhere ''
|
|
||||||
require('flutter-tools').setup {
|
|
||||||
lsp = {
|
|
||||||
color = { -- show the derived colours for dart variables
|
|
||||||
enabled = ${boolToString ftcfg.color.enable}, -- whether or not to highlight color variables at all, only supported on flutter >= 2.10
|
|
||||||
background = ${boolToString ftcfg.color.highlightBackground}, -- highlight the background
|
|
||||||
foreground = ${boolToString ftcfg.color.highlightForeground}, -- highlight the foreground
|
|
||||||
virtual_text = ${boolToString ftcfg.color.virtualText.enable}, -- show the highlight using virtual text
|
|
||||||
virtual_text_str = ${ftcfg.color.virtualText.character} -- the virtual text character to highlight
|
|
||||||
},
|
|
||||||
|
|
||||||
capabilities = capabilities,
|
|
||||||
on_attach = default_on_attach;
|
|
||||||
flags = lsp_flags,
|
|
||||||
},
|
|
||||||
${optionalString cfg.dap.enable ''
|
|
||||||
debugger = {
|
|
||||||
enabled = true,
|
|
||||||
},
|
|
||||||
''}
|
|
||||||
}
|
|
||||||
'';
|
|
||||||
})
|
|
||||||
]);
|
|
||||||
}
|
}
|
6
modules/plugins/languages/dart/default.nix
Normal file
6
modules/plugins/languages/dart/default.nix
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./dart.nix
|
||||||
|
./config.nix
|
||||||
|
];
|
||||||
|
}
|
|
@ -2,16 +2,18 @@
|
||||||
inherit (lib.nvim.languages) mkEnable;
|
inherit (lib.nvim.languages) mkEnable;
|
||||||
in {
|
in {
|
||||||
imports = [
|
imports = [
|
||||||
./bash.nix
|
./bash
|
||||||
./dart.nix
|
./dart
|
||||||
|
./elixir
|
||||||
|
./markdown
|
||||||
|
./tidal
|
||||||
|
|
||||||
./clang.nix
|
./clang.nix
|
||||||
./css.nix
|
./css.nix
|
||||||
./elixir.nix
|
|
||||||
./go.nix
|
./go.nix
|
||||||
./html.nix
|
./html.nix
|
||||||
./java.nix
|
./java.nix
|
||||||
./lua.nix
|
./lua.nix
|
||||||
./markdown.nix
|
|
||||||
./nim.nix
|
./nim.nix
|
||||||
./nix.nix
|
./nix.nix
|
||||||
./php.nix
|
./php.nix
|
||||||
|
|
|
@ -1,138 +0,0 @@
|
||||||
{
|
|
||||||
config,
|
|
||||||
pkgs,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
inherit (builtins) attrNames;
|
|
||||||
inherit (lib.options) mkEnableOption mkOption;
|
|
||||||
inherit (lib.modules) mkIf mkMerge;
|
|
||||||
inherit (lib.lists) isList;
|
|
||||||
inherit (lib.types) enum either listOf package str;
|
|
||||||
inherit (lib.nvim.types) mkGrammarOption;
|
|
||||||
inherit (lib.nvim.lua) expToLua;
|
|
||||||
inherit (lib.nvim.dag) entryAnywhere;
|
|
||||||
|
|
||||||
cfg = config.vim.languages.elixir;
|
|
||||||
|
|
||||||
defaultServer = "elixirls";
|
|
||||||
servers = {
|
|
||||||
elixirls = {
|
|
||||||
package = pkgs.elixir-ls;
|
|
||||||
lspConfig = ''
|
|
||||||
-- elixirls setup
|
|
||||||
lspconfig.elixirls.setup {
|
|
||||||
capabilities = capabilities,
|
|
||||||
on_attach = default_on_attach,
|
|
||||||
cmd = ${
|
|
||||||
if isList cfg.lsp.package
|
|
||||||
then expToLua cfg.lsp.package
|
|
||||||
else ''{"${cfg.lsp.package}/bin/elixir-ls"}''
|
|
||||||
}
|
|
||||||
}
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
defaultFormat = "mix";
|
|
||||||
formats = {
|
|
||||||
mix = {
|
|
||||||
package = pkgs.elixir;
|
|
||||||
nullConfig = ''
|
|
||||||
table.insert(
|
|
||||||
ls_sources,
|
|
||||||
null_ls.builtins.formatting.mix.with({
|
|
||||||
command = "${cfg.format.package}/bin/mix",
|
|
||||||
})
|
|
||||||
)
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
in {
|
|
||||||
options.vim.languages.elixir = {
|
|
||||||
enable = mkEnableOption "Elixir language support";
|
|
||||||
|
|
||||||
treesitter = {
|
|
||||||
enable = mkEnableOption "Elixir treesitter" // {default = config.vim.languages.enableTreesitter;};
|
|
||||||
package = mkGrammarOption pkgs "elixir";
|
|
||||||
};
|
|
||||||
|
|
||||||
lsp = {
|
|
||||||
enable = mkEnableOption "Elixir LSP support" // {default = config.vim.languages.enableLSP;};
|
|
||||||
|
|
||||||
server = mkOption {
|
|
||||||
description = "Elixir LSP server to use";
|
|
||||||
type = enum (attrNames servers);
|
|
||||||
default = defaultServer;
|
|
||||||
};
|
|
||||||
|
|
||||||
package = mkOption {
|
|
||||||
description = "Elixir LSP server package, or the command to run as a list of strings";
|
|
||||||
example = ''[lib.getExe pkgs.jdt-language-server " - data " " ~/.cache/jdtls/workspace "]'';
|
|
||||||
type = either package (listOf str);
|
|
||||||
default = servers.${cfg.lsp.server}.package;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
format = {
|
|
||||||
enable = mkEnableOption "Elixir formatting" // {default = config.vim.languages.enableFormat;};
|
|
||||||
|
|
||||||
type = mkOption {
|
|
||||||
description = "Elixir formatter to use";
|
|
||||||
type = enum (attrNames formats);
|
|
||||||
default = defaultFormat;
|
|
||||||
};
|
|
||||||
|
|
||||||
package = mkOption {
|
|
||||||
description = "Elixir formatter package";
|
|
||||||
type = package;
|
|
||||||
default = formats.${cfg.format.type}.package;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
elixir-tools = {
|
|
||||||
enable = mkEnableOption "Elixir tools";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
config = mkIf cfg.enable (mkMerge [
|
|
||||||
(mkIf cfg.treesitter.enable {
|
|
||||||
vim.treesitter.enable = true;
|
|
||||||
vim.treesitter.grammars = [cfg.treesitter.package];
|
|
||||||
})
|
|
||||||
|
|
||||||
(mkIf cfg.lsp.enable {
|
|
||||||
vim.lsp.lspconfig.enable = true;
|
|
||||||
vim.lsp.lspconfig.sources.elixir-lsp = servers.${cfg.lsp.server}.lspConfig;
|
|
||||||
})
|
|
||||||
|
|
||||||
(mkIf cfg.format.enable {
|
|
||||||
vim.lsp.null-ls.enable = true;
|
|
||||||
vim.lsp.null-ls.sources.elixir-format = formats.${cfg.format.type}.nullConfig;
|
|
||||||
})
|
|
||||||
|
|
||||||
(mkIf cfg.elixir-tools.enable {
|
|
||||||
vim.startPlugins = ["elixir-tools"];
|
|
||||||
vim.luaConfigRC.elixir-tools = entryAnywhere ''
|
|
||||||
local elixir-tools = require("elixir")
|
|
||||||
local elixirls = require("elixir-tools.elixirls")
|
|
||||||
|
|
||||||
-- disable imperative insstallations of various
|
|
||||||
-- elixir related tools installed by elixir-tools
|
|
||||||
elixir-tools.setup {
|
|
||||||
nextls = {
|
|
||||||
enable = false -- defaults to false
|
|
||||||
},
|
|
||||||
|
|
||||||
credo = {
|
|
||||||
enable = false -- defaults to true
|
|
||||||
},
|
|
||||||
|
|
||||||
elixirls = {
|
|
||||||
enable = false, -- defaults to true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
'';
|
|
||||||
})
|
|
||||||
]);
|
|
||||||
}
|
|
67
modules/plugins/languages/elixir/config.nix
Normal file
67
modules/plugins/languages/elixir/config.nix
Normal file
|
@ -0,0 +1,67 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
inherit (lib.modules) mkIf;
|
||||||
|
inherit (lib.meta) getExe;
|
||||||
|
inherit (lib.nvim.dag) entryAnywhere;
|
||||||
|
|
||||||
|
cfg = config.vim.languages.elixir;
|
||||||
|
in {
|
||||||
|
config = mkIf (cfg.enable) {
|
||||||
|
vim.startPlugins = [
|
||||||
|
"elixir-tools"
|
||||||
|
];
|
||||||
|
|
||||||
|
vim.luaConfigRC.elixir-tools = entryAnywhere ''
|
||||||
|
local elixir = require("elixir")
|
||||||
|
local elixirls = require("elixir.elixirls")
|
||||||
|
|
||||||
|
elixir.setup {
|
||||||
|
elixirls = {
|
||||||
|
-- alternatively, point to an existing elixir-ls installation (optional)
|
||||||
|
-- not currently supported by elixirls, but can be a table if you wish to pass other args `{"path/to/elixirls", "--foo"}`
|
||||||
|
cmd = "${getExe pkgs.elixir-ls}",
|
||||||
|
|
||||||
|
-- default settings, use the `settings` function to override settings
|
||||||
|
settings = elixirls.settings {
|
||||||
|
dialyzerEnabled = true,
|
||||||
|
fetchDeps = false,
|
||||||
|
enableTestLenses = false,
|
||||||
|
suggestSpecs = false,
|
||||||
|
},
|
||||||
|
|
||||||
|
on_attach = function(client, bufnr)
|
||||||
|
local map_opts = { buffer = true, noremap = true}
|
||||||
|
|
||||||
|
-- run the codelens under the cursor
|
||||||
|
vim.keymap.set("n", "<space>r", vim.lsp.codelens.run, map_opts)
|
||||||
|
-- remove the pipe operator
|
||||||
|
vim.keymap.set("n", "<space>fp", ":ElixirFromPipe<cr>", map_opts)
|
||||||
|
-- add the pipe operator
|
||||||
|
vim.keymap.set("n", "<space>tp", ":ElixirToPipe<cr>", map_opts)
|
||||||
|
vim.keymap.set("v", "<space>em", ":ElixirExpandMacro<cr>", map_opts)
|
||||||
|
|
||||||
|
-- bindings for standard LSP functions.
|
||||||
|
vim.keymap.set("n", "<space>df", "<cmd>lua vim.lsp.buf.format()<cr>", map_opts)
|
||||||
|
vim.keymap.set("n", "<space>gd", "<cmd>lua vim.diagnostic.open_float()<cr>", map_opts)
|
||||||
|
vim.keymap.set("n", "<space>dt", "<cmd>lua vim.lsp.buf.definition()<cr>", map_opts)
|
||||||
|
vim.keymap.set("n", "<space>K", "<cmd>lua vim.lsp.buf.hover()<cr>", map_opts)
|
||||||
|
vim.keymap.set("n", "<space>gD","<cmd>lua vim.lsp.buf.implementation()<cr>", map_opts)
|
||||||
|
vim.keymap.set("n", "<space>1gD","<cmd>lua vim.lsp.buf.type_definition()<cr>", map_opts)
|
||||||
|
|
||||||
|
-- keybinds for fzf-lsp.nvim: https://github.com/gfanto/fzf-lsp.nvim
|
||||||
|
-- you could also use telescope.nvim: https://github.com/nvim-telescope/telescope.nvim
|
||||||
|
-- there are also core vim.lsp functions that put the same data in the loclist
|
||||||
|
vim.keymap.set("n", "<space>gr", ":References<cr>", map_opts)
|
||||||
|
vim.keymap.set("n", "<space>g0", ":DocumentSymbols<cr>", map_opts)
|
||||||
|
vim.keymap.set("n", "<space>gW", ":WorkspaceSymbols<cr>", map_opts)
|
||||||
|
vim.keymap.set("n", "<leader>d", ":Diagnostics<cr>", map_opts)
|
||||||
|
end
|
||||||
|
}
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
6
modules/plugins/languages/elixir/default.nix
Normal file
6
modules/plugins/languages/elixir/default.nix
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./config.nix
|
||||||
|
./elixir-tools.nix
|
||||||
|
];
|
||||||
|
}
|
7
modules/plugins/languages/elixir/elixir-tools.nix
Normal file
7
modules/plugins/languages/elixir/elixir-tools.nix
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
{lib, ...}: let
|
||||||
|
inherit (lib.options) mkEnableOption;
|
||||||
|
in {
|
||||||
|
options.vim.languages.elixir = {
|
||||||
|
enable = mkEnableOption "Elixir language support";
|
||||||
|
};
|
||||||
|
}
|
40
modules/plugins/languages/markdown/config.nix
Normal file
40
modules/plugins/languages/markdown/config.nix
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
{
|
||||||
|
pkgs,
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
inherit (lib.nvim.lua) expToLua;
|
||||||
|
inherit (lib.modules) mkIf mkMerge;
|
||||||
|
inherit (lib.lists) isList;
|
||||||
|
|
||||||
|
cfg = config.vim.languages.markdown;
|
||||||
|
servers = {
|
||||||
|
marksman = {
|
||||||
|
package = pkgs.marksman;
|
||||||
|
lspConfig = ''
|
||||||
|
lspconfig.marksman.setup{
|
||||||
|
capabilities = capabilities;
|
||||||
|
on_attach = default_on_attach;
|
||||||
|
cmd = ${
|
||||||
|
if isList cfg.lsp.package
|
||||||
|
then expToLua cfg.lsp.package
|
||||||
|
else ''{"${cfg.lsp.package}/bin/marksman", "server"}''
|
||||||
|
},
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
in {
|
||||||
|
config = mkIf cfg.enable (mkMerge [
|
||||||
|
(mkIf cfg.treesitter.enable {
|
||||||
|
vim.treesitter.enable = true;
|
||||||
|
vim.treesitter.grammars = [cfg.treesitter.mdPackage cfg.treesitter.mdInlinePackage];
|
||||||
|
})
|
||||||
|
|
||||||
|
(mkIf cfg.lsp.enable {
|
||||||
|
vim.lsp.lspconfig.enable = true;
|
||||||
|
vim.lsp.lspconfig.sources.markdown-lsp = servers.${cfg.lsp.server}.lspConfig;
|
||||||
|
})
|
||||||
|
]);
|
||||||
|
}
|
6
modules/plugins/languages/markdown/default.nix
Normal file
6
modules/plugins/languages/markdown/default.nix
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
{...}: {
|
||||||
|
imports = [
|
||||||
|
./config.nix
|
||||||
|
./markdown.nix
|
||||||
|
];
|
||||||
|
}
|
|
@ -4,7 +4,7 @@
|
||||||
lib,
|
lib,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (builtins) attrNames concatLists;
|
inherit (builtins) attrNames;
|
||||||
inherit (lib.options) mkEnableOption mkOption;
|
inherit (lib.options) mkEnableOption mkOption;
|
||||||
inherit (lib.lists) isList;
|
inherit (lib.lists) isList;
|
||||||
inherit (lib.types) bool enum either package listOf str;
|
inherit (lib.types) bool enum either package listOf str;
|
||||||
|
@ -29,22 +29,6 @@
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
defaultFormat = "denofmt";
|
|
||||||
formats = {
|
|
||||||
denofmt = {
|
|
||||||
package = pkgs.deno;
|
|
||||||
nullConfig = ''
|
|
||||||
table.insert(
|
|
||||||
ls_sources,
|
|
||||||
null_ls.builtins.formatting.deno_fmt.with({
|
|
||||||
filetypes = ${concatLists cfg.format.extraFiletypes ["markdown"]},
|
|
||||||
command = "${cfg.format.package}/bin/deno",
|
|
||||||
})
|
|
||||||
)
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
in {
|
in {
|
||||||
options.vim.languages.markdown = {
|
options.vim.languages.markdown = {
|
||||||
enable = mkEnableOption "Markdown markup language support";
|
enable = mkEnableOption "Markdown markup language support";
|
||||||
|
@ -75,27 +59,5 @@ in {
|
||||||
default = servers.${cfg.lsp.server}.package;
|
default = servers.${cfg.lsp.server}.package;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
format = {
|
|
||||||
enable = mkEnableOption "Markdown formatting" // {default = config.vim.languages.enableFormat;};
|
|
||||||
|
|
||||||
type = mkOption {
|
|
||||||
description = "Markdown formatter to use";
|
|
||||||
type = enum (attrNames formats);
|
|
||||||
default = defaultFormat;
|
|
||||||
};
|
|
||||||
|
|
||||||
package = mkOption {
|
|
||||||
description = "Markdown formatter package";
|
|
||||||
type = package;
|
|
||||||
default = formats.${cfg.format.type}.package;
|
|
||||||
};
|
|
||||||
|
|
||||||
extraFiletypes = mkOption {
|
|
||||||
description = "Extra filetypes to format with the Markdown formatter";
|
|
||||||
type = listOf str;
|
|
||||||
default = [];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
23
modules/plugins/languages/tidal/config.nix
Normal file
23
modules/plugins/languages/tidal/config.nix
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
{
|
||||||
|
pkgs,
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
inherit (lib.modules) mkIf;
|
||||||
|
|
||||||
|
cfg = config.vim.tidal;
|
||||||
|
in {
|
||||||
|
config = mkIf (cfg.enable) {
|
||||||
|
vim.startPlugins = [
|
||||||
|
# From tidalcycles flake
|
||||||
|
pkgs.vimPlugins.vim-tidal
|
||||||
|
];
|
||||||
|
|
||||||
|
vim.globals = {
|
||||||
|
"tidal_target" = "terminal";
|
||||||
|
"tidal_flash_duration" = 150;
|
||||||
|
"tidal_sc_enable" = cfg.openSC;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
6
modules/plugins/languages/tidal/default.nix
Normal file
6
modules/plugins/languages/tidal/default.nix
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
{...}: {
|
||||||
|
imports = [
|
||||||
|
./tidal.nix
|
||||||
|
./config.nix
|
||||||
|
];
|
||||||
|
}
|
24
modules/plugins/languages/tidal/tidal.nix
Normal file
24
modules/plugins/languages/tidal/tidal.nix
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
inherit (lib.options) mkEnableOption mkOption;
|
||||||
|
inherit (lib.types) int bool;
|
||||||
|
in {
|
||||||
|
options.vim.tidal = {
|
||||||
|
enable = mkEnableOption "tidalcycles tools and plugins";
|
||||||
|
|
||||||
|
flash = mkOption {
|
||||||
|
description = ''When sending a paragraph or a single line, vim-tidal will "flash" the selection for some milliseconds'';
|
||||||
|
type = int;
|
||||||
|
default = 150;
|
||||||
|
};
|
||||||
|
|
||||||
|
openSC = mkOption {
|
||||||
|
description = "Automatically run the supercollider CLI, sclang, alongside the Tidal GHCI terminal.";
|
||||||
|
type = bool;
|
||||||
|
default = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in a new issue