mirror of
https://github.com/NotAShelf/nvf.git
synced 2024-11-26 15:06:45 +00:00
Compare commits
6 commits
38d586994a
...
5952e60f0f
Author | SHA1 | Date | |
---|---|---|---|
|
5952e60f0f | ||
c757d28ff7 | |||
|
e949a51c55 | ||
|
473ebea4cf | ||
|
fc2e5998e7 | ||
|
25fe1c4625 |
6 changed files with 2107 additions and 2022 deletions
35
flake.lock
35
flake.lock
|
@ -69,11 +69,11 @@
|
|||
},
|
||||
"mnw": {
|
||||
"locked": {
|
||||
"lastModified": 1722191188,
|
||||
"narHash": "sha256-YF//iMALbrd2Ni9aju7w8NniH16Qz6RFTRD6md5UkDc=",
|
||||
"lastModified": 1724456641,
|
||||
"narHash": "sha256-SMgnviF6ofBPbyV3+rljPGcX0Hn9HBOhgXE10Cyjaic=",
|
||||
"owner": "Gerg-L",
|
||||
"repo": "mnw",
|
||||
"rev": "c7b289f3f5a31b6e744be37d83fc231816621231",
|
||||
"rev": "c261925dbbf02f523af0e8add844df64fddf0359",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -84,7 +84,10 @@
|
|||
},
|
||||
"naersk": {
|
||||
"inputs": {
|
||||
"nixpkgs": ["rnix-lsp", "nixpkgs"]
|
||||
"nixpkgs": [
|
||||
"rnix-lsp",
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1655042882,
|
||||
|
@ -102,8 +105,12 @@
|
|||
},
|
||||
"nil": {
|
||||
"inputs": {
|
||||
"flake-utils": ["flake-utils"],
|
||||
"nixpkgs": ["nixpkgs"],
|
||||
"flake-utils": [
|
||||
"flake-utils"
|
||||
],
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
],
|
||||
"rust-overlay": "rust-overlay"
|
||||
},
|
||||
"locked": {
|
||||
|
@ -122,11 +129,11 @@
|
|||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1722141560,
|
||||
"narHash": "sha256-Ul3rIdesWaiW56PS/Ak3UlJdkwBrD4UcagCmXZR9Z7Y=",
|
||||
"lastModified": 1724395761,
|
||||
"narHash": "sha256-zRkDV/nbrnp3Y8oCADf5ETl1sDrdmAW6/bBVJ8EbIdQ=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "038fb464fcfa79b4f08131b07f2d8c9a6bcc4160",
|
||||
"rev": "ae815cee91b417be55d43781eb4b73ae1ecc396c",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -1932,8 +1939,14 @@
|
|||
},
|
||||
"rust-overlay": {
|
||||
"inputs": {
|
||||
"flake-utils": ["nil", "flake-utils"],
|
||||
"nixpkgs": ["nil", "nixpkgs"]
|
||||
"flake-utils": [
|
||||
"nil",
|
||||
"flake-utils"
|
||||
],
|
||||
"nixpkgs": [
|
||||
"nil",
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1714529851,
|
||||
|
|
|
@ -57,7 +57,7 @@
|
|||
dapConfig = ''
|
||||
dap.adapters.lldb = {
|
||||
type = 'executable',
|
||||
command = '${cfg.dap.package}/bin/lldb-vscode',
|
||||
command = '${cfg.dap.package}/bin/lldb-dap',
|
||||
name = 'lldb'
|
||||
}
|
||||
dap.configurations.cpp = {
|
||||
|
|
|
@ -8,6 +8,7 @@ in {
|
|||
./css.nix
|
||||
./elixir.nix
|
||||
./go.nix
|
||||
./hcl.nix
|
||||
./html.nix
|
||||
./java.nix
|
||||
./lua.nix
|
||||
|
|
71
modules/plugins/languages/hcl.nix
Normal file
71
modules/plugins/languages/hcl.nix
Normal file
|
@ -0,0 +1,71 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.options) mkEnableOption mkOption;
|
||||
inherit (lib.modules) mkIf mkMerge;
|
||||
inherit (lib.types) package;
|
||||
inherit (lib.nvim.types) mkGrammarOption;
|
||||
|
||||
cfg = config.vim.languages.hcl;
|
||||
in {
|
||||
options.vim.languages.hcl = {
|
||||
enable = mkEnableOption "HCL support";
|
||||
|
||||
treesitter = {
|
||||
enable = mkEnableOption "HCL treesitter" // {default = config.vim.languages.enableTreesitter;};
|
||||
package = mkGrammarOption pkgs "hcl";
|
||||
};
|
||||
|
||||
lsp = {
|
||||
enable = mkEnableOption "HCL LSP support (terraform-ls)" // {default = config.vim.languages.enableLSP;};
|
||||
# TODO: it would be cooler to use vscode-extensions.hashicorp.hcl probably, shouldn't be too hard
|
||||
# TODO: formatter, suppied by above or ...
|
||||
# FIXME: or should we somehow integrate this:
|
||||
#` https://git.mzte.de/nvim-plugins/null-ls.nvim/commit/e1fb7e2b2e4400835e23b9603a19813be119852b ??
|
||||
package = mkOption {
|
||||
description = "HCL ls package (terraform-ls)";
|
||||
type = package;
|
||||
default = pkgs.terraform-ls;
|
||||
};
|
||||
};
|
||||
};
|
||||
config = mkIf cfg.enable (mkMerge [
|
||||
{
|
||||
vim.pluginRC.hcl = ''
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
pattern = "hcl",
|
||||
callback = function(opts)
|
||||
local bo = vim.bo[opts.buf]
|
||||
bo.tabstop = 2
|
||||
bo.shiftwidth = 2
|
||||
bo.softtabstop = 2
|
||||
end
|
||||
})
|
||||
|
||||
local ft = require('Comment.ft')
|
||||
ft
|
||||
.set('hcl', '#%s')
|
||||
'';
|
||||
}
|
||||
(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 = lib.optionalAttrs (! config.vim.languages.terraform.lsp.enable) {
|
||||
terraform-ls = ''
|
||||
lspconfig.terraformls.setup {
|
||||
capabilities = capabilities,
|
||||
on_attach=default_on_attach,
|
||||
cmd = {"${cfg.lsp.package}/bin/terraform-ls", "serve"},
|
||||
}
|
||||
'';
|
||||
};
|
||||
})
|
||||
]);
|
||||
}
|
|
@ -173,7 +173,7 @@ in {
|
|||
dap = {
|
||||
adapter = {
|
||||
type = "executable",
|
||||
command = "${cfg.dap.package}/bin/lldb-vscode",
|
||||
command = "${cfg.dap.package}/bin/lldb-dap",
|
||||
name = "rustacean_lldb",
|
||||
},
|
||||
},
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
inherit (lib.trivial) boolToString warnIf;
|
||||
in {
|
||||
onedark = {
|
||||
setup = {style ? "dark"}: ''
|
||||
setup = {style ? "dark", ...}: ''
|
||||
-- OneDark theme
|
||||
require('onedark').setup {
|
||||
style = "${style}"
|
||||
|
@ -30,7 +30,7 @@ in {
|
|||
};
|
||||
|
||||
dracula = {
|
||||
setup = {transparent}: ''
|
||||
setup = {transparent, ...}: ''
|
||||
require('dracula').setup({
|
||||
transparent_bg = ${boolToString transparent},
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue