mirror of
https://github.com/NotAShelf/nvf.git
synced 2026-03-21 03:46:37 +00:00
Merge branch 'main' into codecompanion
This commit is contained in:
commit
8f560c9567
8 changed files with 126 additions and 32 deletions
2
.github/workflows/cachix.yml
vendored
2
.github/workflows/cachix.yml
vendored
|
|
@ -32,7 +32,7 @@ jobs:
|
||||||
substituters = https://cache.nixos.org/ https://feel-co.cachix.org
|
substituters = https://cache.nixos.org/ https://feel-co.cachix.org
|
||||||
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= feel-co.cachix.org-1:nwEFNnwZvtl4KKSH5LDg+/+K7bV0vcs6faMHAJ6xx0w=
|
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= feel-co.cachix.org-1:nwEFNnwZvtl4KKSH5LDg+/+K7bV0vcs6faMHAJ6xx0w=
|
||||||
|
|
||||||
- uses: cachix/cachix-action@v16
|
- uses: cachix/cachix-action@v17
|
||||||
with:
|
with:
|
||||||
authToken: ${{ secrets.CACHIX_TOKEN }}
|
authToken: ${{ secrets.CACHIX_TOKEN }}
|
||||||
extraPullNames: nix-community
|
extraPullNames: nix-community
|
||||||
|
|
|
||||||
2
.github/workflows/check.yml
vendored
2
.github/workflows/check.yml
vendored
|
|
@ -100,7 +100,7 @@ jobs:
|
||||||
substituters = https://cache.nixos.org/ https://feel-co.cachix.org
|
substituters = https://cache.nixos.org/ https://feel-co.cachix.org
|
||||||
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= feel-co.cachix.org-1:nwEFNnwZvtl4KKSH5LDg+/+K7bV0vcs6faMHAJ6xx0w=
|
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= feel-co.cachix.org-1:nwEFNnwZvtl4KKSH5LDg+/+K7bV0vcs6faMHAJ6xx0w=
|
||||||
|
|
||||||
- uses: cachix/cachix-action@v16
|
- uses: cachix/cachix-action@v17
|
||||||
with:
|
with:
|
||||||
authToken: ${{ secrets.CACHIX_TOKEN }}
|
authToken: ${{ secrets.CACHIX_TOKEN }}
|
||||||
extraPullNames: nix-community
|
extraPullNames: nix-community
|
||||||
|
|
|
||||||
|
|
@ -22,16 +22,22 @@
|
||||||
```
|
```
|
||||||
|
|
||||||
Some other settings and commands are now deprecated but are still supported.
|
Some other settings and commands are now deprecated but are still supported.
|
||||||
|
|
||||||
- The `setupOpts.mappings` options were also removed. Use the built-in Neovim
|
- The `setupOpts.mappings` options were also removed. Use the built-in Neovim
|
||||||
settings (nvf's {option}`vim.keymaps`)
|
settings (nvf's {option}`vim.keymaps`)
|
||||||
|
|
||||||
|
- `languages.{terraform,hcl}`: LSP servers now default to `tofu-ls`. While this
|
||||||
|
is unlikely to cause any noticeable change in behavior or breakage, it's
|
||||||
|
mentioned just in case.
|
||||||
|
|
||||||
|
- `vim.treesitter.foldByDefault` is removed. Folding behavior should be
|
||||||
|
controlled via `vim.options.foldenable` directly instead. RIP
|
||||||
|
`vim.treesitter.foldByDefault` 2026-03-19 - 2026-03-19.
|
||||||
|
|
||||||
[Snoweuph](https://github.com/snoweuph)
|
[Snoweuph](https://github.com/snoweuph)
|
||||||
|
|
||||||
- "Correct `languages.go.treesitter` to contain all Go file types.
|
- "Correct `languages.go.treesitter` to contain all Go file types.
|
||||||
`languages.go.treesitter.package` is now `languages.go.treesitter.goPackage`.
|
`languages.go.treesitter.package` is now `languages.go.treesitter.goPackage`.
|
||||||
New are:
|
New are:
|
||||||
|
|
||||||
- `languages.go.treesitter.goPackage`.
|
- `languages.go.treesitter.goPackage`.
|
||||||
|
|
||||||
- `languages.go.treesitter.gomodPackage`.
|
- `languages.go.treesitter.gomodPackage`.
|
||||||
|
|
@ -53,6 +59,11 @@
|
||||||
|
|
||||||
## Changelog {#sec-release-0-9-changelog}
|
## Changelog {#sec-release-0-9-changelog}
|
||||||
|
|
||||||
|
[midischwarz12](https://github.com/midischwarz12):
|
||||||
|
|
||||||
|
- Changed the prettier-plugin-astro build to use `writableTmpDirAsHomeHook` to
|
||||||
|
avoid pnpm hook failures in sandboxed builds.
|
||||||
|
|
||||||
[taylrfnt](https://github.com/taylrfnt)
|
[taylrfnt](https://github.com/taylrfnt)
|
||||||
|
|
||||||
- Introduce a `darwinModule` option for Darwin users. The ergonomics of
|
- Introduce a `darwinModule` option for Darwin users. The ergonomics of
|
||||||
|
|
@ -61,7 +72,7 @@
|
||||||
following:
|
following:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
(class: "nixos") cannot be imported into a module
|
(class: "nixos") cannot be imported into a module
|
||||||
evaluation that expects class "darwin".
|
evaluation that expects class "darwin".
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
@ -99,6 +110,14 @@
|
||||||
|
|
||||||
- `toggleterm` open map now also works when in terminal mode
|
- `toggleterm` open map now also works when in terminal mode
|
||||||
|
|
||||||
|
[ppenguin](https://github.com/ppenguin):
|
||||||
|
|
||||||
|
- Improved/harmonized for `terraform` and `hcl`:
|
||||||
|
- formatting (use `terraform fmt` or `tofu fmt` for `tf` files)
|
||||||
|
- LSP config
|
||||||
|
- Added `tofu` and `tofu-ls` as (free) alternative to `terrraform` and
|
||||||
|
`terraform-ls`
|
||||||
|
|
||||||
[jtliang24](https://github.com/jtliang24):
|
[jtliang24](https://github.com/jtliang24):
|
||||||
|
|
||||||
- Updated nix language plugin to use pkgs.nixfmt instead of
|
- Updated nix language plugin to use pkgs.nixfmt instead of
|
||||||
|
|
@ -148,7 +167,9 @@
|
||||||
- Mappings are now expected to be set using the built-in Neovim APIs,
|
- Mappings are now expected to be set using the built-in Neovim APIs,
|
||||||
managed by `vim.keymaps` in nvf, instead of `mappings` options.
|
managed by `vim.keymaps` in nvf, instead of `mappings` options.
|
||||||
- Some option defaults have changed.
|
- Some option defaults have changed.
|
||||||
|
|
||||||
- And more.
|
- And more.
|
||||||
|
|
||||||
- Automatically configure an enabled picker in the order mentioned above, if
|
- Automatically configure an enabled picker in the order mentioned above, if
|
||||||
any are enabled.
|
any are enabled.
|
||||||
- Add integration with `snacks.image` for rendering workspace/vault assets.
|
- Add integration with `snacks.image` for rendering workspace/vault assets.
|
||||||
|
|
@ -305,4 +326,8 @@ https://github.com/gorbit99/codewindow.nvim
|
||||||
|
|
||||||
- Updated codecompanion-nvim adapters to allow specifying a model.
|
- Updated codecompanion-nvim adapters to allow specifying a model.
|
||||||
|
|
||||||
|
[tlvince](https://github.com/tlvince):
|
||||||
|
|
||||||
|
- Added configuration option for `foldenable`
|
||||||
|
|
||||||
<!-- vim: set textwidth=80: -->
|
<!-- vim: set textwidth=80: -->
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@
|
||||||
pnpmConfigHook,
|
pnpmConfigHook,
|
||||||
fetchPnpmDeps,
|
fetchPnpmDeps,
|
||||||
pins,
|
pins,
|
||||||
|
writableTmpDirAsHomeHook,
|
||||||
}: let
|
}: let
|
||||||
pin = pins.prettier-plugin-astro;
|
pin = pins.prettier-plugin-astro;
|
||||||
in
|
in
|
||||||
|
|
@ -28,6 +29,7 @@ in
|
||||||
|
|
||||||
nativeBuildInputs = [
|
nativeBuildInputs = [
|
||||||
nodejs
|
nodejs
|
||||||
|
writableTmpDirAsHomeHook
|
||||||
(pnpmConfigHook.overrideAttrs {
|
(pnpmConfigHook.overrideAttrs {
|
||||||
propagatedBuildInputs = [pnpm_9];
|
propagatedBuildInputs = [pnpm_9];
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -342,5 +342,10 @@ in {
|
||||||
Incremental selection configuration has been removed from nvim-treesitter.
|
Incremental selection configuration has been removed from nvim-treesitter.
|
||||||
'')
|
'')
|
||||||
]
|
]
|
||||||
|
|
||||||
|
# 2026-03-19
|
||||||
|
[
|
||||||
|
(mkRenamedOptionModule ["vim" "treesitter" "foldByDefault"] ["vim" "options" "foldenable"])
|
||||||
|
]
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,20 +8,27 @@
|
||||||
inherit (lib.options) mkEnableOption mkOption literalExpression;
|
inherit (lib.options) mkEnableOption mkOption literalExpression;
|
||||||
inherit (lib.meta) getExe;
|
inherit (lib.meta) getExe;
|
||||||
inherit (lib.modules) mkIf mkMerge;
|
inherit (lib.modules) mkIf mkMerge;
|
||||||
inherit (lib.types) bool enum listOf;
|
inherit (lib.types) enum listOf;
|
||||||
inherit (lib.nvim.types) mkGrammarOption deprecatedSingleOrListOf;
|
inherit (lib.nvim.types) mkGrammarOption deprecatedSingleOrListOf;
|
||||||
inherit (lib.nvim.attrsets) mapListToAttrs;
|
inherit (lib.nvim.attrsets) mapListToAttrs;
|
||||||
|
|
||||||
cfg = config.vim.languages.hcl;
|
cfg = config.vim.languages.hcl;
|
||||||
|
|
||||||
defaultServers = ["terraform-ls"];
|
defaultServers = ["tofuls-hcl"];
|
||||||
servers = {
|
servers = {
|
||||||
terraform-ls = {
|
terraformls-hcl = {
|
||||||
enable = true;
|
enable = true;
|
||||||
cmd = [(getExe pkgs.terraform-ls) "serve"];
|
cmd = [(getExe pkgs.terraform-ls) "serve"];
|
||||||
filetypes = ["terraform" "terraform-vars"];
|
filetypes = ["hcl"];
|
||||||
|
root_markers = [".git"];
|
||||||
|
};
|
||||||
|
tofuls-hcl = {
|
||||||
|
enable = true;
|
||||||
|
cmd = [(getExe pkgs.tofu-ls) "serve"];
|
||||||
|
filetypes = ["hcl"];
|
||||||
root_markers = [".terraform" ".git"];
|
root_markers = [".terraform" ".git"];
|
||||||
};
|
};
|
||||||
|
# TODO: package nomad-lsp and offer as an option here too
|
||||||
};
|
};
|
||||||
|
|
||||||
defaultFormat = ["hclfmt"];
|
defaultFormat = ["hclfmt"];
|
||||||
|
|
@ -29,6 +36,11 @@
|
||||||
hclfmt = {
|
hclfmt = {
|
||||||
command = getExe pkgs.hclfmt;
|
command = getExe pkgs.hclfmt;
|
||||||
};
|
};
|
||||||
|
nomad-fmt = {
|
||||||
|
command = getExe pkgs.nomad;
|
||||||
|
args = ["fmt" "$FILENAME"];
|
||||||
|
stdin = false;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
in {
|
in {
|
||||||
options.vim.languages.hcl = {
|
options.vim.languages.hcl = {
|
||||||
|
|
@ -66,7 +78,7 @@ in {
|
||||||
defaultText = literalExpression "config.vim.languages.enableFormat";
|
defaultText = literalExpression "config.vim.languages.enableFormat";
|
||||||
};
|
};
|
||||||
type = mkOption {
|
type = mkOption {
|
||||||
type = deprecatedSingleOrListOf "vim.language.hcl.format.type" (enum (attrNames formats));
|
type = listOf (enum (attrNames formats));
|
||||||
default = defaultFormat;
|
default = defaultFormat;
|
||||||
description = "HCL formatter to use";
|
description = "HCL formatter to use";
|
||||||
};
|
};
|
||||||
|
|
@ -97,18 +109,21 @@ in {
|
||||||
}
|
}
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
|
||||||
(mkIf cfg.treesitter.enable {
|
(mkIf cfg.treesitter.enable {
|
||||||
vim.treesitter.enable = true;
|
vim.treesitter.enable = true;
|
||||||
vim.treesitter.grammars = [cfg.treesitter.package];
|
vim.treesitter.grammars = [cfg.treesitter.package];
|
||||||
})
|
})
|
||||||
|
|
||||||
(mkIf cfg.lsp.enable {
|
(mkIf cfg.lsp.enable {
|
||||||
vim.lsp.servers =
|
vim = {
|
||||||
mapListToAttrs (n: {
|
lsp.servers =
|
||||||
name = n;
|
mapListToAttrs (n: {
|
||||||
value = servers.${n};
|
name = n;
|
||||||
})
|
value = servers.${n};
|
||||||
cfg.lsp.servers;
|
})
|
||||||
|
cfg.lsp.servers;
|
||||||
|
};
|
||||||
})
|
})
|
||||||
|
|
||||||
(mkIf cfg.format.enable {
|
(mkIf cfg.format.enable {
|
||||||
|
|
|
||||||
|
|
@ -9,23 +9,43 @@
|
||||||
inherit (lib.modules) mkIf mkMerge;
|
inherit (lib.modules) mkIf mkMerge;
|
||||||
inherit (lib.meta) getExe;
|
inherit (lib.meta) getExe;
|
||||||
inherit (lib.types) enum listOf;
|
inherit (lib.types) enum listOf;
|
||||||
inherit (lib.nvim.types) mkGrammarOption;
|
inherit (lib.nvim.types) mkGrammarOption deprecatedSingleOrListOf;
|
||||||
inherit (lib.nvim.attrsets) mapListToAttrs;
|
inherit (lib.nvim.attrsets) mapListToAttrs;
|
||||||
|
|
||||||
cfg = config.vim.languages.terraform;
|
cfg = config.vim.languages.terraform;
|
||||||
|
|
||||||
defaultServers = ["terraformls"];
|
defaultServers = ["tofuls-tf"];
|
||||||
servers = {
|
servers = {
|
||||||
terraformls = {
|
terraformls-tf = {
|
||||||
enable = true;
|
enable = true;
|
||||||
cmd = [(getExe pkgs.terraform-ls) "serve"];
|
cmd = [(getExe pkgs.terraform-ls) "serve"];
|
||||||
filetypes = ["terraform" "terraform-vars"];
|
filetypes = ["terraform" "terraform-vars" "tf"];
|
||||||
root_markers = [".terraform" ".git"];
|
root_markers = [".terraform" ".git"];
|
||||||
};
|
};
|
||||||
|
tofuls-tf = {
|
||||||
|
enable = true;
|
||||||
|
cmd = [(getExe pkgs.tofu-ls) "serve"];
|
||||||
|
filetypes = ["terraform" "terraform-vars" "tf"];
|
||||||
|
root_markers = [".terraform" ".git"];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
defaultFormat = ["tofu-fmt"];
|
||||||
|
formats = {
|
||||||
|
tofu-fmt = {
|
||||||
|
command = "${getExe pkgs.opentofu}";
|
||||||
|
args = ["fmt" "$FILENAME"];
|
||||||
|
stdin = false;
|
||||||
|
};
|
||||||
|
terraform-fmt = {
|
||||||
|
command = "${getExe pkgs.terraform}";
|
||||||
|
args = ["fmt" "$FILENAME"];
|
||||||
|
stdin = false;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
in {
|
in {
|
||||||
options.vim.languages.terraform = {
|
options.vim.languages.terraform = {
|
||||||
enable = mkEnableOption "Terraform/HCL support";
|
enable = mkEnableOption "Terraform support";
|
||||||
|
|
||||||
treesitter = {
|
treesitter = {
|
||||||
enable =
|
enable =
|
||||||
|
|
@ -44,14 +64,28 @@ in {
|
||||||
default = config.vim.lsp.enable;
|
default = config.vim.lsp.enable;
|
||||||
defaultText = literalExpression "config.vim.lsp.enable";
|
defaultText = literalExpression "config.vim.lsp.enable";
|
||||||
};
|
};
|
||||||
|
|
||||||
servers = mkOption {
|
servers = mkOption {
|
||||||
type = listOf (enum (attrNames servers));
|
type = listOf (enum (attrNames servers));
|
||||||
default = defaultServers;
|
default = defaultServers;
|
||||||
description = "Terraform LSP server to use";
|
description = "Terraform LSP server to use";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
format = {
|
||||||
|
enable =
|
||||||
|
mkEnableOption "Enable Terraform formatting"
|
||||||
|
// {
|
||||||
|
default = config.vim.languages.enableFormat;
|
||||||
|
defaultText = literalExpression "config.vim.languages.enableFormat";
|
||||||
|
};
|
||||||
|
type = mkOption {
|
||||||
|
type = listOf (enum (attrNames formats));
|
||||||
|
default = defaultFormat;
|
||||||
|
description = "Terraform formatter to use";
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable (mkMerge [
|
config = mkIf cfg.enable (mkMerge [
|
||||||
(mkIf cfg.treesitter.enable {
|
(mkIf cfg.treesitter.enable {
|
||||||
vim.treesitter.enable = true;
|
vim.treesitter.enable = true;
|
||||||
|
|
@ -59,12 +93,29 @@ in {
|
||||||
})
|
})
|
||||||
|
|
||||||
(mkIf cfg.lsp.enable {
|
(mkIf cfg.lsp.enable {
|
||||||
vim.lsp.servers =
|
vim = {
|
||||||
mapListToAttrs (n: {
|
lsp.servers =
|
||||||
name = n;
|
mapListToAttrs (n: {
|
||||||
value = servers.${n};
|
name = n;
|
||||||
})
|
value = servers.${n};
|
||||||
cfg.lsp.servers;
|
})
|
||||||
|
cfg.lsp.servers;
|
||||||
|
};
|
||||||
|
})
|
||||||
|
|
||||||
|
(mkIf cfg.format.enable {
|
||||||
|
vim.formatter.conform-nvim = {
|
||||||
|
enable = true;
|
||||||
|
setupOpts = {
|
||||||
|
formatters_by_ft.terraform = cfg.format.type;
|
||||||
|
formatters =
|
||||||
|
mapListToAttrs (name: {
|
||||||
|
inherit name;
|
||||||
|
value = formats.${name};
|
||||||
|
})
|
||||||
|
cfg.format.type;
|
||||||
|
};
|
||||||
|
};
|
||||||
})
|
})
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -54,10 +54,6 @@ in {
|
||||||
callback = function()
|
callback = function()
|
||||||
vim.wo[0][0].foldmethod = "expr"
|
vim.wo[0][0].foldmethod = "expr"
|
||||||
vim.wo[0][0].foldexpr = "v:lua.vim.treesitter.foldexpr()"
|
vim.wo[0][0].foldexpr = "v:lua.vim.treesitter.foldexpr()"
|
||||||
-- This is optional, but is set rather as a sane default.
|
|
||||||
-- If unset, opened files will be folded by automatically as
|
|
||||||
-- the files are opened
|
|
||||||
vim.o.foldenable = false
|
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
''}
|
''}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue