Compare commits
13 Commits
dc2f8221e3
...
48bc045cfa
Author | SHA1 | Date |
---|---|---|
raf | 48bc045cfa | |
raf | 7b719d0044 | |
NotAShelf | ba803c8684 | |
NotAShelf | f00ecd4eb9 | |
raf | 35c7327f81 | |
diniamo | 8a0cddd9bb | |
raf | 923481640e | |
diniamo | d6cd853520 | |
NotAShelf | 2bfedb14dc | |
NotAShelf | aa62e904d6 | |
NotAShelf | c3c76afda4 | |
NotAShelf | 198a36f3d4 | |
NotAShelf | 3aa02e8524 |
|
@ -2,6 +2,7 @@
|
|||
result
|
||||
result/
|
||||
.direnv
|
||||
.nixos-test-history
|
||||
|
||||
# Ignore files generated by common IDEs
|
||||
.vscode/*
|
||||
|
|
|
@ -15,15 +15,27 @@ Release notes for release 0.7
|
|||
[](#opt-vim.visuals.fidget-nvim.setupOpts.progress.display.overrides) from
|
||||
`anything` to a `submodule` for better type checking.
|
||||
- Fix null `vim.lsp.mappings` generating an error and not being filtered out.
|
||||
- Add basic transparency support for `oxocarbon` theme by setting the
|
||||
highlight group for `Normal`, `NormalFloat`, `LineNr`, `SignColumn` and
|
||||
optionally `NvimTreeNormal` to `none`.
|
||||
- Add basic transparency support for `oxocarbon` theme by setting the highlight
|
||||
group for `Normal`, `NormalFloat`, `LineNr`, `SignColumn` and optionally
|
||||
`NvimTreeNormal` to `none`.
|
||||
|
||||
[horriblename](https://github.com/horriblename):
|
||||
|
||||
- Fix broken treesitter-context keybinds in visual mode
|
||||
- Depcrecate use of `__empty` to define empty tables in lua. Empty attrset are
|
||||
no longer filtered and thus should be used instead.
|
||||
- Deprecate use of `__empty` to define empty tables in lua. Empty attrset are no
|
||||
longer filtered and thus should be used instead.
|
||||
|
||||
[jacekpoz](https://github.com/jacekpoz):
|
||||
|
||||
- Add [ocaml-lsp](https://github.com/ocaml/ocaml-lsp) support.
|
||||
|
||||
- Fix Emac typo
|
||||
|
||||
[diniamo](https://github.com/diniamo):
|
||||
|
||||
- Move the `theme` dag entry to before `luaScript`.
|
||||
|
||||
- Add rustfmt as the default formatter for Rust
|
||||
|
||||
[NotAShelf](https://github.com/notashelf)
|
||||
|
||||
|
@ -39,13 +51,12 @@ Release notes for release 0.7
|
|||
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
|
||||
- Remove vim-tidal and friends.
|
||||
|
||||
- Clean up Lualine module to reduce theme dependency on Catppuccin, and fixed
|
||||
blending issues in component separators.
|
||||
|
||||
[jacekpoz](https://github.com/jacekpoz):
|
||||
|
||||
- Add [ocaml-lsp](https://github.com/ocaml/ocaml-lsp) support.
|
||||
|
||||
- Fix Emac typo
|
||||
- Add
|
||||
[ts-error-translator.nvim](https://github.com/dmmulroy/ts-error-translator.nvim)
|
||||
extension of the TS language module, under
|
||||
`vim.languages.ts.extensions.ts-error-translator`
|
||||
|
|
38
flake.lock
38
flake.lock
|
@ -67,6 +67,26 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"home-manager": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1714981474,
|
||||
"narHash": "sha256-b3/U21CJjCjJKmA9WqUbZGZgCvospO3ArOUTgJugkOY=",
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"rev": "6ebe7be2e67be7b9b54d61ce5704f6fb466c536f",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"naersk": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
|
@ -1597,6 +1617,22 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"plugin-ts-error-translator": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1712269172,
|
||||
"narHash": "sha256-NJ0qfKvkwZ/0GolAeATlQLyQ7nGN6Z6q3uRqI+73wPk=",
|
||||
"owner": "dmmulroy",
|
||||
"repo": "ts-error-translator.nvim",
|
||||
"rev": "11ae55b28bde02663b5f983f59b0e3fd9c4e845b",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "dmmulroy",
|
||||
"repo": "ts-error-translator.nvim",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"plugin-vim-dirtytalk": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
|
@ -1749,6 +1785,7 @@
|
|||
"inputs": {
|
||||
"flake-parts": "flake-parts",
|
||||
"flake-utils": "flake-utils",
|
||||
"home-manager": "home-manager",
|
||||
"nil": "nil",
|
||||
"nixpkgs": "nixpkgs",
|
||||
"nmd": "nmd",
|
||||
|
@ -1840,6 +1877,7 @@
|
|||
"plugin-toggleterm-nvim": "plugin-toggleterm-nvim",
|
||||
"plugin-tokyonight": "plugin-tokyonight",
|
||||
"plugin-trouble": "plugin-trouble",
|
||||
"plugin-ts-error-translator": "plugin-ts-error-translator",
|
||||
"plugin-vim-dirtytalk": "plugin-vim-dirtytalk",
|
||||
"plugin-vim-fugitive": "plugin-vim-fugitive",
|
||||
"plugin-vim-illuminate": "plugin-vim-illuminate",
|
||||
|
|
13
flake.nix
13
flake.nix
|
@ -14,6 +14,8 @@
|
|||
imports = [
|
||||
# add lib to module args
|
||||
{_module.args = {inherit (nixpkgs) lib;};}
|
||||
|
||||
./flake/tests # machine tests for nvf
|
||||
./flake/apps.nix
|
||||
./flake/legacyPackages.nix
|
||||
./flake/overlays.nix
|
||||
|
@ -88,6 +90,12 @@
|
|||
flake = false;
|
||||
};
|
||||
|
||||
# Primarily used for testing nvf.
|
||||
home-manager = {
|
||||
url = "github:nix-community/home-manager";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
# TODO: get zig from the zig overlay instead of nixpkgs
|
||||
zig.url = "github:mitchellh/zig-overlay";
|
||||
|
||||
|
@ -183,6 +191,11 @@
|
|||
flake = false;
|
||||
};
|
||||
|
||||
plugin-ts-error-translator = {
|
||||
url = "github:dmmulroy/ts-error-translator.nvim";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
# Copying/Registers
|
||||
plugin-registers = {
|
||||
url = "github:tversteeg/registers.nvim";
|
||||
|
|
|
@ -0,0 +1,33 @@
|
|||
{
|
||||
inputs,
|
||||
nixosTest,
|
||||
homeManagerModules,
|
||||
testProfile,
|
||||
...
|
||||
}:
|
||||
nixosTest {
|
||||
name = "home-manager-test";
|
||||
skipLint = true;
|
||||
|
||||
nodes.machine = {
|
||||
imports = [
|
||||
testProfile
|
||||
inputs.home-manager.nixosModules.home-manager
|
||||
];
|
||||
|
||||
config = {
|
||||
home-manager = {
|
||||
sharedModules = [
|
||||
homeManagerModules.nvf
|
||||
];
|
||||
|
||||
users.test = {
|
||||
home.stateVersion = "24.05";
|
||||
programs.nvf.enable = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
testScript = "";
|
||||
}
|
|
@ -0,0 +1,56 @@
|
|||
{
|
||||
nixosTest,
|
||||
nixosModules,
|
||||
testProfile,
|
||||
...
|
||||
}:
|
||||
nixosTest {
|
||||
name = "nixos-test";
|
||||
|
||||
nodes.machine = {
|
||||
imports = [
|
||||
testProfile
|
||||
nixosModules.nvf
|
||||
];
|
||||
|
||||
config = {
|
||||
programs.nvf.enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
testScript = ''
|
||||
import subprocess
|
||||
machine.wait_for_unit("default.target")
|
||||
|
||||
def check_errs(process):
|
||||
# Check for errors
|
||||
print("Connecting to Neovim process")
|
||||
|
||||
# Capture stdout and stderr
|
||||
stdout, stderr = process.communicate()
|
||||
|
||||
# Print captured stdout and stderr
|
||||
if stdout:
|
||||
print("Captured stdout:")
|
||||
print(stdout.decode('utf-8'))
|
||||
if stderr:
|
||||
print("Captured stderr:")
|
||||
print(stderr.decode('utf-8'))
|
||||
|
||||
def run_neovim_headless():
|
||||
print("Running Neovim in headless mode.")
|
||||
|
||||
# Run Neovim in headless mode
|
||||
nvim_process = subprocess.Popen(['nvim', '--headless'], stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||
|
||||
check_errs(nvim_process)
|
||||
|
||||
# Load configuration file
|
||||
nvim_process.stdin.write(b':NonExistentCommand\n')
|
||||
nvim_process.stdin.flush()
|
||||
|
||||
# run Neovim in headless mode
|
||||
# and expect it to return sucessfully
|
||||
machine.succeed(run_neovim_headless())
|
||||
'';
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
{
|
||||
inputs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
perSystem = {
|
||||
pkgs,
|
||||
self',
|
||||
...
|
||||
}: let
|
||||
inherit (lib.filesystem) packagesFromDirectoryRecursive;
|
||||
inherit (lib.customisation) callPackageWith;
|
||||
inherit (lib.attrsets) recursiveUpdate;
|
||||
|
||||
defaultInherits = {
|
||||
inherit (config.flake) homeManagerModules nixosModules;
|
||||
inherit inputs;
|
||||
testProfile = ./profiles/minimal.nix;
|
||||
};
|
||||
|
||||
callPackage = callPackageWith (recursiveUpdate pkgs defaultInherits);
|
||||
in {
|
||||
checks = packagesFromDirectoryRecursive {
|
||||
inherit callPackage;
|
||||
directory = ./checks;
|
||||
};
|
||||
|
||||
# expose checks as packages to be built
|
||||
packages = {
|
||||
test-home-manager-module = self'.checks.homeManagerModule.driverInteractive;
|
||||
test-nixos-module = self'.checks.nixosModule.driverInteractive;
|
||||
};
|
||||
};
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
# he's a thicc boi
|
||||
virtualisation = {
|
||||
cores = 2;
|
||||
memorySize = 2048;
|
||||
qemu.options = ["-vga none -enable-kvm -device virtio-gpu-pci,xres=720,yres=1440"];
|
||||
};
|
||||
|
||||
users.users.test = {
|
||||
isNormalUser = true;
|
||||
password = "";
|
||||
};
|
||||
}
|
|
@ -4,17 +4,33 @@
|
|||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (builtins) attrNames;
|
||||
inherit (lib.modules) mkIf mkMerge;
|
||||
inherit (lib.options) mkOption mkEnableOption;
|
||||
inherit (lib.strings) optionalString;
|
||||
inherit (lib.trivial) boolToString;
|
||||
inherit (lib.lists) isList optionals;
|
||||
inherit (lib.types) bool package str listOf either;
|
||||
inherit (lib.types) bool package str listOf either enum;
|
||||
inherit (lib.nvim.types) mkGrammarOption;
|
||||
inherit (lib.nvim.lua) expToLua;
|
||||
inherit (lib.nvim.dag) entryAnywhere;
|
||||
|
||||
cfg = config.vim.languages.rust;
|
||||
|
||||
defaultFormat = "rustfmt";
|
||||
formats = {
|
||||
rustfmt = {
|
||||
package = pkgs.rustfmt;
|
||||
nullConfig = ''
|
||||
table.insert(
|
||||
ls_sources,
|
||||
null_ls.builtins.formatting.rustfmt.with({
|
||||
command = "${cfg.format.package}/bin/rustfmt",
|
||||
})
|
||||
)
|
||||
'';
|
||||
};
|
||||
};
|
||||
in {
|
||||
options.vim.languages.rust = {
|
||||
enable = mkEnableOption "Rust language support";
|
||||
|
@ -49,6 +65,22 @@ in {
|
|||
};
|
||||
};
|
||||
|
||||
format = {
|
||||
enable = mkEnableOption "Rust formatting" // {default = config.vim.languages.enableFormat;};
|
||||
|
||||
type = mkOption {
|
||||
description = "Rust formatter to use";
|
||||
type = enum (attrNames formats);
|
||||
default = defaultFormat;
|
||||
};
|
||||
|
||||
package = mkOption {
|
||||
description = "Rust formatter package";
|
||||
type = package;
|
||||
default = formats.${cfg.format.type}.package;
|
||||
};
|
||||
};
|
||||
|
||||
dap = {
|
||||
enable = mkOption {
|
||||
description = "Rust Debug Adapter support";
|
||||
|
@ -86,6 +118,11 @@ in {
|
|||
vim.treesitter.grammars = [cfg.treesitter.package];
|
||||
})
|
||||
|
||||
(mkIf cfg.format.enable {
|
||||
vim.lsp.null-ls.enable = true;
|
||||
vim.lsp.null-ls.sources.rust-format = formats.${cfg.format.type}.nullConfig;
|
||||
})
|
||||
|
||||
(mkIf (cfg.lsp.enable || cfg.dap.enable) {
|
||||
vim = {
|
||||
startPlugins = ["rust-tools"] ++ optionals cfg.dap.enable [cfg.dap.package];
|
||||
|
|
|
@ -9,10 +9,11 @@
|
|||
inherit (lib.modules) mkIf mkMerge;
|
||||
inherit (lib.lists) isList;
|
||||
inherit (lib.meta) getExe;
|
||||
inherit (lib.types) enum either listOf package str;
|
||||
inherit (lib.nvim.lua) expToLua;
|
||||
inherit (lib.nvim.types) mkGrammarOption diagnostics;
|
||||
inherit (lib.types) enum either listOf package str bool;
|
||||
inherit (lib.nvim.lua) expToLua toLuaObject;
|
||||
inherit (lib.nvim.types) mkGrammarOption diagnostics mkPluginSetupOption;
|
||||
inherit (lib.nvim.languages) diagnosticsToLua;
|
||||
inherit (lib.nvim.dag) entryAnywhere;
|
||||
|
||||
cfg = config.vim.languages.ts;
|
||||
|
||||
|
@ -32,6 +33,7 @@
|
|||
}
|
||||
'';
|
||||
};
|
||||
|
||||
denols = {
|
||||
package = pkgs.deno;
|
||||
lspConfig = ''
|
||||
|
@ -143,6 +145,24 @@ in {
|
|||
inherit defaultDiagnosticsProvider;
|
||||
};
|
||||
};
|
||||
|
||||
extensions = {
|
||||
ts-error-translator = {
|
||||
enable = mkEnableOption ''
|
||||
Typescript error translation with
|
||||
[ts-error-translator.nvim](github.com/dmmulroy/ts-error-translator.nvim)
|
||||
'';
|
||||
|
||||
setupOpts = mkPluginSetupOption "ts-error-translator" {
|
||||
# This is the default configuration behaviour.
|
||||
auto_override_publish_diagnostics = mkOption {
|
||||
description = "Automatically override the publish_diagnostics handler";
|
||||
type = bool;
|
||||
default = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable (mkMerge [
|
||||
|
@ -169,5 +189,12 @@ in {
|
|||
inherit diagnosticsProviders;
|
||||
};
|
||||
})
|
||||
|
||||
(mkIf cfg.extensions."ts-error-translator".enable {
|
||||
vim.startPlugins = ["ts-error-translator"];
|
||||
vim.luaConfigRC.ts-error-translator = entryAnywhere ''
|
||||
require("ts-error-translator").setup(${toLuaObject cfg.extensions.ts-error-translator.setupOpts})
|
||||
'';
|
||||
})
|
||||
]);
|
||||
}
|
||||
|
|
|
@ -45,10 +45,12 @@ in {
|
|||
config = mkIf cfg.enable {
|
||||
vim = {
|
||||
startPlugins = [cfg.name];
|
||||
luaConfigRC = {
|
||||
themeSetup = entryBefore ["theme"] cfg.extraConfig;
|
||||
theme = supported_themes.${cfg.name}.setup (with cfg; {inherit style transparent;});
|
||||
};
|
||||
configRC.theme = entryBefore ["luaScript"] ''
|
||||
lua << EOF
|
||||
${cfg.extraConfig}
|
||||
${supported_themes.${cfg.name}.setup (with cfg; {inherit style transparent;})}
|
||||
EOF
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue