Merge branch 'main' into lib

This commit is contained in:
Pedro Alves 2023-01-24 01:27:39 +00:00
commit 8748b953c3
58 changed files with 2871 additions and 419 deletions

View file

@ -35,14 +35,53 @@
(system: (system:
let let
pkgs = import nixpkgs { inherit system; }; pkgs = import nixpkgs { inherit system; };
extractRustAnalyzer = { stdenv, pkgs }: stdenv.mkDerivation {
pname = "extract_rust_analyzer";
version = "master";
dontUnpack = true;
dontBuild = true;
buildInputs = [ pkgs.python3 ];
installPhase = ''
ls -la
mkdir -p $out/bin
cp ${./helpers/extract_rust_analyzer.py} $out/bin/extract_rust_analyzer.py
'';
};
extractRustAnalyzerPkg = pkgs.callPackage extractRustAnalyzer { };
in in
{ {
packages.docs = pkgs.callPackage (import ./docs.nix) { packages = {
modules = nixvimModules; docs = pkgs.callPackage (import ./docs.nix) {
modules = nixvimModules;
};
runUpdates = pkgs.callPackage
({ pkgs, stdenv }: stdenv.mkDerivation {
pname = "run-updates";
version = pkgs.rust-analyzer.version;
src = pkgs.rust-analyzer.src;
nativeBuildInputs = with pkgs; [extractRustAnalyzerPkg alejandra nixpkgs-fmt];
buildPhase = ''
extract_rust_analyzer.py editors/code/package.json |
alejandra --quiet |
nixpkgs-fmt > rust-analyzer-config.nix
'';
installPhase = ''
mkdir -p $out/share
cp rust-analyzer-config.nix $out/share
'';
})
{ };
}; };
legacyPackages = rec { legacyPackages = rec {
makeNixvimWithModule = import ./wrappers/standalone.nix pkgs modules; makeNixvimWithModule = import ./wrappers/standalone.nix pkgs modules;
makeNixvim = configuration: makeNixvimWithModule { makeNixvim = configuration: makeNixvimWithModule {
module = { module = {
config = configuration; config = configuration;
}; };

229
helpers/extract_rust_analyzer.py Executable file
View file

@ -0,0 +1,229 @@
#!/usr/bin/env python3
import sys
import json
ra_package_json = sys.argv[1]
with open(ra_package_json) as f:
ra_package = json.load(f)
config = ra_package["contributes"]["configuration"]["properties"]
config_dict = {}
in_common_block = False
def py_to_nix(obj):
if obj is None:
return "null"
if obj is False:
return "false"
if obj is True:
return "true"
if isinstance(obj, str):
s = f'"{obj}"'
if "${" in s:
s = s.replace("${", "$\\{")
return s
if isinstance(obj, int):
return f"{obj}"
if isinstance(obj, dict):
val = "{"
for key in obj:
key_val = py_to_nix(obj[key])
val += f'"{key}" = {key_val};\n'
val += "}"
return val
if isinstance(obj, list):
return "[" + " ".join(py_to_nix(val) for val in obj) + "]"
print(f"Unhandled value: {obj}")
sys.exit(1)
def ty_to_nix(ty):
if ty == "boolean":
return "types.bool"
if ty == "string":
return "types.str"
# This is an object without any additional properties
if ty == "object":
return "types.attrsOf types.anything"
if isinstance(ty, list) and ty[0] == "null":
if len(ty) > 2:
print("Unhandled type", ty)
sys.exit()
nullable_ty = ty_to_nix(ty[1])
return f"types.nullOr ({nullable_ty})"
if isinstance(ty, list):
either_types = (ty_to_nix(t) for t in ty)
either_types = " ".join(f"({t})" for t in either_types)
return f"types.oneOf ([{either_types}])"
print(f"Unhandled type: {ty}")
sys.exit(1)
def prop_ty_to_nix(prop_info):
if "type" in prop_info:
if "enum" in prop_info:
enum = "[" + " ".join(f'"{member}"' for member in prop_info["enum"]) + "]"
if prop_info["type"] == "string":
return f"types.enum {enum}"
print("TODO: with unknown enum type", prop_info["type"])
sys.exit()
if "additionalProperties" in prop_info or "properties" in prop_info:
print("TODO: with (additional)Properties", prop_info)
sys.exit()
if "minimum" in prop_info or "maximum" in prop_info:
can_be_null = False
if "null" in prop_info["type"]:
can_be_null = True
if len(prop_info["type"]) > 2:
print("Unhandled int type", prop_info["type"])
sys.exit()
prop_info["type"] = prop_info["type"][1]
if prop_info["type"] == "number":
int_ty = "types.number"
elif prop_info["type"] == "integer":
int_ty = "types.int"
else:
print("Unhandled int type", prop_info["type"])
sys.exit()
if "minimum" in prop_info and "maximum" in prop_info:
min = prop_info["minimum"]
max = prop_info["maximum"]
int_ty = f"{int_ty}s.between {min} {max}"
elif "minimum" in prop_info:
min = prop_info["minimum"]
int_ty = f"types.addCheck {int_ty} (x: x >= {min})"
else:
print("TODO: max number", prop_info)
sys.exit()
if can_be_null:
return f"types.nullOr ({int_ty})"
else:
return int_ty
if "array" in prop_info["type"] or prop_info["type"] == "array":
if "items" not in prop_info:
print("Array without items")
sys.exit()
items_ty = prop_ty_to_nix(prop_info["items"])
array_ty = f"types.listOf ({items_ty})"
if prop_info["type"] == "array":
return array_ty
elif prop_info["type"] == ["null", "array"]:
return f"types.nullOr ({array_ty})"
else:
print("Unhandled array type", prop_info)
sys.exit()
return ty_to_nix(prop_info["type"])
elif "anyOf" in prop_info:
can_be_null = False
if {"type": "null"} in prop_info["anyOf"]:
can_be_null = True
prop_info["anyOf"].remove({"type": "null"})
types = (prop_ty_to_nix(prop) for prop in prop_info["anyOf"])
one_of = " ".join(f"({ty})" for ty in types)
one_of_ty = f"types.oneOf ([{one_of}])"
if can_be_null:
return f"types.nullOr ({one_of_ty})"
else:
return one_of_ty
else:
print("TODO: no *type*", prop_info)
sys.exit()
for opt in config:
if opt.startswith("$"):
in_common_block = True
continue
if not in_common_block:
continue
opt_path = opt.split(".")
if opt_path[0] != "rust-analyzer":
print("ERROR: expected all options to start with 'rust-analyzer'")
sys.exit(1)
path = opt_path[1:-1]
option = opt_path[-1]
top_dict = config_dict
for p in path:
if not p in top_dict:
top_dict[p] = {}
top_dict = top_dict[p]
prop_info = config[opt]
is_optional = False
ty = prop_ty_to_nix(prop_info)
default = py_to_nix(prop_info["default"])
if "markdownDescription" in prop_info:
desc = prop_info["markdownDescription"]
else:
desc = prop_info["description"]
desc += f"\n\ndefault value is: \n```nix\n {default}\n```"
top_dict[
option
] = """
mkOption {{
type = types.nullOr ({ty});
default = null;
description = ''
{desc}
'';
}}
""".format(
ty=ty, default=default, desc=desc
)
def print_dict(d):
print("{")
for key in d:
print(f'"{key}" = ')
if isinstance(d[key], str):
print(d[key])
else:
print_dict(d[key])
print(";")
print("}")
print("# THIS FILE IS AUTOGENERATED DO NOT EDIT")
print("lib: with lib;")
print_dict(config_dict)

View file

@ -14,14 +14,15 @@ rec {
else else
"{" + (concatStringsSep "," "{" + (concatStringsSep ","
(mapAttrsToList (mapAttrsToList
(n: v: if head (stringToCharacters n) == "@" then (n: v:
toLuaObject v if head (stringToCharacters n) == "@" then
else "[${toLuaObject n}] = " + (toLuaObject v)) toLuaObject v
(filterAttrs (n: v: !isNull v && toLuaObject v != "{}") args))) + "}" else "[${toLuaObject n}] = " + (toLuaObject v))
(filterAttrs (n: v: !isNull v && toLuaObject v != "{}") args))) + "}"
else if builtins.isList args then else if builtins.isList args then
"{" + concatMapStringsSep "," toLuaObject args + "}" "{" + concatMapStringsSep "," toLuaObject args + "}"
else if builtins.isString args then else if builtins.isString args then
# This should be enough! # This should be enough!
builtins.toJSON args builtins.toJSON args
else if builtins.isPath args then else if builtins.isPath args then
builtins.toJSON (toString args) builtins.toJSON (toString args)
@ -36,28 +37,34 @@ rec {
else ""; else "";
# Generates maps for a lua config # Generates maps for a lua config
genMaps = mode: maps: let genMaps = mode: maps:
normalized = builtins.mapAttrs (key: action: let
if builtins.isString action then normalized = builtins.mapAttrs
(key: action:
if builtins.isString action then
{
silent = false;
expr = false;
unique = false;
noremap = true;
script = false;
nowait = false;
action = action;
}
else action)
maps;
in
builtins.attrValues (builtins.mapAttrs
(key: action:
{ {
silent = false; action = action.action;
expr = false; config = lib.filterAttrs (_: v: v) {
unique = false; inherit (action) silent expr unique noremap script nowait;
noremap = true; };
script = false; key = key;
nowait = false; mode = mode;
action = action; })
} normalized);
else action) maps;
in builtins.attrValues (builtins.mapAttrs (key: action:
{
action = action.action;
config = lib.filterAttrs (_: v: v) {
inherit (action) silent expr unique noremap script nowait;
};
key = key;
mode = mode;
}) normalized);
# Creates an option with a nullable type that defaults to null. # Creates an option with a nullable type that defaults to null.
mkNullOrOption = type: desc: lib.mkOption { mkNullOrOption = type: desc: lib.mkOption {
@ -66,45 +73,66 @@ rec {
description = desc; description = desc;
}; };
mkPlugin = { config, lib, ... }: { defaultNullOpts = rec {
name, mkNullable = type: default: desc: mkNullOrOption type (
description, let
package ? null, defaultDesc = "default: `${default}`";
extraPlugins ? [], in
extraPackages ? [], if desc == "" then defaultDesc else ''
options ? {}, ${desc}
...
}: let
cfg = config.plugins.${name};
# TODO support nested options!
pluginOptions = mapAttrs (k: v: v.option) options;
globals = mapAttrs' (name: opt: {
name = opt.global;
value = if cfg.${name} != null then opt.value cfg.${name} else null;
}) options;
# does this evaluate package?
packageOption = if package == null then { } else {
package = mkOption {
type = types.package;
default = package;
description = "Plugin to use for ${name}";
};
};
in {
options.plugins.${name} = {
enable = mkEnableOption description;
} // packageOption // pluginOptions;
config = mkIf cfg.enable { ${defaultDesc}
inherit extraPackages globals; ''
# does this evaluate package? it would not be desired to evaluate pacakge if we use another package. );
extraPlugins = extraPlugins ++ optional (package != null) cfg.package;
}; mkInt = default: mkNullable lib.types.int (toString default);
mkBool = default: mkNullable lib.types.bool (toString default);
mkStr = default: mkNullable lib.types.str ''"${default}"'';
}; };
globalVal = val: if builtins.isBool val then mkPlugin = { config, lib, ... }: { name
(if val == false then 0 else 1) , description
else val; , package ? null
, extraPlugins ? [ ]
, extraPackages ? [ ]
, options ? { }
, ...
}:
let
cfg = config.plugins.${name};
# TODO support nested options!
pluginOptions = mapAttrs (k: v: v.option) options;
globals = mapAttrs'
(name: opt: {
name = opt.global;
value = if cfg.${name} != null then opt.value cfg.${name} else null;
})
options;
# does this evaluate package?
packageOption = if package == null then { } else {
package = mkOption {
type = types.package;
default = package;
description = "Plugin to use for ${name}";
};
};
in
{
options.plugins.${name} = {
enable = mkEnableOption description;
} // packageOption // pluginOptions;
config = mkIf cfg.enable {
inherit extraPackages globals;
# does this evaluate package? it would not be desired to evaluate pacakge if we use another package.
extraPlugins = extraPlugins ++ optional (package != null) cfg.package;
};
};
globalVal = val:
if builtins.isBool val then
(if val == false then 0 else 1)
else val;
mkDefaultOpt = { type, global, description ? null, example ? null, default ? null, value ? v: (globalVal v), ... }: { mkDefaultOpt = { type, global, description ? null, example ? null, default ? null, value ? v: (globalVal v), ... }: {
option = mkOption { option = mkOption {
@ -131,9 +159,9 @@ rec {
mkRaw = r: { __raw = r; }; mkRaw = r: { __raw = r; };
wrapDo = string: '' wrapDo = string: ''
do do
${string} ${string}
end end
''; '';
rawType = types.submodule { rawType = types.submodule {

View file

@ -15,10 +15,21 @@ with lib;
}; };
''; '';
}; };
match = mkOption {
type = types.attrsOf types.str;
default = { };
description = "Define match groups";
example = ''
match = {
ExtraWhitespace = '\\s\\+$';
};
'';
};
}; };
config = mkIf (config.highlight != { }) { config = mkIf (config.highlight != { } || config.match != { }) {
extraConfigLuaPost = '' extraConfigLuaPost = (optionalString (config.highlight != { }) ''
-- Highlight groups {{ -- Highlight groups {{
do do
local highlights = ${helpers.toLuaObject config.highlight} local highlights = ${helpers.toLuaObject config.highlight}
@ -28,6 +39,18 @@ with lib;
end end
end end
-- }} -- }}
''; '') +
(optionalString (config.match != { }) ''
-- Match groups {{
do
local match = ${helpers.toLuaObject config.match}
for k,v in pairs(match) do
vim.fn.matchadd(k, v)
end
end
-- }}
'');
}; };
} }

View file

@ -5,7 +5,7 @@ let
in in
{ {
options.plugins.barbar = { options.plugins.barbar = {
enable = mkEnableOption "Enable barbar.nvim"; enable = mkEnableOption "barbar.nvim";
package = mkOption { package = mkOption {
type = types.package; type = types.package;
@ -32,13 +32,13 @@ in
}; };
icons = mkOption { icons = mkOption {
type = with types; nullOr (oneOf [bool (enum ["numbers both"])]); type = with types; nullOr (oneOf [ bool (enum [ "numbers both" ]) ]);
default = null; default = null;
description = "Enable/disable icons"; description = "Enable/disable icons";
}; };
iconCustomColors = mkOption { iconCustomColors = mkOption {
type = with types; nullOr (oneOf [bool str]); type = with types; nullOr (oneOf [ bool str ]);
default = null; default = null;
description = "Sets the icon highlight group"; description = "Sets the icon highlight group";
}; };
@ -56,7 +56,8 @@ in
config = mkIf cfg.enable { config = mkIf cfg.enable {
extraPlugins = with pkgs.vimPlugins; [ extraPlugins = with pkgs.vimPlugins; [
cfg.package nvim-web-devicons cfg.package
nvim-web-devicons
]; ];
# maps = genMaps cfg.keys; # maps = genMaps cfg.keys;

View file

@ -33,7 +33,7 @@ in
options = { options = {
plugins.bufferline = { plugins.bufferline = {
enable = mkEnableOption "Enable bufferline"; enable = mkEnableOption "bufferline";
package = mkOption { package = mkOption {
type = types.package; type = types.package;
description = "Plugin to use for bufferline"; description = "Plugin to use for bufferline";
@ -67,7 +67,7 @@ in
# is deprecated, but might still work # is deprecated, but might still work
indicatorIcon = mkOption { indicatorIcon = mkOption {
type = types.nullOr types.str; type = types.nullOr types.str;
description = "The Icon shown as a indicator for buffer. Changing it is NOT recommended, description = "The Icon shown as a indicator for buffer. Changing it is NOT recommended,
this is intended to be an escape hatch for people who cannot bear it for whatever reason."; this is intended to be an escape hatch for people who cannot bear it for whatever reason.";
default = null; default = null;
}; };

View file

@ -7,7 +7,7 @@ in
{ {
options = { options = {
colorschemes.base16 = { colorschemes.base16 = {
enable = mkEnableOption "Enable base16"; enable = mkEnableOption "base16";
package = mkOption { package = mkOption {
type = types.package; type = types.package;

View file

@ -7,7 +7,7 @@ in
{ {
options = { options = {
colorschemes.gruvbox = { colorschemes.gruvbox = {
enable = mkEnableOption "Enable gruvbox"; enable = mkEnableOption "gruvbox";
package = mkOption { package = mkOption {
type = types.package; type = types.package;
@ -15,10 +15,10 @@ in
description = "Plugin to use for gruvbox"; description = "Plugin to use for gruvbox";
}; };
italics = mkEnableOption "Enable italics"; italics = mkEnableOption "italics";
bold = mkEnableOption "Enable bold"; bold = mkEnableOption "bold";
underline = mkEnableOption "Enable underlined text"; underline = mkEnableOption "underlined text";
undercurl = mkEnableOption "Enable undercurled text"; undercurl = mkEnableOption "undercurled text";
contrastDark = mkOption { contrastDark = mkOption {
type = types.nullOr (types.enum [ "soft" "medium" "hard" ]); type = types.nullOr (types.enum [ "soft" "medium" "hard" ]);
@ -110,9 +110,9 @@ in
description = "Improved warnings"; description = "Improved warnings";
}; };
transparentBg = mkEnableOption "Transparent background"; transparentBg = mkEnableOption "transparent background";
trueColor = mkEnableOption "Enable true color support"; trueColor = mkEnableOption "true color support";
}; };
}; };

View file

@ -6,7 +6,7 @@ in
{ {
options = { options = {
colorschemes.nord = { colorschemes.nord = {
enable = mkEnableOption "Enable nord"; enable = mkEnableOption "nord";
package = mkOption { package = mkOption {
type = types.package; type = types.package;

View file

@ -6,7 +6,7 @@ in
{ {
options = { options = {
colorschemes.one = { colorschemes.one = {
enable = mkEnableOption "Enable vim-one"; enable = mkEnableOption "vim-one";
package = mkOption { package = mkOption {
type = types.package; type = types.package;

View file

@ -6,7 +6,7 @@ in
{ {
options = { options = {
colorschemes.onedark = { colorschemes.onedark = {
enable = mkEnableOption "Enable onedark"; enable = mkEnableOption "onedark";
package = mkOption { package = mkOption {
type = types.package; type = types.package;

View file

@ -8,7 +8,7 @@ in
{ {
options = { options = {
colorschemes.tokyonight = { colorschemes.tokyonight = {
enable = mkEnableOption "Enable tokyonight"; enable = mkEnableOption "tokyonight";
package = mkOption { package = mkOption {
type = types.package; type = types.package;
default = pkgs.vimPlugins.tokyonight-nvim; default = pkgs.vimPlugins.tokyonight-nvim;
@ -24,8 +24,7 @@ in
default = true; default = true;
description = "Configure the colors used when opening a :terminal in Neovim"; description = "Configure the colors used when opening a :terminal in Neovim";
}; };
transparent = transparent = mkEnableOption "disable setting the background color";
mkEnableOption "Enable this to disable setting the background color";
styles = styles =
let let
mkBackgroundStyle = name: mkOption { mkBackgroundStyle = name: mkOption {

View file

@ -6,7 +6,7 @@ in
{ {
options = { options = {
plugins.copilot = { plugins.copilot = {
enable = mkEnableOption "Enable copilot"; enable = mkEnableOption "copilot";
package = mkOption { package = mkOption {
type = types.package; type = types.package;
description = "The copilot plugin package to use"; description = "The copilot plugin package to use";

View file

@ -9,7 +9,7 @@ in
{ {
options = { options = {
plugins.coq-nvim = { plugins.coq-nvim = {
enable = mkEnableOption "Enable coq-nvim"; enable = mkEnableOption "coq-nvim";
package = mkOption { package = mkOption {
type = types.package; type = types.package;

View file

@ -15,7 +15,7 @@ let
in in
{ {
options.plugins.nvim-cmp = { options.plugins.nvim-cmp = {
enable = mkEnableOption "Enable nvim-cmp"; enable = mkEnableOption "nvim-cmp";
package = mkOption { package = mkOption {
type = types.package; type = types.package;
@ -215,6 +215,7 @@ in
}; };
auto_enable_sources = mkOption { auto_enable_sources = mkOption {
type = types.bool;
default = true; default = true;
description = '' description = ''
Scans the sources array and installs the plugins if they are known to nixvim. Scans the sources array and installs the plugins if they are known to nixvim.

View file

@ -24,6 +24,7 @@
./languages/ledger.nix ./languages/ledger.nix
./languages/nix.nix ./languages/nix.nix
./languages/plantuml-syntax.nix ./languages/plantuml-syntax.nix
./languages/rust.nix
./languages/treesitter.nix ./languages/treesitter.nix
./languages/treesitter-context.nix ./languages/treesitter-context.nix
./languages/treesitter-refactor.nix ./languages/treesitter-refactor.nix
@ -34,6 +35,7 @@
./nvim-lsp ./nvim-lsp
./nvim-lsp/lspsaga.nix ./nvim-lsp/lspsaga.nix
./nvim-lsp/lsp-lines.nix ./nvim-lsp/lsp-lines.nix
./nvim-lsp/nvim-lightbulb.nix
./nvim-lsp/trouble.nix ./nvim-lsp/trouble.nix
./pluginmanagers/packer.nix ./pluginmanagers/packer.nix
@ -56,6 +58,7 @@
./utils/mark-radar.nix ./utils/mark-radar.nix
./utils/notify.nix ./utils/notify.nix
./utils/nvim-autopairs.nix ./utils/nvim-autopairs.nix
./utils/nvim-colorizer.nix
./utils/nvim-tree.nix ./utils/nvim-tree.nix
./utils/project-nvim.nix ./utils/project-nvim.nix
./utils/specs.nix ./utils/specs.nix

View file

@ -7,7 +7,7 @@ in
{ {
options = { options = {
plugins.gitgutter = { plugins.gitgutter = {
enable = mkEnableOption "Enable gitgutter"; enable = mkEnableOption "gitgutter";
package = mkOption { package = mkOption {
type = types.package; type = types.package;

View file

@ -1,9 +1,8 @@
{ { config
config, , lib
lib, , pkgs
pkgs, , helpers
helpers, , ...
...
}: }:
with lib; let with lib; let
signOptions = defaults: signOptions = defaults:
@ -28,7 +27,7 @@ with lib; let
description = "Specifies the highlight group to use for the line"; description = "Specifies the highlight group to use for the line";
default = defaults.linehl; default = defaults.linehl;
}; };
showCount = mkEnableOption "Enable showing count of hunk, e.g. number of deleted lines"; showCount = mkEnableOption "showing count of hunk, e.g. number of deleted lines";
}; };
signSetupOptions = values: { signSetupOptions = values: {
inherit (values) hl text numhl linehl; inherit (values) hl text numhl linehl;
@ -41,7 +40,8 @@ with lib; let
description = "Lua function definition"; description = "Lua function definition";
}; };
}; };
in { in
{
options.plugins.gitsigns = { options.plugins.gitsigns = {
enable = mkEnableOption "Enable gitsigns plugin"; enable = mkEnableOption "Enable gitsigns plugin";
package = mkOption { package = mkOption {
@ -87,18 +87,19 @@ in {
linehl = "GitSignsAddLn"; linehl = "GitSignsAddLn";
}; };
}; };
worktrees = let worktrees =
worktreeModule = { let
options = { worktreeModule = {
toplevel = mkOption { options = {
type = types.str; toplevel = mkOption {
}; type = types.str;
gitdir = mkOption { };
type = types.str; gitdir = mkOption {
type = types.str;
};
}; };
}; };
}; in
in
mkOption { mkOption {
type = types.nullOr (types.listOf (types.submodule worktreeModule)); type = types.nullOr (types.listOf (types.submodule worktreeModule));
default = null; default = null;
@ -166,58 +167,59 @@ in {
''; '';
}; };
numhl = mkEnableOption '' numhl = mkEnableOption ''
Enable/disable line number highlights. line number highlights.
When enabled the highlights defined in `signs.*.numhl` are used. If When enabled the highlights defined in `signs.*.numhl` are used. If
the highlight group does not exist, then it is automatically defined the highlight group does not exist, then it is automatically defined
and linked to the corresponding highlight group in `signs.*.hl`. and linked to the corresponding highlight group in `signs.*.hl`.
''; '';
linehl = mkEnableOption '' linehl = mkEnableOption ''
Enable/disable line highlights. line highlights.
When enabled the highlights defined in `signs.*.linehl` are used. If When enabled the highlights defined in `signs.*.linehl` are used. If
the highlight group does not exist, then it is automatically defined the highlight group does not exist, then it is automatically defined
and linked to the corresponding highlight group in `signs.*.hl`. and linked to the corresponding highlight group in `signs.*.hl`.
''; '';
showDeleted = mkEnableOption '' showDeleted = mkEnableOption ''
Show the old version of hunks inline in the buffer (via virtual lines). showing the old version of hunks inline in the buffer (via virtual lines).
Note: Virtual lines currently use the highlight `GitSignsDeleteVirtLn`. Note: Virtual lines currently use the highlight `GitSignsDeleteVirtLn`.
''; '';
diffOpts = let diffOpts =
diffOptModule = { let
options = { diffOptModule = {
algorithm = mkOption { options = {
type = types.enum ["myers" "minimal" "patience" "histogram"]; algorithm = mkOption {
default = "myers"; type = types.enum [ "myers" "minimal" "patience" "histogram" ];
description = "Diff algorithm to use"; default = "myers";
}; description = "Diff algorithm to use";
internal = mkOption { };
type = types.bool; internal = mkOption {
default = false; type = types.bool;
description = "Use Neovim's built in xdiff library for running diffs"; default = false;
}; description = "Use Neovim's built in xdiff library for running diffs";
indentHeuristic = mkOption { };
type = types.bool; indentHeuristic = mkOption {
default = false; type = types.bool;
description = "Use the indent heuristic for the internal diff library."; default = false;
}; description = "Use the indent heuristic for the internal diff library.";
vertical = mkOption { };
type = types.bool; vertical = mkOption {
default = true; type = types.bool;
description = "Start diff mode with vertical splits"; default = true;
}; description = "Start diff mode with vertical splits";
linematch = mkOption { };
type = types.nullOr types.int; linematch = mkOption {
default = null; type = types.nullOr types.int;
description = '' default = null;
Enable second-stage diff on hunks to align lines. description = ''
Requires `internal=true`. Enable second-stage diff on hunks to align lines.
''; Requires `internal=true`.
'';
};
}; };
}; };
}; in
in
mkOption { mkOption {
type = types.nullOr (types.submodule diffOptModule); type = types.nullOr (types.submodule diffOptModule);
default = null; default = null;
@ -307,7 +309,7 @@ in {
description = "Whether to show a virtual text blame annotation"; description = "Whether to show a virtual text blame annotation";
}; };
virtTextPos = mkOption { virtTextPos = mkOption {
type = types.enum ["eol" "overlay" "right_align"]; type = types.enum [ "eol" "overlay" "right_align" ];
default = "eol"; default = "eol";
description = "Blame annotation position"; description = "Blame annotation position";
}; };
@ -352,7 +354,7 @@ in {
window. window.
''; '';
}; };
yadm.enable = mkEnableOption "Enable YADM support"; yadm.enable = mkEnableOption "YADM support";
wordDiff = mkEnableOption '' wordDiff = mkEnableOption ''
Highlight intra-line word differences in the buffer. Highlight intra-line word differences in the buffer.
Requires `config.diff_opts.internal = true`. Requires `config.diff_opts.internal = true`.
@ -363,76 +365,84 @@ in {
''; '';
}; };
config = let config =
cfg = config.plugins.gitsigns; let
in cfg = config.plugins.gitsigns;
in
mkIf cfg.enable { mkIf cfg.enable {
extraPlugins = with pkgs.vimPlugins; [ extraPlugins = with pkgs.vimPlugins; [
cfg.package cfg.package
]; ];
extraConfigLua = let extraConfigLua =
luaFnOrStrToObj = val: let
if builtins.isString val luaFnOrStrToObj = val:
then val if builtins.isString val
else {__raw = val.function;}; then val
setupOptions = { else { __raw = val.function; };
inherit (cfg) worktrees signcolumn numhl linehl trouble yadm; setupOptions = {
signs = mapAttrs (_: signSetupOptions) cfg.signs; inherit (cfg) worktrees signcolumn numhl linehl trouble yadm;
on_attach = signs = mapAttrs (_: signSetupOptions) cfg.signs;
if cfg.onAttach != null on_attach =
then {__raw = cfg.onAttach.function;} if cfg.onAttach != null
else null; then { __raw = cfg.onAttach.function; }
watch_gitdir = { else null;
inherit (cfg.watchGitDir) enable interval; watch_gitdir = {
follow_files = cfg.watchGitDir.followFiles; inherit (cfg.watchGitDir) enable interval;
}; follow_files = cfg.watchGitDir.followFiles;
sign_priority = cfg.signPriority;
show_deleted = cfg.showDeleted;
diff_opts =
if cfg.diffOpts == null
then null
else {
inherit (cfg.diffOpts) algorithm internal vertical linematch;
indent_heuristic = cfg.diffOpts.indentHeuristic;
}; };
count_chars = let sign_priority = cfg.signPriority;
isStrInt = s: (builtins.match "[0-9]+" s) != null; show_deleted = cfg.showDeleted;
in { diff_opts =
__raw = if cfg.diffOpts == null
"{" then null
+ (concatStringsSep "," ( else {
lib.mapAttrsToList ( inherit (cfg.diffOpts) algorithm internal vertical linematch;
name: value: indent_heuristic = cfg.diffOpts.indentHeuristic;
if isStrInt name };
then "[${name}] = ${helpers.toLuaObject value}" count_chars =
else "[${helpers.toLuaObject name}] = ${helpers.toLuaObject value}" let
) isStrInt = s: (builtins.match "[0-9]+" s) != null;
cfg.countChars in
)) {
+ "}"; __raw =
"{"
+ (concatStringsSep "," (
lib.mapAttrsToList
(
name: value:
if isStrInt name
then "[${name}] = ${helpers.toLuaObject value}"
else "[${helpers.toLuaObject name}] = ${helpers.toLuaObject value}"
)
cfg.countChars
))
+ "}";
};
status_formatter = { __raw = cfg.statusFormatter.function; };
max_file_length = cfg.maxFileLength;
preview_config = cfg.previewConfig;
attach_to_untracked = cfg.attachToUntracked;
update_debounce = cfg.updateDebounce;
current_line_blame = cfg.currentLineBlame;
current_line_blame_opts =
let
cfgCl = cfg.currentLineBlameOpts;
in
{
inherit (cfgCl) delay;
virt_text = cfgCl.virtText;
virt_text_pos = cfgCl.virtTextPos;
ignore_whitespace = cfgCl.ignoreWhitespace;
virt_text_priority = cfgCl.virtTextPriority;
};
current_line_blame_formatter = luaFnOrStrToObj cfg.currentLineBlameFormatter.normal;
current_line_blame_formatter_nc = luaFnOrStrToObj cfg.currentLineBlameFormatter.nonCommitted;
word_diff = cfg.wordDiff;
debug_mode = cfg.debugMode;
}; };
status_formatter = {__raw = cfg.statusFormatter.function;}; in
max_file_length = cfg.maxFileLength; ''
preview_config = cfg.previewConfig; require('gitsigns').setup(${helpers.toLuaObject setupOptions})
attach_to_untracked = cfg.attachToUntracked; '';
update_debounce = cfg.updateDebounce;
current_line_blame = cfg.currentLineBlame;
current_line_blame_opts = let
cfgCl = cfg.currentLineBlameOpts;
in {
inherit (cfgCl) delay;
virt_text = cfgCl.virtText;
virt_text_pos = cfgCl.virtTextPos;
ignore_whitespace = cfgCl.ignoreWhitespace;
virt_text_priority = cfgCl.virtTextPriority;
};
current_line_blame_formatter = luaFnOrStrToObj cfg.currentLineBlameFormatter.normal;
current_line_blame_formatter_nc = luaFnOrStrToObj cfg.currentLineBlameFormatter.nonCommitted;
word_diff = cfg.wordDiff;
debug_mode = cfg.debugMode;
};
in ''
require('gitsigns').setup(${helpers.toLuaObject setupOptions})
'';
}; };
} }

View file

@ -16,7 +16,7 @@ in
{ {
options = { options = {
plugins.neogit = { plugins.neogit = {
enable = mkEnableOption "Enable neogit"; enable = mkEnableOption "neogit";
package = mkOption { package = mkOption {
type = types.package; type = types.package;

View file

@ -1 +1,2 @@
args: import ../lib/helpers.nix args args: import ../lib/helpers.nix args

View file

@ -1,12 +1,11 @@
{ { pkgs
pkgs, , lib
lib, , config
config, , ...
...
}: }:
with lib; { with lib; {
options.plugins.plantuml-syntax = { options.plugins.plantuml-syntax = {
enable = mkEnableOption "Enable plantuml syntax support"; enable = mkEnableOption "plantuml syntax support";
package = mkOption { package = mkOption {
type = types.package; type = types.package;
@ -26,9 +25,10 @@ with lib; {
}; };
}; };
config = let config =
cfg = config.plugins.plantuml-syntax; let
in cfg = config.plugins.plantuml-syntax;
in
mkIf cfg.enable { mkIf cfg.enable {
extraPlugins = [ cfg.package ]; extraPlugins = [ cfg.package ];

229
plugins/languages/rust.nix Normal file
View file

@ -0,0 +1,229 @@
{ pkgs
, config
, lib
, helpers
, ...
}:
with lib; {
options.plugins.rust-tools =
let
mkNullableOptionWithDefault =
{ type
, description
, default
,
}:
mkOption {
type = types.nullOr type;
default = null;
description = ''
${description}
default: `${default}`
'';
};
mkNullableBoolDefault = default: description:
mkNullableOptionWithDefault {
inherit description;
type = types.bool;
default = toString default;
};
mkNullableStrDefault = default: description:
mkNullableOptionWithDefault {
inherit description;
type = types.str;
default = ''"${default}"'';
};
mkNullableIntDefault = default: description:
mkNullableOptionWithDefault {
inherit description;
type = types.int;
default = toString default;
};
in
{
enable = mkEnableOption "rust tools plugins";
package = mkOption {
type = types.package;
default = pkgs.vimPlugins.rust-tools-nvim;
description = "Package to use for rust-tools";
};
executor = mkNullableOptionWithDefault {
type = types.enum [ "termopen" "quickfix" ];
default = ''"termopen"'';
description = "how to execute terminal commands";
};
onIntialized = mkOption {
type = types.nullOr types.str;
default = null;
description = ''
Callback to execute once rust-analyzer is done initializing the workspace
The callback receives one parameter indicating the `health` of the server:
"ok" | "warning" | "error"
'';
};
reloadWorkspaceFromCargoToml = mkNullableBoolDefault true ''
Automatically call RustReloadWorkspace when writing to a Cargo.toml file.
'';
inlayHints = {
auto = mkNullableBoolDefault true "automatically set inlay hints (type hints)";
onlyCurrentLine = mkNullableBoolDefault false "Only show for current line";
showParameterHints =
mkNullableBoolDefault true
"whether to show parameter hints with the inlay hints or not";
parameterHintsPrefix = mkNullableStrDefault "<- " "prefix for parameter hints";
otherHintsPrefix = mkNullableStrDefault "=> " "prefix for all the other hints (type, chaining)";
maxLenAlign =
mkNullableBoolDefault false
"whether to align to the length of the longest line in the file";
maxLenAlignPadding = mkNullableIntDefault 1 "padding from the left if max_len_align is true";
rightAlign = mkNullableBoolDefault false "whether to align to the extreme right or not";
rightAlignPadding = mkNullableIntDefault 7 "padding from the right if right_align is true";
highlight = mkNullableStrDefault "Comment" "The color of the hints";
};
hoverActions = {
border = mkOption {
type = types.nullOr types.anything;
default = null;
description = ''
the border that is used for the hover window. see vim.api.nvim_open_win()
'';
};
maxWidth = mkOption {
type = types.nullOr types.int;
default = null;
description = "Maximal width of the hover window. Nil means no max.";
};
maxHeight = mkOption {
type = types.nullOr types.int;
default = null;
description = "Maximal height of the hover window. Nil means no max.";
};
autoFocus = mkNullableBoolDefault false "whether the hover action window gets automatically focused";
};
crateGraph = {
backend = mkNullableStrDefault "x11" ''
Backend used for displaying the graph
see: https://graphviz.org/docs/outputs/
'';
output = mkOption {
type = types.nullOr types.str;
default = null;
description = "where to store the output, nil for no output stored";
};
full = mkNullableBoolDefault true ''
true for all crates.io and external crates, false only the local crates
'';
enabledGraphvizBackends = mkOption {
type = types.nullOr (types.listOf types.str);
default = null;
description = ''
List of backends found on: https://graphviz.org/docs/outputs/
Is used for input validation and autocompletion
'';
};
};
server =
{
standalone = mkNullableBoolDefault true ''
standalone file support
setting it to false may improve startup time
'';
}
// (import ../nvim-lsp/rust-analyzer-config.nix lib);
};
config =
let
cfg = config.plugins.rust-tools;
in
mkIf cfg.enable {
extraPlugins = with pkgs.vimPlugins; [ nvim-lspconfig cfg.package ];
plugins.lsp.postConfig =
let
setupOptions = {
tools = {
executor =
if cfg.executor != null
then { __raw = ''require("rust-tools.executors").${cfg.executor}''; }
else null;
on_initialized =
if cfg.onIntialized != null
then { __raw = cfg.onIntialized; }
else null;
reload_workspace_from_cargo_toml = cfg.reloadWorkspaceFromCargoToml;
inlay_hints =
let
cfgIH = cfg.inlayHints;
in
{
auto = cfgIH.auto;
only_current_line = cfgIH.onlyCurrentLine;
show_parameter_hints = cfgIH.showParameterHints;
parameter_hints_prefix = cfgIH.parameterHintsPrefix;
other_hints_prefix = cfgIH.otherHintsPrefix;
max_len_align = cfgIH.maxLenAlign;
max_len_align_padding = cfgIH.maxLenAlignPadding;
right_align = cfgIH.rightAlign;
right_align_padding = cfgIH.rightAlignPadding;
highlight = cfgIH.highlight;
};
hover_actions =
let
cfgHA = cfg.hoverActions;
in
{
border = cfgHA.border;
max_width = cfgHA.maxWidth;
max_height = cfgHA.maxHeight;
auto_focus = cfgHA.autoFocus;
};
crate_graph =
let
cfgCG = cfg.crateGraph;
in
{
backend = cfgCG.backend;
output = cfgCG.output;
full = cfgCG.full;
enabled_graphviz_backends = cfgCG.enabledGraphvizBackends;
};
};
server = {
standalone = cfg.server.standalone;
settings.rust-analyzer = lib.filterAttrs (n: v: n != "standalone") cfg.server;
on_attach = { __raw = "__lspOnAttach"; };
};
};
in
''
require('rust-tools').setup(${helpers.toLuaObject setupOptions})
'';
};
}

View file

@ -5,7 +5,7 @@
}: }:
with lib; { with lib; {
options.plugins.treesitter-context = { options.plugins.treesitter-context = {
enable = mkEnableOption "Enable nvim-treesitter-context"; enable = mkEnableOption "nvim-treesitter-context";
package = mkOption { package = mkOption {
type = types.package; type = types.package;

View file

@ -15,7 +15,7 @@ with lib; {
{ {
enable = enable =
mkEnableOption mkEnableOption
"Enable treesitter-refactor (requires plugins.treesitter.enable to be true)"; "treesitter-refactor (requires plugins.treesitter.enable to be true)";
package = mkOption { package = mkOption {
type = types.package; type = types.package;
@ -39,7 +39,7 @@ with lib; {
}; };
highlightCurrentScope = { highlightCurrentScope = {
inherit disable; inherit disable;
enable = mkEnableOption "Highlights the block from the current scope where the cursor is."; enable = mkEnableOption "highlights the block from the current scope where the cursor is.";
}; };
smartRename = { smartRename = {
inherit disable; inherit disable;

View file

@ -7,7 +7,7 @@ in
{ {
options = { options = {
plugins.treesitter = { plugins.treesitter = {
enable = mkEnableOption "Enable tree-sitter syntax highlighting"; enable = mkEnableOption "tree-sitter syntax highlighting";
package = mkOption { package = mkOption {
type = types.package; type = types.package;
@ -66,7 +66,7 @@ in
}; };
in in
{ {
enable = mkEnableOption "Incremental selection based on the named nodes from the grammar"; enable = mkEnableOption "incremental selection based on the named nodes from the grammar";
keymaps = { keymaps = {
initSelection = keymap "gnn"; initSelection = keymap "gnn";
nodeIncremental = keymap "grn"; nodeIncremental = keymap "grn";
@ -75,13 +75,13 @@ in
}; };
}; };
indent = mkEnableOption "Enable tree-sitter based indentation"; indent = mkEnableOption "tree-sitter based indentation";
folding = mkEnableOption "Enable tree-sitter based folding"; folding = mkEnableOption "tree-sitter based folding";
grammarPackages = mkOption { grammarPackages = mkOption {
type = with types; listOf package; type = with types; listOf package;
default = pkgs.tree-sitter.allGrammars; default = cfg.package.passthru.allGrammars;
description = "Grammar packages to install"; description = "Grammar packages to install";
}; };

View file

@ -10,7 +10,7 @@ in
]; ];
options.plugins.null-ls = { options.plugins.null-ls = {
enable = mkEnableOption "Enable null-ls"; enable = mkEnableOption "null-ls";
package = mkOption { package = mkOption {
type = types.package; type = types.package;

View file

@ -3,7 +3,7 @@
mkServer = mkServer =
{ name { name
, sourceType , sourceType
, description ? "Enable ${name} source, for null-ls." , description ? "${name} source, for null-ls."
, package ? null , package ? null
, extraPackages ? [ ] , extraPackages ? [ ]
, ... , ...

View file

@ -4,6 +4,9 @@ let
serverData = { serverData = {
code_actions = { code_actions = {
gitsigns = { }; gitsigns = { };
shellcheck = {
package = pkgs.shellcheck;
};
}; };
completion = { }; completion = { };
diagnostics = { diagnostics = {
@ -13,6 +16,12 @@ let
shellcheck = { shellcheck = {
package = pkgs.shellcheck; package = pkgs.shellcheck;
}; };
cppcheck = {
package = pkgs.cppcheck;
};
gitlint = {
package = pkgs.gitlint;
};
}; };
formatting = { formatting = {
phpcbf = { phpcbf = {
@ -36,6 +45,18 @@ let
fnlfmt = { fnlfmt = {
package = pkgs.fnlfmt; package = pkgs.fnlfmt;
}; };
stylua = {
package = pkgs.stylua;
};
cbfmt = {
package = pkgs.cbfmt;
};
shfmt = {
package = pkgs.shfmt;
};
taplo = {
package = pkgs.taplo;
};
}; };
}; };
# Format the servers to be an array of attrs like the following example # Format the servers to be an array of attrs like the following example

View file

@ -3,6 +3,12 @@ with lib;
let let
helpers = import ./helpers.nix args; helpers = import ./helpers.nix args;
servers = [ servers = [
{
name = "astro";
description = "Enable astrols, for Astro";
package = pkgs.nodePackages."@astrojs/language-server";
cmd = cfg: [ "${cfg.package}/bin/astro-ls" "--stdio" ];
}
{ {
name = "bashls"; name = "bashls";
description = "Enable bashls, for bash."; description = "Enable bashls, for bash.";
@ -23,12 +29,12 @@ let
name = "dartls"; name = "dartls";
description = "Enable dart language-server, for dart"; description = "Enable dart language-server, for dart";
package = pkgs.dart; package = pkgs.dart;
extraOptions = { settingsOptions = {
analysisExcludedFolders = mkOption { analysisExcludedFolders = mkOption {
type = types.nullOr (types.listOf types.str); type = types.nullOr (types.listOf types.str);
default = null; default = null;
description = '' description = ''
An array of paths (absolute or relative to each workspace folder) that should be An array of paths (absolute or relative to each workspace folder) that should be
excluded from analysis. excluded from analysis.
''; '';
}; };
@ -36,7 +42,7 @@ let
type = types.nullOr types.bool; type = types.nullOr types.bool;
default = null; default = null;
description = '' description = ''
When set to false, prevents registration (or unregisters) the SDK formatter. When set When set to false, prevents registration (or unregisters) the SDK formatter. When set
to true or not supplied, will register/reregister the SDK formatter to true or not supplied, will register/reregister the SDK formatter
''; '';
}; };
@ -44,7 +50,7 @@ let
type = types.nullOr types.int; type = types.nullOr types.int;
default = null; default = null;
description = '' description = ''
The number of characters the formatter should wrap code at. If unspecified, code will The number of characters the formatter should wrap code at. If unspecified, code will
be wrapped at 80 characters. be wrapped at 80 characters.
''; '';
}; };
@ -59,7 +65,7 @@ let
type = types.nullOr types.bool; type = types.nullOr types.bool;
default = true; default = true;
description = '' description = ''
Whether to generate diagnostics for TODO comments. If unspecified, diagnostics will not Whether to generate diagnostics for TODO comments. If unspecified, diagnostics will not
be generated. be generated.
''; '';
}; };
@ -103,7 +109,7 @@ let
type = types.nullOr types.bool; type = types.nullOr types.bool;
default = null; default = null;
description = '' description = ''
Whether to include symbols from dependencies and Dart/Flutter SDKs in Workspace Symbol Whether to include symbols from dependencies and Dart/Flutter SDKs in Workspace Symbol
results. If not set, defaults to true. results. If not set, defaults to true.
''; '';
}; };
@ -152,7 +158,7 @@ let
name = "nil_ls"; name = "nil_ls";
description = "Enable nil, for Nix"; description = "Enable nil, for Nix";
package = pkgs.nil; package = pkgs.nil;
extraOptions = { settingsOptions = {
formatting.command = mkOption { formatting.command = mkOption {
type = types.nullOr (types.listOf types.str); type = types.nullOr (types.listOf types.str);
default = null; default = null;
@ -197,6 +203,9 @@ let
name = "rust-analyzer"; name = "rust-analyzer";
description = "Enable rust-analyzer, for Rust."; description = "Enable rust-analyzer, for Rust.";
serverName = "rust_analyzer"; serverName = "rust_analyzer";
settingsOptions = import ./rust-analyzer-config.nix lib;
settings = cfg: { rust-analyzer = cfg; };
} }
{ {
name = "sumneko-lua"; name = "sumneko-lua";

View file

@ -11,7 +11,7 @@ in
options = { options = {
plugins.lsp = { plugins.lsp = {
enable = mkEnableOption "Enable neovim's built-in LSP"; enable = mkEnableOption "neovim's built-in LSP";
enabledServers = mkOption { enabledServers = mkOption {
type = with types; listOf (oneOf [ type = with types; listOf (oneOf [
@ -51,6 +51,12 @@ in
description = "Code to be run before loading the LSP. Useful for requiring plugins"; description = "Code to be run before loading the LSP. Useful for requiring plugins";
default = ""; default = "";
}; };
postConfig = mkOption {
type = types.lines;
description = "Code to be run after loading the LSP. This is an internal option";
default = "";
};
}; };
}; };
@ -92,6 +98,8 @@ in
require('lspconfig')[server.name].setup(options) require('lspconfig')[server.name].setup(options)
end end
end end
${cfg.postConfig}
end end
-- }}} -- }}}
''; '';

View file

@ -9,7 +9,7 @@
, extraPackages ? { } , extraPackages ? { }
, cmd ? (cfg: null) , cmd ? (cfg: null)
, settings ? (cfg: { }) , settings ? (cfg: { })
, extraOptions ? { } , settingsOptions ? { }
, ... , ...
}: }:
# returns a module # returns a module
@ -30,7 +30,8 @@
options = { options = {
plugins.lsp.servers.${name} = { plugins.lsp.servers.${name} = {
enable = mkEnableOption description; enable = mkEnableOption description;
} // packageOption // extraOptions; settings = settingsOptions;
} // packageOption;
}; };
config = mkIf cfg.enable config = mkIf cfg.enable
@ -42,7 +43,7 @@
name = serverName; name = serverName;
extraOptions = { extraOptions = {
cmd = cmd cfg; cmd = cmd cfg;
settings = settings cfg; settings = settings cfg.settings;
}; };
}]; }];
}; };

View file

@ -7,7 +7,7 @@ in
{ {
options = { options = {
plugins.lspsaga = { plugins.lspsaga = {
enable = mkEnableOption "Enable lspsava.nvim"; enable = mkEnableOption "lspsaga.nvim";
package = mkOption { package = mkOption {
type = types.package; type = types.package;
@ -111,27 +111,29 @@ in
description = "Maximum finder preview lines"; description = "Maximum finder preview lines";
}; };
keys = let keys =
defaultKeyOpt = desc: mkOption { let
description = desc; defaultKeyOpt = desc: mkOption {
type = types.nullOr types.str; description = desc;
default = null; type = types.nullOr types.str;
}; default = null;
in { };
finderAction = { in
open = defaultKeyOpt "Open from finder"; {
vsplit = defaultKeyOpt "Vertical split in finder"; finderAction = {
split = defaultKeyOpt "Horizontal split in finder"; open = defaultKeyOpt "Open from finder";
quit = defaultKeyOpt "Quit finder"; vsplit = defaultKeyOpt "Vertical split in finder";
scrollDown = defaultKeyOpt "Scroll down finder"; split = defaultKeyOpt "Horizontal split in finder";
scrollUp = defaultKeyOpt "Scroll up finder"; quit = defaultKeyOpt "Quit finder";
}; scrollDown = defaultKeyOpt "Scroll down finder";
scrollUp = defaultKeyOpt "Scroll up finder";
};
codeAction = { codeAction = {
quit = defaultKeyOpt "Quit code actions menu"; quit = defaultKeyOpt "Quit code actions menu";
exec = defaultKeyOpt "Execute code action"; exec = defaultKeyOpt "Execute code action";
};
}; };
};
borderStyle = mkOption { borderStyle = mkOption {
type = types.nullOr (types.enum [ "thin" "rounded" "thick" ]); type = types.nullOr (types.enum [ "thin" "rounded" "thick" ]);
@ -147,66 +149,76 @@ in
}; };
}; };
config = let config =
notDefault = default: opt: if (opt != default) then opt else null; let
notEmpty = opt: if ((filterAttrs (_: v: v != null) opt) != {}) then opt else null; notDefault = default: opt: if (opt != default) then opt else null;
notNull = opt: opt; notEmpty = opt: if ((filterAttrs (_: v: v != null) opt) != { }) then opt else null;
lspsagaConfig = { notNull = opt: opt;
use_saga_diagnostic_sign = notDefault true cfg.signs.use; lspsagaConfig = {
error_sign = notNull cfg.signs.error; use_saga_diagnostic_sign = notDefault true cfg.signs.use;
warn_sign = notNull cfg.signs.warning; error_sign = notNull cfg.signs.error;
hint_sign = notNull cfg.signs.hint; warn_sign = notNull cfg.signs.warning;
infor_sign = notNull cfg.signs.info; hint_sign = notNull cfg.signs.hint;
infor_sign = notNull cfg.signs.info;
# TODO Fix this! # TODO Fix this!
# error_header = notNull cfg.headers.error; # error_header = notNull cfg.headers.error;
# warn_header = notNull cfg.headers.warning; # warn_header = notNull cfg.headers.warning;
# hint_header = notNull cfg.headers.hint; # hint_header = notNull cfg.headers.hint;
# infor_header = notNull cfg.headers.info; # infor_header = notNull cfg.headers.info;
max_diag_msg_width = notNull cfg.maxDialogWidth; max_diag_msg_width = notNull cfg.maxDialogWidth;
code_action_icon = notNull cfg.icons.codeAction; code_action_icon = notNull cfg.icons.codeAction;
finder_definition_icon = notNull cfg.icons.findDefinition; finder_definition_icon = notNull cfg.icons.findDefinition;
finder_reference_icon = notNull cfg.icons.findReference; finder_reference_icon = notNull cfg.icons.findReference;
definition_preview_icon = notNull cfg.icons.definitionPreview; definition_preview_icon = notNull cfg.icons.definitionPreview;
max_finder_preview_lines = notNull cfg.maxFinderPreviewLines; max_finder_preview_lines = notNull cfg.maxFinderPreviewLines;
rename_prompt_prefix = notNull cfg.renamePromptPrefix; rename_prompt_prefix = notNull cfg.renamePromptPrefix;
border_style = let border_style =
borderStyle = if cfg.borderStyle == "thin" then 1 let
else if cfg.borderStyle == "rounded" then 2 borderStyle =
else if cfg.borderStyle == "thick" then 3 if cfg.borderStyle == "thin" then 1
else null; else if cfg.borderStyle == "rounded" then 2
in borderStyle; else if cfg.borderStyle == "thick" then 3
else null;
in
borderStyle;
finder_action_keys = let finder_action_keys =
keys = { let
open = notNull cfg.keys.finderAction.open; keys = {
vsplit = notNull cfg.keys.finderAction.vsplit; open = notNull cfg.keys.finderAction.open;
split = notNull cfg.keys.finderAction.split; vsplit = notNull cfg.keys.finderAction.vsplit;
quit = notNull cfg.keys.finderAction.quit; split = notNull cfg.keys.finderAction.split;
scroll_down = notNull cfg.keys.finderAction.scrollDown; quit = notNull cfg.keys.finderAction.quit;
scroll_up = notNull cfg.keys.finderAction.scrollUp; scroll_down = notNull cfg.keys.finderAction.scrollDown;
}; scroll_up = notNull cfg.keys.finderAction.scrollUp;
in notEmpty keys; };
in
notEmpty keys;
code_action_keys = let code_action_keys =
keys = { let
quit = notNull cfg.keys.codeAction.quit; keys = {
exec = notNull cfg.keys.codeAction.exec; quit = notNull cfg.keys.codeAction.quit;
}; exec = notNull cfg.keys.codeAction.exec;
in notEmpty keys; };
in
notEmpty keys;
};
in
mkIf cfg.enable {
extraPlugins = [ cfg.package ];
extraConfigLua = ''
local saga = require 'lspsaga'
saga.init_lsp_saga(${helpers.toLuaObject lspsagaConfig})
'';
}; };
in mkIf cfg.enable {
extraPlugins = [ cfg.package ];
extraConfigLua = ''
local saga = require 'lspsaga'
saga.init_lsp_saga(${helpers.toLuaObject lspsagaConfig})
'';
};
} }

View file

@ -0,0 +1,95 @@
{ pkgs
, lib
, config
, ...
}:
let
helpers = import ../helpers.nix { inherit lib; };
in
with lib; {
options.plugins.nvim-lightbulb = {
enable = mkEnableOption "nvim-lightbulb, showing available code actions";
package = mkOption {
type = types.package;
default = pkgs.vimPlugins.nvim-lightbulb;
description = "Plugin to use for nvim-lightbulb";
};
ignore = helpers.defaultNullOpts.mkNullable (types.listOf types.str) "[]" ''
LSP client names to ignore
'';
sign = {
enabled = helpers.defaultNullOpts.mkBool true "";
priority = helpers.defaultNullOpts.mkInt 10 "";
};
float = {
enabled = helpers.defaultNullOpts.mkBool false "";
text = helpers.defaultNullOpts.mkStr "💡" "Text to show in the popup float";
winOpts = helpers.defaultNullOpts.mkNullable (types.attrsOf types.anything) "{}" ''
Options for the floating window (see |vim.lsp.util.open_floating_preview| for more information)
'';
};
virtualText = {
enabled = helpers.defaultNullOpts.mkBool false "";
text = helpers.defaultNullOpts.mkStr "💡" "Text to show at virtual text";
hlMode = helpers.defaultNullOpts.mkStr "replace" ''
highlight mode to use for virtual text (replace, combine, blend), see
:help nvim_buf_set_extmark() for reference
'';
};
statusText = {
enabled = helpers.defaultNullOpts.mkBool false "";
text = helpers.defaultNullOpts.mkStr "💡" "Text to provide when code actions are available";
textUnavailable = helpers.defaultNullOpts.mkStr "" ''
Text to provide when no actions are available
'';
};
autocmd = {
enabled = helpers.defaultNullOpts.mkBool false "";
pattern = helpers.defaultNullOpts.mkNullable (types.listOf types.str) ''["*"]'' "";
events =
helpers.defaultNullOpts.mkNullable (types.listOf types.str)
''["CursorHold" "CursorHoldI"]'' "";
};
};
config =
let
cfg = config.plugins.nvim-lightbulb;
setupOptions = {
inherit (cfg) ignore sign autocmd;
float = {
inherit (cfg.float) enabled text;
win_opts = cfg.float.winOpts;
};
virtual_text = {
inherit (cfg.virtualText) enabled text;
hl_mode = cfg.virtualText.hlMode;
};
status_text = {
inherit (cfg.statusText) enabled text;
text_unavailable = cfg.statusText.textUnavailable;
};
};
in
mkIf cfg.enable {
extraPlugins = [ cfg.package ];
extraConfigLua = ''
require("nvim-lightbulb").setup(${helpers.toLuaObject setupOptions})
'';
};
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,13 @@
# Updating rust-analyzer options
Because there a large number of rust-analyzer options it's difficult to handle them by hand.
The options can be fetched from the [rust-analyzer package.json](https://github.com/rust-lang/rust-analyzer/blob/master/editors/code/package.json).
There is a derivation on the top-level flake that allows to build it easily, you just have to run:
```bash
nix build .#rustAnalyzerOptions
```
You can then copy the `result/share/rust-analyzer-config.nix` to the correct location.

View file

@ -7,7 +7,7 @@ in
{ {
options = { options = {
plugins.packer = { plugins.packer = {
enable = mkEnableOption "Enable packer.nvim"; enable = mkEnableOption "packer.nvim";
plugins = mkOption { plugins = mkOption {
type = types.listOf (types.oneOf [ type = types.listOf (types.oneOf [

View file

@ -24,7 +24,7 @@ in
} }
] ]
# generates: # generates:
# #
# require("luasnip.loaders.from_vscode").lazy_load({}) # require("luasnip.loaders.from_vscode").lazy_load({})
# require("luasnip.loaders.from_vscode").lazy_load({['paths'] = {'/nix/store/.../path/to/snippets'}}) # require("luasnip.loaders.from_vscode").lazy_load({['paths'] = {'/nix/store/.../path/to/snippets'}})
# #

View file

@ -14,7 +14,7 @@ in
{ {
options = { options = {
plugins.airline = { plugins.airline = {
enable = mkEnableOption "Enable airline"; enable = mkEnableOption "airline";
package = mkOption { package = mkOption {
type = types.package; type = types.package;

View file

@ -7,7 +7,7 @@ in
{ {
options = { options = {
plugins.lightline = { plugins.lightline = {
enable = mkEnableOption "Enable lightline"; enable = mkEnableOption "lightline";
package = mkOption { package = mkOption {
type = types.package; type = types.package;

View file

@ -56,7 +56,7 @@ in
{ {
options = { options = {
plugins.lualine = { plugins.lualine = {
enable = mkEnableOption "Enable lualine"; enable = mkEnableOption "lualine";
package = mkOption { package = mkOption {
type = types.package; type = types.package;

View file

@ -16,7 +16,7 @@ in
# TODO:add support for aditional filetypes. This requires autocommands! # TODO:add support for aditional filetypes. This requires autocommands!
options.plugins.telescope = { options.plugins.telescope = {
enable = mkEnableOption "Enable telescope.nvim"; enable = mkEnableOption "telescope.nvim";
package = mkOption { package = mkOption {
type = types.package; type = types.package;
@ -68,21 +68,23 @@ in
let $BAT_THEME = '${cfg.highlightTheme}' let $BAT_THEME = '${cfg.highlightTheme}'
''; '';
extraConfigLua = let extraConfigLua =
options = { let
extensions = cfg.extensionConfig; options = {
defaults = cfg.defaults; extensions = cfg.extensionConfig;
} // cfg.extraOptions; defaults = cfg.defaults;
in '' } // cfg.extraOptions;
do in
local __telescopeExtensions = ${helpers.toLuaObject cfg.enabledExtensions} ''
do
local __telescopeExtensions = ${helpers.toLuaObject cfg.enabledExtensions}
require('telescope').setup(${helpers.toLuaObject options}) require('telescope').setup(${helpers.toLuaObject options})
for i, extension in ipairs(__telescopeExtensions) do for i, extension in ipairs(__telescopeExtensions) do
require('telescope').load_extension(extension) require('telescope').load_extension(extension)
end
end end
end '';
'';
}; };
} }

View file

@ -1,11 +1,11 @@
{ pkgs, config, lib, ... }: { pkgs, config, lib, ... }:
with lib; with lib;
let let
cfg = config.plugins.telescope.extensions.frecency; cfg = config.plugins.telescope.extensions.frecency;
in in
{ {
options.plugins.telescope.extensions.frecency = { options.plugins.telescope.extensions.frecency = {
enable = mkEnableOption "Enable frecency"; enable = mkEnableOption "frecency";
package = mkOption { package = mkOption {
type = types.package; type = types.package;
@ -50,24 +50,26 @@ in
}; };
}; };
config = let config =
configuration = { let
db_root = cfg.dbRoot; configuration = {
default_workspace = cfg.defaultWorkspace; db_root = cfg.dbRoot;
ignore_patterns = cfg.ignorePatterns; default_workspace = cfg.defaultWorkspace;
show_scores = cfg.showScores; ignore_patterns = cfg.ignorePatterns;
workspaces = cfg.workspaces; show_scores = cfg.showScores;
show_unindexed = cfg.showUnindexed; workspaces = cfg.workspaces;
devicons_disabled = cfg.deviconsDisabled; show_unindexed = cfg.showUnindexed;
}; devicons_disabled = cfg.deviconsDisabled;
in mkIf cfg.enable { };
extraPackages = [ pkgs.sqlite ]; in
extraPlugins = with pkgs.vimPlugins; [ mkIf cfg.enable {
cfg.package extraPackages = [ pkgs.sqlite ];
sqlite-lua extraPlugins = with pkgs.vimPlugins; [
]; cfg.package
sqlite-lua
];
plugins.telescope.enabledExtensions = [ "frecency" ]; plugins.telescope.enabledExtensions = [ "frecency" ];
plugins.telescope.extensionConfig."frecency" = configuration; plugins.telescope.extensionConfig."frecency" = configuration;
}; };
} }

View file

@ -1,6 +1,6 @@
{ pkgs, config, lib, ... }: { pkgs, config, lib, ... }:
with lib; with lib;
let let
cfg = config.plugins.telescope.extensions.fzf-native; cfg = config.plugins.telescope.extensions.fzf-native;
in in
{ {
@ -34,7 +34,7 @@ in
}; };
}; };
config = let config = let
configuration = { configuration = {
fuzzy = cfg.fuzzy; fuzzy = cfg.fuzzy;
override_generic_sorter = cfg.overrideGenericSorter; override_generic_sorter = cfg.overrideGenericSorter;

View file

@ -1,11 +1,11 @@
{ pkgs, config, lib, ...}: { pkgs, config, lib, ... }:
with lib; with lib;
let let
cfg = config.plugins.telescope.extensions.project-nvim; cfg = config.plugins.telescope.extensions.project-nvim;
in in
{ {
options.plugins.telescope.extensions.project-nvim = { options.plugins.telescope.extensions.project-nvim = {
enable = mkEnableOption "Enable project-nvim telescope extension"; enable = mkEnableOption "project-nvim telescope extension";
}; };

View file

@ -8,11 +8,11 @@ in
options = { options = {
plugins.commentary = { plugins.commentary = {
enable = mkEnableOption "Enable commentary"; enable = mkEnableOption "commentary";
package = mkOption { package = mkOption {
type = types.package; type = types.package;
default = pkgs.vimPlugins.vim-commentary; default = pkgs.vimPlugins.vim-commentary;
description = "Plugin to use for vim-commentary"; description = "Plugin to use for vim-commentary";
}; };
}; };

View file

@ -8,7 +8,7 @@ in
{ {
options = { options = {
plugins.dashboard = { plugins.dashboard = {
enable = mkEnableOption "Enable dashboard"; enable = mkEnableOption "dashboard";
package = mkOption { package = mkOption {
type = types.package; type = types.package;

View file

@ -7,7 +7,7 @@ in
{ {
options = { options = {
plugins.floaterm = { plugins.floaterm = {
enable = mkEnableOption "Enable floaterm"; enable = mkEnableOption "floaterm";
package = mkOption { package = mkOption {
type = types.package; type = types.package;

View file

@ -1,7 +1,7 @@
{ config, pkgs, lib, ... }: { config, pkgs, lib, ... }:
with lib; with lib;
let let
cfg = config.plugins.comment-nvim; cfg = config.plugins.intellitab;
defs = import ../plugin-defs.nix { inherit pkgs; }; defs = import ../plugin-defs.nix { inherit pkgs; };
in in
{ {

View file

@ -73,21 +73,21 @@ in {
package = mkOption { package = mkOption {
type = types.nullOr types.package; type = types.nullOr types.package;
default = null; default = null;
example = example =
"package = pkgs.fetchFromGitHub { "package = pkgs.fetchFromGitHub {
owner = \"WhiteBlackGoose\"; owner = \"WhiteBlackGoose\";
repo = \"magma-nvim-goose\"; repo = \"magma-nvim-goose\";
rev = version; rev = version;
sha256 = \"sha256-IaslJK1F2BxTvZzKGH9OKOl2RICi4d4rSgjliAIAqK4=\";} "; sha256 = \"sha256-IaslJK1F2BxTvZzKGH9OKOl2RICi4d4rSgjliAIAqK4=\";} ";
}; };
}; };
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
extraPlugins = [ ( extraPlugins = [ (
if cfg.package != null then plugins.magma-nvim.override {src = cfg.package;} else plugins.magma-nvim if cfg.package != null then plugins.magma-nvim.override {src = cfg.package;} else plugins.magma-nvim
)]; )];

View file

@ -8,7 +8,7 @@ let
in in
{ {
options.plugins.mark-radar = { options.plugins.mark-radar = {
enable = mkEnableOption "Enable mark-radar"; enable = mkEnableOption "mark-radar";
package = mkOption { package = mkOption {
type = types.package; type = types.package;

View file

@ -10,7 +10,7 @@ let
in in
{ {
options.plugins.notify = { options.plugins.notify = {
enable = mkEnableOption "Enable notify"; enable = mkEnableOption "notify";
package = mkOption { package = mkOption {
type = types.package; type = types.package;

View file

@ -6,7 +6,7 @@ let
in in
{ {
options.plugins.nvim-autopairs = { options.plugins.nvim-autopairs = {
enable = mkEnableOption "Enable nvim-autopairs"; enable = mkEnableOption "nvim-autopairs";
package = mkOption { package = mkOption {
type = types.package; type = types.package;

View file

@ -0,0 +1,161 @@
{ pkgs, config, lib, ... }:
with lib;
let
cfg = config.plugins.nvim-colorizer;
helpers = import ../helpers.nix { inherit lib; };
colorizer-options = {
RGB = mkOption {
description = "#RGB hex codes";
type = types.nullOr types.bool;
default = null;
};
RRGGBB = mkOption {
description = "#RRGGBB hex codes";
type = types.nullOr types.bool;
default = null;
};
names = mkOption {
description = "\"Name\" codes like Blue or blue";
type = types.nullOr types.bool;
default = null;
};
RRGGBBAA = mkOption {
description = "#RRGGBBAA hex codes";
type = types.nullOr types.bool;
default = null;
};
AARRGGBB = mkOption {
description = "0xAARRGGBB hex codes";
type = types.nullOr types.bool;
default = null;
};
rgb_fn = mkOption {
description = "CSS rgb() and rgba() functions";
type = types.nullOr types.bool;
default = null;
};
hsl_fn = mkOption {
description = "CSS hsl() and hsla() functions";
type = types.nullOr types.bool;
default = null;
};
css = mkOption {
description = "Enable all CSS features: rgb_fn, hsl_fn, names, RGB, RRGGBB";
type = types.nullOr types.bool;
default = null;
};
css_fn = mkOption {
description = "Enable all CSS *functions*: rgb_fn, hsl_fn";
type = types.nullOr types.bool;
default = null;
};
mode = mkOption {
description = "Set the display mode";
type = types.nullOr (types.enum [ "foreground" "background" "virtualtext" ]);
default = null;
};
tailwind = mkOption {
description = "Enable tailwind colors";
type = types.nullOr (
types.oneOf [
types.bool
(types.enum [ "normal" "lsp" "both" ])
]
);
default = null;
};
sass = {
enable = mkOption {
description = "Enable sass colors";
type = types.nullOr types.bool;
default = null;
};
parsers = mkOption {
description = "sass parsers settings";
type = types.nullOr types.attrs;
default = null;
};
};
virtualtext = mkOption {
description = "Set the virtualtext character (only used when mode is set to 'virtualtext')";
type = types.nullOr types.str;
default = null;
};
};
in
{
options = {
plugins.nvim-colorizer = {
enable = mkEnableOption "nvim-colorizer";
package = mkOption {
type = types.package;
default = pkgs.vimPlugins.nvim-colorizer-lua;
description = "Plugin to use for vim-commentary";
};
fileTypes = mkOption {
description = "Enable and/or configure highlighting for certain filetypes";
type = types.nullOr (
types.listOf (types.oneOf [
types.str
(types.submodule {
options = {
language = mkOption {
type = types.str;
};
} // colorizer-options;
})
])
);
default = null;
};
userDefaultOptions = mkOption {
description = "Default options";
type = types.nullOr (types.submodule {
options = colorizer-options;
});
default = null;
};
bufTypes = mkOption {
description = "Buftype value is fetched by vim.bo.buftype";
type = types.nullOr (types.listOf types.str);
default = null;
};
};
};
config = mkIf cfg.enable {
extraPlugins = [ cfg.package ];
extraConfigLua = let
filetypes = if (cfg.fileTypes != null)
then (
let
list = map (
v: if builtins.isAttrs v
then v.language + " = " + helpers.toLuaObject (builtins.removeAttrs v [ "language" ])
else "'${v}'"
) cfg.fileTypes;
in "{" + (concatStringsSep "," list) + "}"
)
else
"nil"
;
in ''
require("colorizer").setup({
filetypes = ${filetypes},
user_default_options = ${helpers.toLuaObject cfg.userDefaultOptions},
buftypes = ${helpers.toLuaObject cfg.bufTypes},
})
'';
};
}

View file

@ -19,7 +19,7 @@ in
]; ];
options.plugins.nvim-tree = { options.plugins.nvim-tree = {
enable = mkEnableOption "Enable nvim-tree"; enable = mkEnableOption "nvim-tree";
package = mkOption { package = mkOption {
type = types.package; type = types.package;
@ -234,7 +234,6 @@ in
hijack_netrw = cfg.hijackNetrw; hijack_netrw = cfg.hijackNetrw;
open_on_setup = cfg.openOnSetup; open_on_setup = cfg.openOnSetup;
ignore_ft_on_setup = cfg.ignoreFtOnSetup; ignore_ft_on_setup = cfg.ignoreFtOnSetup;
auto_close = cfg.autoClose;
open_on_tab = cfg.openOnTab; open_on_tab = cfg.openOnTab;
hijack_cursor = cfg.hijackCursor; hijack_cursor = cfg.hijackCursor;
sync_root_with_cwd = cfg.syncRootWithCwd; sync_root_with_cwd = cfg.syncRootWithCwd;
@ -278,6 +277,14 @@ in
nvim-web-devicons nvim-web-devicons
]; ];
autoCmd = mkIf (cfg.autoClose != null && cfg.autoClose) [
{
event = "BufEnter";
command = "if winnr('$') == 1 && bufname() == 'NvimTree_' . tabpagenr() | quit | endif";
nested = true;
}
];
extraConfigLua = '' extraConfigLua = ''
require('nvim-tree').setup(${helpers.toLuaObject options}) require('nvim-tree').setup(${helpers.toLuaObject options})
''; '';

View file

@ -6,7 +6,7 @@ let
in in
{ {
options.plugins.project-nvim = helpers.extraOptionsOptions // { options.plugins.project-nvim = helpers.extraOptionsOptions // {
enable = mkEnableOption "Enable project.nvim"; enable = mkEnableOption "project.nvim";
package = mkOption { package = mkOption {
type = types.package; type = types.package;

View file

@ -6,7 +6,7 @@ let
in in
{ {
options.plugins.specs = { options.plugins.specs = {
enable = mkEnableOption "Enable specs-nvim"; enable = mkEnableOption "specs-nvim";
package = mkOption { package = mkOption {
type = types.package; type = types.package;

View file

@ -182,7 +182,7 @@ mkPlugin args {
customHeader = mkDefaultOpt { customHeader = mkDefaultOpt {
description = "Define your own header"; description = "Define your own header";
global = "startify_custom_headers"; global = "startify_custom_header";
type = types.oneOf [ types.str (types.listOf types.str) ]; type = types.oneOf [ types.str (types.listOf types.str) ];
}; };

76
tests/flake.lock generated
View file

@ -10,11 +10,11 @@
"utils": "utils" "utils": "utils"
}, },
"locked": { "locked": {
"lastModified": 1667262410, "lastModified": 1669854260,
"narHash": "sha256-yqqvPvazG/Ci3WpIfPb+o+i2cNuyAYYY19lwJGCmUao=", "narHash": "sha256-Z8NAL3g4i5LAhxveNGJhrVDHxIBbUf1lVIy/Thr2RMU=",
"owner": "lovesegfault", "owner": "lovesegfault",
"repo": "beautysh", "repo": "beautysh",
"rev": "a1fdaff999db2dfc5032914630f5052360f4b432", "rev": "d616eb8d9d05ee4fb33de9c5521d99c3f0695d52",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -33,11 +33,11 @@
"utils": "utils_2" "utils": "utils_2"
}, },
"locked": { "locked": {
"lastModified": 1667262410, "lastModified": 1669854260,
"narHash": "sha256-yqqvPvazG/Ci3WpIfPb+o+i2cNuyAYYY19lwJGCmUao=", "narHash": "sha256-Z8NAL3g4i5LAhxveNGJhrVDHxIBbUf1lVIy/Thr2RMU=",
"owner": "lovesegfault", "owner": "lovesegfault",
"repo": "beautysh", "repo": "beautysh",
"rev": "a1fdaff999db2dfc5032914630f5052360f4b432", "rev": "d616eb8d9d05ee4fb33de9c5521d99c3f0695d52",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -128,11 +128,11 @@
"gleam": { "gleam": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1669665314, "lastModified": 1672454845,
"narHash": "sha256-aeho84P91cH13j7uLJwyD/zj8O/peROrpfa41HA/FGo=", "narHash": "sha256-h/5SpMD725BasD2+5J0B7OCDzoWlDBGDm7ywTEYmQbk=",
"owner": "gleam-lang", "owner": "gleam-lang",
"repo": "tree-sitter-gleam", "repo": "tree-sitter-gleam",
"rev": "97611918f79643ade377a156f3e4192cd50dc3e6", "rev": "3eb2e1783f3bf6f85c16cdd150e2f256b2f6844e",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -143,12 +143,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1663491030, "lastModified": 1671108576,
"narHash": "sha256-MVsfBhE9US5DvLtBAaTRjwYdv1tLO8xjahM8qLXTgTo=", "narHash": "sha256-6ggOL6KoaELNA1562tnPjtAnQ9SwsKRTgeuaXvPzCwI=",
"owner": "NixOS", "path": "/nix/store/iscn1qzhdwvb3mkr5kvsy9gvyhkdnzl3-source",
"repo": "nixpkgs", "rev": "0f5996b524c91677891a432cc99c7567c7c402b1",
"rev": "767542707d394ff15ac1981e903e005ba69528b5", "type": "path"
"type": "github"
}, },
"original": { "original": {
"id": "nixpkgs", "id": "nixpkgs",
@ -157,11 +156,11 @@
}, },
"nixpkgs-stable": { "nixpkgs-stable": {
"locked": { "locked": {
"lastModified": 1669546925, "lastModified": 1672580127,
"narHash": "sha256-Gvtk9agz88tBgqmCdHl5U7gYttTkiuEd8/Rq1Im0pTg=", "narHash": "sha256-3lW3xZslREhJogoOkjeZtlBtvFMyxHku7I/9IVehhT8=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "fecf05d4861f3985e8dee73f08bc82668ef75125", "rev": "0874168639713f547c05947c76124f78441ea46c",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -173,12 +172,11 @@
}, },
"nixpkgs_2": { "nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1663491030, "lastModified": 1671108576,
"narHash": "sha256-MVsfBhE9US5DvLtBAaTRjwYdv1tLO8xjahM8qLXTgTo=", "narHash": "sha256-6ggOL6KoaELNA1562tnPjtAnQ9SwsKRTgeuaXvPzCwI=",
"owner": "NixOS", "path": "/nix/store/iscn1qzhdwvb3mkr5kvsy9gvyhkdnzl3-source",
"repo": "nixpkgs", "rev": "0f5996b524c91677891a432cc99c7567c7c402b1",
"rev": "767542707d394ff15ac1981e903e005ba69528b5", "type": "path"
"type": "github"
}, },
"original": { "original": {
"id": "nixpkgs", "id": "nixpkgs",
@ -187,11 +185,11 @@
}, },
"nixpkgs_3": { "nixpkgs_3": {
"locked": { "locked": {
"lastModified": 1663491030, "lastModified": 1673606088,
"narHash": "sha256-MVsfBhE9US5DvLtBAaTRjwYdv1tLO8xjahM8qLXTgTo=", "narHash": "sha256-wdYD41UwNwPhTdMaG0AIe7fE1bAdyHe6bB4HLUqUvck=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "767542707d394ff15ac1981e903e005ba69528b5", "rev": "37b97ae3dd714de9a17923d004a2c5b5543dfa6d",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -207,12 +205,12 @@
}, },
"locked": { "locked": {
"lastModified": 0, "lastModified": 0,
"narHash": "sha256-008LHsZ1x6jTE46J4+E2jOQTAyexpf7M9fNqSsjQOds=", "narHash": "sha256-7N6OttwH7E7URRmQ79MacpMu4eSzxYlRgW06FOP/lWg=",
"path": "/nix/store/nj5i7q1lcsw9fzch5kha51li3c8w12h6-source", "path": "/nix/store/s8ql6s1cwxm1ah1pi4y6h4xv2mz2j4v1-source",
"type": "path" "type": "path"
}, },
"original": { "original": {
"path": "/nix/store/nj5i7q1lcsw9fzch5kha51li3c8w12h6-source", "path": "/nix/store/s8ql6s1cwxm1ah1pi4y6h4xv2mz2j4v1-source",
"type": "path" "type": "path"
} }
}, },
@ -226,12 +224,12 @@
}, },
"locked": { "locked": {
"lastModified": 0, "lastModified": 0,
"narHash": "sha256-008LHsZ1x6jTE46J4+E2jOQTAyexpf7M9fNqSsjQOds=", "narHash": "sha256-7N6OttwH7E7URRmQ79MacpMu4eSzxYlRgW06FOP/lWg=",
"path": "/nix/store/nj5i7q1lcsw9fzch5kha51li3c8w12h6-source", "path": "/nix/store/s8ql6s1cwxm1ah1pi4y6h4xv2mz2j4v1-source",
"type": "path" "type": "path"
}, },
"original": { "original": {
"path": "/nix/store/nj5i7q1lcsw9fzch5kha51li3c8w12h6-source", "path": "/nix/store/s8ql6s1cwxm1ah1pi4y6h4xv2mz2j4v1-source",
"type": "path" "type": "path"
} }
}, },
@ -302,11 +300,11 @@
}, },
"utils": { "utils": {
"locked": { "locked": {
"lastModified": 1667077288, "lastModified": 1667395993,
"narHash": "sha256-bdC8sFNDpT0HK74u9fUkpbf1MEzVYJ+ka7NXCdgBoaA=", "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
"owner": "numtide", "owner": "numtide",
"repo": "flake-utils", "repo": "flake-utils",
"rev": "6ee9ebb6b1ee695d2cacc4faa053a7b9baa76817", "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -317,11 +315,11 @@
}, },
"utils_2": { "utils_2": {
"locked": { "locked": {
"lastModified": 1667077288, "lastModified": 1667395993,
"narHash": "sha256-bdC8sFNDpT0HK74u9fUkpbf1MEzVYJ+ka7NXCdgBoaA=", "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
"owner": "numtide", "owner": "numtide",
"repo": "flake-utils", "repo": "flake-utils",
"rev": "6ee9ebb6b1ee695d2cacc4faa053a7b9baa76817", "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
"type": "github" "type": "github"
}, },
"original": { "original": {