mirror of
https://github.com/NotAShelf/nvf.git
synced 2024-11-01 19:11:15 +00:00
Compare commits
1 commit
68377e8db1
...
235a130cd9
Author | SHA1 | Date | |
---|---|---|---|
|
235a130cd9 |
2 changed files with 24 additions and 6 deletions
|
@ -196,3 +196,7 @@ everyone.
|
||||||
[Soliprem](https://github.com/Soliprem)
|
[Soliprem](https://github.com/Soliprem)
|
||||||
|
|
||||||
- Add LSP and Treesitter support for R under `vim.languages.R`.
|
- Add LSP and Treesitter support for R under `vim.languages.R`.
|
||||||
|
|
||||||
|
[nezia1](https://github.com/nezia1):
|
||||||
|
|
||||||
|
- Replace [nixpkgs-fmt](https://github.com/nix-community/nixpkgs-fmt) with [nixfmt](https://github.com/NixOS/nixfmt) (nixfmt-rfc-style).
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (builtins) attrNames;
|
inherit (builtins) attrNames;
|
||||||
|
inherit (lib) concatStringsSep;
|
||||||
inherit (lib.options) mkEnableOption mkOption;
|
inherit (lib.options) mkEnableOption mkOption;
|
||||||
inherit (lib.modules) mkIf mkMerge;
|
inherit (lib.modules) mkIf mkMerge;
|
||||||
inherit (lib.lists) isList;
|
inherit (lib.lists) isList;
|
||||||
|
@ -62,10 +63,10 @@
|
||||||
command = {"${cfg.format.package}/bin/alejandra", "--quiet"},
|
command = {"${cfg.format.package}/bin/alejandra", "--quiet"},
|
||||||
},
|
},
|
||||||
''}
|
''}
|
||||||
${optionalString (cfg.format.type == "nixpkgs-fmt")
|
${optionalString (cfg.format.type == "nixfmt")
|
||||||
''
|
''
|
||||||
formatting = {
|
formatting = {
|
||||||
command = {"${cfg.format.package}/bin/nixpkgs-fmt"},
|
command = {"${cfg.format.package}/bin/nixfmt"},
|
||||||
},
|
},
|
||||||
''}
|
''}
|
||||||
},
|
},
|
||||||
|
@ -90,9 +91,16 @@
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
nixpkgs-fmt = {
|
nixfmt = {
|
||||||
package = pkgs.nixpkgs-fmt;
|
package = pkgs.nixfmt-rfc-style;
|
||||||
# Never need to use null-ls for nixpkgs-fmt
|
nullConfig = ''
|
||||||
|
table.insert(
|
||||||
|
ls_sources,
|
||||||
|
null_ls.builtins.formatting.nixfmt.with({
|
||||||
|
command = "${cfg.format.package}/bin/nixfmt"
|
||||||
|
})
|
||||||
|
)
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -152,7 +160,7 @@ in {
|
||||||
|
|
||||||
type = mkOption {
|
type = mkOption {
|
||||||
description = "Nix formatter to use";
|
description = "Nix formatter to use";
|
||||||
type = enum (attrNames formats);
|
type = enum (attrNames formats ++ ["nixpkgs-fmt"]); # temporary, so it can be asserted against
|
||||||
default = defaultFormat;
|
default = defaultFormat;
|
||||||
};
|
};
|
||||||
package = mkOption {
|
package = mkOption {
|
||||||
|
@ -175,6 +183,12 @@ in {
|
||||||
|
|
||||||
config = mkIf cfg.enable (mkMerge [
|
config = mkIf cfg.enable (mkMerge [
|
||||||
{
|
{
|
||||||
|
assertions = [
|
||||||
|
{
|
||||||
|
assertion = cfg.format.type != "nixpkgs-fmt";
|
||||||
|
message = "nixpkgs-fmt has been archived and replaced with nixfmt. Please use one of the following instead: ${concatStringsSep ", " (attrNames formats)}";
|
||||||
|
}
|
||||||
|
];
|
||||||
vim.pluginRC.nix = ''
|
vim.pluginRC.nix = ''
|
||||||
vim.api.nvim_create_autocmd("FileType", {
|
vim.api.nvim_create_autocmd("FileType", {
|
||||||
pattern = "nix",
|
pattern = "nix",
|
||||||
|
|
Loading…
Reference in a new issue