Compare commits

..

3 commits

Author SHA1 Message Date
raf
09bd743ad6
Merge branch 'main' into notashelf/push-qozvyzsvqtmk 2026-02-01 18:14:14 +03:00
f8f1017411
modules: move mappings to neovim/init
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I9b04107496df27dcda1a24ce000da3f46a6a6964
2026-01-27 12:54:34 +03:00
91269c56c5
neovim/init: add module option for registering custom filetypes
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I5f5f576642884c09a8e4afc18499ed606a6a6964
2026-01-27 12:47:07 +03:00
27 changed files with 188 additions and 441 deletions

View file

@ -92,7 +92,6 @@ isMaximal: {
ruby.enable = false; ruby.enable = false;
fsharp.enable = false; fsharp.enable = false;
just.enable = false; just.enable = false;
make.enable = false;
qml.enable = false; qml.enable = false;
jinja.enable = false; jinja.enable = false;
tailwind.enable = false; tailwind.enable = false;
@ -205,7 +204,6 @@ isMaximal: {
smart-splits.enable = isMaximal; smart-splits.enable = isMaximal;
undotree.enable = isMaximal; undotree.enable = isMaximal;
nvim-biscuits.enable = isMaximal; nvim-biscuits.enable = isMaximal;
grug-far-nvim.enable = isMaximal;
motion = { motion = {
hop.enable = true; hop.enable = true;

View file

@ -25,12 +25,6 @@
- The `setupOpts.mappings` options were also removed. Use the built-in Neovim - The `setupOpts.mappings` options were also removed. Use the built-in Neovim
settings (nvf's {option}`vim.keymaps`) settings (nvf's {option}`vim.keymaps`)
[Snoweuph](https://github.com/snoweuph)
- Fix `vim.assistant.codecompanion-nvim.setupOpts.display.diff.provider` to only
allow valid options. `default` is no longer valid. `inline` and `split` are
two new valid options.
## Changelog {#sec-release-0-9-changelog} ## Changelog {#sec-release-0-9-changelog}
[taylrfnt](https://github.com/taylrfnt) [taylrfnt](https://github.com/taylrfnt)
@ -56,10 +50,6 @@
treesitter grammars were changed to prefer `grammarPlugins` over treesitter grammars were changed to prefer `grammarPlugins` over
`builtGrammars`. `builtGrammars`.
[NotAShelf](https://github.com/notashelf):
- Lazyload noice.nvim and nvim-web-devicons on `DeferredUIEnter`
[jfeo](https://github.com/jfeo): [jfeo](https://github.com/jfeo):
[ccc.nvim]: https://github.com/uga-rosa/ccc.nvim [ccc.nvim]: https://github.com/uga-rosa/ccc.nvim
@ -176,35 +166,10 @@
- Added [`golangci-lint`](https://golangci-lint.run/) for more diagnostics. - Added [`golangci-lint`](https://golangci-lint.run/) for more diagnostics.
- Added Makefile support via `languages.make`.
- Added Debugging support to `languages.php`.
- Added Formatting support to `languages.php` via
[PHP-CS-Fixer](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer).
- Didn't Add
[`syntax-gaslighting`](https://github.com/NotAShelf/syntax-gaslighting.nvim),
you're crazy.
[vagahbond](https://github.com/vagahbond): [codewindow.nvim]: [vagahbond](https://github.com/vagahbond): [codewindow.nvim]:
https://github.com/gorbit99/codewindow.nvim https://github.com/gorbit99/codewindow.nvim
- Add [codewindow.nvim] plugin in `vim.assistant.codewindow` with `enable` and - Add [codewindow.nvim] plugin in `vim.assistant.codewindow` with `enable` and
`setupOpts` `setupOpts`
[irobot](https://github.com/irobot):
- Fix non-functional `vim.keymaps.*.noremap`. Now, setting it to false is
equivalent to `:lua vim.keymap.set(..., { remap = true })`
[kazimazi](https://github.com/kazimazi):
- Added [`grug-far.nvim`](https://github.com/MagicDuck/grug-far.nvim) the find
and replace tool for neovim.
[Ladas552](https://github.com/Ladas552)
- Changed `withRuby` to not be enabled by default
<!-- vim: set textwidth=80: --> <!-- vim: set textwidth=80: -->

18
flake.lock generated
View file

@ -23,11 +23,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1769996383, "lastModified": 1768135262,
"narHash": "sha256-AnYjnFWgS49RlqX7LrC4uA+sCCDBj0Ry/WOJ5XWAsa0=", "narHash": "sha256-PVvu7OqHBGWN16zSi6tEmPwwHQ4rLPU9Plvs8/1TUBY=",
"owner": "hercules-ci", "owner": "hercules-ci",
"repo": "flake-parts", "repo": "flake-parts",
"rev": "57928607ea566b5db3ad13af0e57e921e6b12381", "rev": "80daad04eddbbf5a4d883996a73f3f542fa437ac",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -38,11 +38,11 @@
}, },
"mnw": { "mnw": {
"locked": { "locked": {
"lastModified": 1770419553, "lastModified": 1768701608,
"narHash": "sha256-b1XqsH7AtVf2dXmq2iyRr2NC1yG7skY7Z6N2MpWHlK4=", "narHash": "sha256-kSvWF3Xt2HW9hmV5V7i8PqeWJIBUKmuKoHhOgj3Znzs=",
"owner": "Gerg-L", "owner": "Gerg-L",
"repo": "mnw", "repo": "mnw",
"rev": "2aaffa8030d0b262176146adbb6b0e6374ce2957", "rev": "20d63a8a1ae400557c770052a46a9840e768926b",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -74,11 +74,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1771008912, "lastModified": 1769461804,
"narHash": "sha256-gf2AmWVTs8lEq7z/3ZAsgnZDhWIckkb+ZnAo5RzSxJg=", "narHash": "sha256-msG8SU5WsBUfVVa/9RPLaymvi5bI8edTavbIq3vRlhI=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "a82ccc39b39b621151d6732718e3e250109076fa", "rev": "bfc1b8a4574108ceef22f02bafcf6611380c100d",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -3,18 +3,17 @@
stdenv, stdenv,
rustPlatform, rustPlatform,
fetchFromGitHub, fetchFromGitHub,
rust-jemalloc-sys,
writeShellScriptBin, writeShellScriptBin,
}: }:
rustPlatform.buildRustPackage (finalAttrs: { rustPlatform.buildRustPackage (finalAttrs: {
pname = "blink-cmp"; pname = "blink-cmp";
version = "1.9.1"; version = "1.8.0";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "Saghen"; owner = "Saghen";
repo = "blink.cmp"; repo = "blink.cmp";
tag = "v${finalAttrs.version}"; tag = "v${finalAttrs.version}";
hash = "sha256-GgodXdWpQoF2z1g1/WvnSpfuhskw0aMcOoyZM5l66q8="; hash = "sha256-JjlcPj7v9J+v1SDBYIub6jFEslLhZGHmsipV1atUAFo=";
}; };
forceShare = [ forceShare = [
@ -32,16 +31,6 @@ rustPlatform.buildRustPackage (finalAttrs: {
mv "$out/lib" "$out/target/release" mv "$out/lib" "$out/target/release"
''; '';
# From the blink.cmp flake
buildInputs = lib.optionals stdenv.hostPlatform.isAarch64 [rust-jemalloc-sys];
# NOTE: The only change in frizbee 0.7.0 was nixpkgs incompatible rust semantic changes
# Patch just reverts https://github.com/saghen/blink.cmp/commit/cc824ec85b789a54d05241389993c6ab8c040810
# Taken from Nixpkgs' blink.cmp derivation, available under the MIT license
cargoPatches = [
./patches/0001-pin-frizbee.patch
];
cargoHash = "sha256-Qdt8O7IGj2HySb1jxsv3m33ZxJg96Ckw26oTEEyQjfs="; cargoHash = "sha256-Qdt8O7IGj2HySb1jxsv3m33ZxJg96Ckw26oTEEyQjfs=";
nativeBuildInputs = [ nativeBuildInputs = [

View file

@ -1,29 +0,0 @@
diff --git a/Cargo.lock b/Cargo.lock
index 35bb10e..71c79eb 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -144,9 +144,9 @@ checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719"
[[package]]
name = "frizbee"
-version = "0.7.0"
+version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4d024031f1a5bc5f19917baa0b618f1067610e35ba23e9f105653fcb27e74f5c"
+checksum = "c3365720de81dac18e889afa72f5907aa061c975548da68e2400c056ebc94aec"
dependencies = [
"multiversion",
"rayon",
diff --git a/Cargo.toml b/Cargo.toml
index 392d1bb..c776c7d 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -9,7 +9,7 @@ crate-type = ["cdylib"]
[dependencies]
regex = "1.11.2"
-frizbee = "0.7.0"
+frizbee = "0.6.0"
mlua = { version = "0.11.3", features = ["module", "luajit"] }
thiserror = "2.0.16"
blake3 = "1.8.2"

View file

@ -3,8 +3,6 @@
fetchFromGitHub, fetchFromGitHub,
nodejs, nodejs,
pnpm_9, pnpm_9,
pnpmConfigHook,
fetchPnpmDeps,
pins, pins,
}: let }: let
pin = pins.prettier-plugin-astro; pin = pins.prettier-plugin-astro;
@ -19,8 +17,7 @@ in
sha256 = pin.hash; sha256 = pin.hash;
}; };
pnpmDeps = fetchPnpmDeps { pnpmDeps = pnpm_9.fetchDeps {
pnpm = pnpm_9;
inherit (finalAttrs) pname src; inherit (finalAttrs) pname src;
fetcherVersion = 2; fetcherVersion = 2;
hash = "sha256-K7pIWLkIIbUKDIcysfEtcf/eVMX9ZgyFHdqcuycHCNE="; hash = "sha256-K7pIWLkIIbUKDIcysfEtcf/eVMX9ZgyFHdqcuycHCNE=";
@ -28,9 +25,7 @@ in
nativeBuildInputs = [ nativeBuildInputs = [
nodejs nodejs
(pnpmConfigHook.overrideAttrs { pnpm_9.configHook
propagatedBuildInputs = [pnpm_9];
})
]; ];
buildPhase = '' buildPhase = ''

View file

@ -19,7 +19,7 @@
luaInline # `function(path, bufnr) ... end` luaInline # `function(path, bufnr) ... end`
# { 'dosini', { priority = 10 } }, # { 'dosini', { priority = 10 } },
(listOf (either (either str luaInline) (submodule (submodule { (listOf (either str (submodule {
options = { options = {
priority = mkOption { priority = mkOption {
type = ints.unsigned; type = ints.unsigned;
@ -31,7 +31,7 @@
''; '';
}; };
}; };
})))) })))
]); ]);
in { in {
options.vim.filetype = mkOption { options.vim.filetype = mkOption {
@ -80,8 +80,7 @@ in {
extension = { extension = {
mdx = "markdown"; mdx = "markdown";
bar = lib.generators.mkLuaInline '' bar = lib.mkLuaInline ''
{
bar = function(path, bufnr) bar = function(path, bufnr)
if some_condition() then if some_condition() then
return 'barscript', function(bufnr) return 'barscript', function(bufnr)
@ -91,7 +90,6 @@ in {
end end
return 'bar' return 'bar'
end, end,
}
''; '';
}; };
}; };

View file

@ -59,8 +59,8 @@ in {
}; };
provider = mkOption { provider = mkOption {
type = enum ["inline" "split" "mini_diff"]; type = enum ["default" "mini_diff"];
default = "inline"; default = "default";
description = "The preferred kind of provider."; description = "The preferred kind of provider.";
}; };
}; };

View file

@ -52,7 +52,6 @@ in {
./yaml.nix ./yaml.nix
./ruby.nix ./ruby.nix
./just.nix ./just.nix
./make.nix
./xml.nix ./xml.nix
# This is now a hard deprecation. # This is now a hard deprecation.

View file

@ -1,93 +0,0 @@
{
config,
lib,
pkgs,
...
}: let
inherit (builtins) attrNames;
inherit (lib.options) mkEnableOption mkOption;
inherit (lib.meta) getExe;
inherit (lib.types) listOf enum;
inherit (lib.modules) mkIf mkMerge;
inherit (lib.nvim.types) mkGrammarOption diagnostics;
inherit (lib.nvim.attrsets) mapListToAttrs;
cfg = config.vim.languages.make;
defaultFormat = ["bake"];
formats = {
bake = {
command = "${pkgs.mbake}/bin/mbake";
};
};
defaultDiagnosticsProvider = ["checkmake"];
diagnosticsProviders = {
checkmake = {
config = {
cmd = getExe pkgs.checkmake;
};
};
};
in {
options.vim.languages.make = {
enable = mkEnableOption "Make support";
treesitter = {
enable = mkEnableOption "Make treesitter" // {default = config.vim.languages.enableTreesitter;};
package = mkGrammarOption pkgs "make";
};
format = {
enable = mkEnableOption "Make formatting" // {default = config.vim.languages.enableFormat;};
type = mkOption {
description = "make formatter to use";
type = listOf (enum (attrNames formats));
default = defaultFormat;
};
};
extraDiagnostics = {
enable = mkEnableOption "extra Make diagnostics" // {default = config.vim.languages.enableExtraDiagnostics;};
types = diagnostics {
langDesc = "Make";
inherit diagnosticsProviders;
inherit defaultDiagnosticsProvider;
};
};
};
config = mkIf cfg.enable (mkMerge [
(mkIf cfg.treesitter.enable {
vim.treesitter = {
enable = true;
grammars = [cfg.treesitter.package];
};
})
(mkIf cfg.format.enable {
vim.formatter.conform-nvim = {
enable = true;
setupOpts = {
formatters_by_ft.make = cfg.format.type;
formatters =
mapListToAttrs (name: {
inherit name;
value = formats.${name};
})
cfg.format.type;
};
};
})
(mkIf cfg.extraDiagnostics.enable {
vim.diagnostics.nvim-lint = {
enable = true;
linters_by_ft.make = cfg.extraDiagnostics.types;
linters =
mkMerge (map (name: {${name} = diagnosticsProviders.${name}.config;})
cfg.extraDiagnostics.types);
};
})
]);
}

View file

@ -4,12 +4,11 @@
lib, lib,
... ...
}: let }: let
inherit (builtins) attrNames toString; inherit (builtins) attrNames;
inherit (lib.options) mkEnableOption mkOption; inherit (lib.options) mkEnableOption mkOption;
inherit (lib.meta) getExe; inherit (lib.meta) getExe;
inherit (lib.modules) mkIf mkMerge; inherit (lib.modules) mkIf mkMerge;
inherit (lib.types) enum int attrs listOf; inherit (lib.types) enum;
inherit (lib.nvim.lua) toLuaObject;
inherit (lib.nvim.types) mkGrammarOption deprecatedSingleOrListOf; inherit (lib.nvim.types) mkGrammarOption deprecatedSingleOrListOf;
inherit (lib.nvim.attrsets) mapListToAttrs; inherit (lib.nvim.attrsets) mapListToAttrs;
inherit (lib.generators) mkLuaInline; inherit (lib.generators) mkLuaInline;
@ -65,21 +64,6 @@
root_markers = ["composer.json" ".git"]; root_markers = ["composer.json" ".git"];
}; };
}; };
defaultFormat = ["php_cs_fixer"];
formats = {
php_cs_fixer = {
/*
Using 8.4 instead of 8.5 because of compatibility:
```logs
2026-02-08 00:42:23[ERROR] Formatter 'php_cs_fixer' error: PHP CS Fixer 3.87.2
PHP runtime: 8.5.2
PHP CS Fixer currently supports PHP syntax only up to PHP 8.4, current PHP version: 8.5.2.
```
*/
command = "${pkgs.php84Packages.php-cs-fixer}/bin/php-cs-fixer";
};
};
in { in {
options.vim.languages.php = { options.vim.languages.php = {
enable = mkEnableOption "PHP language support"; enable = mkEnableOption "PHP language support";
@ -98,38 +82,6 @@ in {
description = "PHP LSP server to use"; description = "PHP LSP server to use";
}; };
}; };
format = {
enable = mkEnableOption "PHP formatting" // {default = config.vim.languages.enableFormat;};
type = mkOption {
description = "PHP formatter to use";
type = listOf (enum (attrNames formats));
default = defaultFormat;
};
};
dap = {
enable = mkEnableOption "Enable PHP Debug Adapter" // {default = config.vim.languages.enableDAP;};
xdebug = {
adapter = mkOption {
type = attrs;
default = {
type = "executable";
command = "${pkgs.nodePackages_latest.nodejs}/bin/node";
args = [
"${pkgs.vscode-extensions.xdebug.php-debug}/share/vscode/extensions/xdebug.php-debug/out/phpDebug.js"
];
};
description = "XDebug adapter to use for nvim-dap";
};
port = mkOption {
type = int;
default = 9003;
description = "Port to use for XDebug";
};
};
};
}; };
config = mkIf cfg.enable (mkMerge [ config = mkIf cfg.enable (mkMerge [
@ -146,39 +98,5 @@ in {
}) })
cfg.lsp.servers; cfg.lsp.servers;
}) })
(mkIf cfg.format.enable {
vim.formatter.conform-nvim = {
enable = true;
setupOpts = {
formatters_by_ft.php = cfg.format.type;
formatters =
mapListToAttrs (name: {
inherit name;
value = formats.${name};
})
cfg.format.type;
};
};
})
(mkIf cfg.dap.enable {
vim = {
debugger.nvim-dap = {
enable = true;
sources.php-debugger = ''
dap.adapters.xdebug = ${toLuaObject cfg.dap.xdebug.adapter}
dap.configurations.php = {
{
type = 'xdebug',
request = 'launch',
name = 'Listen for XDebug',
port = ${toString cfg.dap.xdebug.port},
},
}
'';
};
};
})
]); ]);
} }

View file

@ -6,6 +6,8 @@
}: let }: let
inherit (lib.modules) mkIf; inherit (lib.modules) mkIf;
inherit (lib.lists) optionals; inherit (lib.lists) optionals;
inherit (lib.nvim.lua) toLuaObject;
inherit (lib.nvim.dag) entryAnywhere;
cfg = config.vim.ui.noice; cfg = config.vim.ui.noice;
tscfg = config.vim.treesitter; tscfg = config.vim.treesitter;
@ -14,15 +16,16 @@
in { in {
config = mkIf cfg.enable { config = mkIf cfg.enable {
vim = { vim = {
startPlugins = ["nui-nvim"]; startPlugins = [
"noice-nvim"
"nui-nvim"
];
treesitter.grammars = optionals tscfg.addDefaultGrammars defaultGrammars; treesitter.grammars = optionals tscfg.addDefaultGrammars defaultGrammars;
lazy.plugins.noice-nvim = { pluginRC.noice-nvim = entryAnywhere ''
package = "noice-nvim"; require("noice").setup(${toLuaObject cfg.setupOpts})
setupModule = "noice"; '';
event = ["DeferredUIEnter"];
inherit (cfg) setupOpts;
};
}; };
}; };
} }

View file

@ -9,7 +9,6 @@
./harpoon ./harpoon
./icon-picker ./icon-picker
./images ./images
./grug-far-nvim
./leetcode-nvim ./leetcode-nvim
./mkdir ./mkdir
./motion ./motion

View file

@ -1,21 +0,0 @@
{
config,
lib,
...
}: let
inherit (lib.modules) mkIf;
cfg = config.vim.utility.grug-far-nvim;
in {
config = {
vim.lazy.plugins.grug-far-nvim = mkIf cfg.enable {
package = "grug-far-nvim";
cmd = [
"GrugFar"
"GrugFarWithin"
];
setupModule = "grug-far";
setupOpts = cfg.setupOpts;
};
};
}

View file

@ -1,6 +0,0 @@
{
imports = [
./grug-far-nvim.nix
./config.nix
];
}

View file

@ -1,9 +0,0 @@
{lib, ...}: let
inherit (lib.options) mkEnableOption;
inherit (lib.nvim.types) mkPluginSetupOption;
in {
options.vim.utility.grug-far-nvim = {
enable = mkEnableOption "grug-far";
setupOpts = mkPluginSetupOption "grug-far" {};
};
}

View file

@ -18,6 +18,5 @@ in {
./nvim-web-devicons ./nvim-web-devicons
./rainbow-delimiters ./rainbow-delimiters
./tiny-devicons-auto-colors ./tiny-devicons-auto-colors
./syntax-gaslighting
]; ];
} }

View file

@ -4,17 +4,18 @@
... ...
}: let }: let
inherit (lib.modules) mkIf; inherit (lib.modules) mkIf;
inherit (lib.nvim.lua) toLuaObject;
inherit (lib.nvim.dag) entryAnywhere;
cfg = config.vim.visuals.nvim-web-devicons; cfg = config.vim.visuals.nvim-web-devicons;
in { in {
config = mkIf cfg.enable { config = mkIf cfg.enable {
vim = { vim = {
lazy.plugins.nvim-web-devicons = { startPlugins = ["nvim-web-devicons"];
package = "nvim-web-devicons";
setupModule = "nvim-web-devicons"; pluginRC.nvim-web-devicons = entryAnywhere ''
event = ["DeferredUIEnter"]; require("nvim-web-devicons").setup(${toLuaObject cfg.setupOpts})
inherit (cfg) setupOpts; '';
};
}; };
}; };
} }

View file

@ -1,6 +1,6 @@
{lib, ...}: let {lib, ...}: let
inherit (lib.modules) mkRenamedOptionModule; inherit (lib.modules) mkRenamedOptionModule;
inherit (lib.options) mkOption mkEnableOption; inherit (lib.options) mkOption mkEnableOption literalExpression;
inherit (lib.types) nullOr attrsOf attrs enum; inherit (lib.types) nullOr attrsOf attrs enum;
inherit (lib.nvim.types) mkPluginSetupOption; inherit (lib.nvim.types) mkPluginSetupOption;
in { in {
@ -16,27 +16,27 @@ in {
variant = mkOption { variant = mkOption {
type = nullOr (enum ["light" "dark"]); type = nullOr (enum ["light" "dark"]);
default = null; default = null;
description = '' description = "Set the light or dark variant manually, instead of relying on `background`";
Set the light or dark variant manually, instead of relying on `background`
'';
}; };
override = mkOption { override = mkOption {
type = attrsOf attrs; type = attrsOf attrs;
default = {}; default = {};
example = { example = literalExpression ''
{
zsh = { zsh = {
name = "Zsh"; name = "Zsh";
icon = ""; icon = "";
color = "#428850"; color = "#428850";
cterm_color = "65"; cterm_color = "65";
}; };
}; }
'';
description = '' description = ''
Your personal icon overrides. Your personal icon overrides.
You can specify color or `cterm_color` instead of specifying both of You can specify color or cterm_color instead of specifying
them. `DevIcon` will be appended to `name` both of them. DevIcon will be appended to `name`
''; '';
}; };
}; };

View file

@ -1,20 +0,0 @@
{
config,
lib,
...
}: let
inherit (lib.modules) mkIf;
inherit (lib.nvim.dag) entryAnywhere;
inherit (lib.nvim.lua) toLuaObject;
cfg = config.vim.visuals.syntax-gaslighting;
in {
config = mkIf cfg.enable {
vim = {
startPlugins = ["syntax-gaslighting"];
pluginRC.colorful-menu-nvim = entryAnywhere ''
require("syntax-gaslighting").setup(${toLuaObject cfg.setupOpts})
'';
};
};
}

View file

@ -1,6 +0,0 @@
{
imports = [
./syntax-gaslighting.nix
./config.nix
];
}

View file

@ -1,28 +0,0 @@
{lib, ...}: let
inherit (lib.options) mkOption mkEnableOption;
inherit (lib.types) str nullOr listOf bool;
inherit (lib.nvim.types) mkPluginSetupOption;
in {
options.vim.visuals = {
syntax-gaslighting = {
enable = mkEnableOption "Thats no even a real option, you're crazy.";
setupOpts = mkPluginSetupOption "syntax-gaslighting" {
messages = mkOption {
type = nullOr (listOf str);
default = null;
description = "Custom messages for gaslighting.";
};
merge_messages = mkOption {
type = bool;
default = false;
description = ''
Merge user messages with the default ones.
If disabled, the messages table will override default messages.
'';
};
};
};
};
}

View file

@ -9,7 +9,7 @@
inherit (lib.trivial) flip; inherit (lib.trivial) flip;
inherit (builtins) filter isString hasAttr getAttr; inherit (builtins) filter isString hasAttr getAttr;
getPin = flip getAttr (inputs.mnw.lib.npinsToPluginsAttrs pkgs ../../../npins/sources.json); getPin = flip getAttr (pkgs.callPackages ../../../npins/sources.nix {});
# Build a Vim plugin with the given name and arguments. # Build a Vim plugin with the given name and arguments.
buildPlug = attrs: let buildPlug = attrs: let

View file

@ -106,9 +106,16 @@ in {
''; '';
}; };
withRuby = mkEnableOption '' # This defaults to `true` in the wrapper
Ruby support in the Neovim wrapper # and since we pass this value to the wrapper
''; # with an inherit, it should be `true` here as well
withRuby =
mkEnableOption ''
Ruby support in the Neovim wrapper.
''
// {
default = true;
};
withNodeJs = mkEnableOption '' withNodeJs = mkEnableOption ''
NodeJS support in the Neovim wrapper NodeJS support in the Neovim wrapper

View file

@ -39,7 +39,6 @@ in {
getOpts = keymap: { getOpts = keymap: {
inherit (keymap) desc silent nowait script expr unique noremap; inherit (keymap) desc silent nowait script expr unique noremap;
remap = !keymap.noremap;
}; };
toLuaKeymap = bind: "vim.keymap.set(${toLuaObject bind.mode}, ${toLuaObject bind.key}, ${toLuaObject (getAction bind)}, ${toLuaObject (getOpts bind)})"; toLuaKeymap = bind: "vim.keymap.set(${toLuaObject bind.mode}, ${toLuaObject bind.key}, ${toLuaObject (getAction bind)}, ${toLuaObject (getOpts bind)})";

View file

@ -643,19 +643,6 @@
"url": "https://github.com/ellisonleao/glow.nvim/archive/5d5954b2f22e109d4a6eba8b2618c5b96e4ee7a2.tar.gz", "url": "https://github.com/ellisonleao/glow.nvim/archive/5d5954b2f22e109d4a6eba8b2618c5b96e4ee7a2.tar.gz",
"hash": "sha256-CvBcmVWBgI+m+PS7p7PmsiPtTEfqx2kpIzz4mImONIc=" "hash": "sha256-CvBcmVWBgI+m+PS7p7PmsiPtTEfqx2kpIzz4mImONIc="
}, },
"grug-far-nvim": {
"type": "Git",
"repository": {
"type": "GitHub",
"owner": "MagicDuck",
"repo": "grug-far.nvim"
},
"branch": "main",
"submodules": false,
"revision": "275dbedc96e61a6b8d1dfb28ba51586ddd233dcf",
"url": "https://github.com/MagicDuck/grug-far.nvim/archive/275dbedc96e61a6b8d1dfb28ba51586ddd233dcf.tar.gz",
"hash": "sha256-qn1BTNCX0Sm158Lv5JfHThqlJX9ualCIlc+RCjWa+t8="
},
"gruvbox": { "gruvbox": {
"type": "Git", "type": "Git",
"repository": { "repository": {
@ -2129,9 +2116,9 @@
}, },
"branch": "master", "branch": "master",
"submodules": false, "submodules": false,
"revision": "746ffbb17975ebd6c40142362eee1b0249969c5c", "revision": "b8221e42cf7287c4dcde81f232f58d7b947c210d",
"url": "https://github.com/nvim-tree/nvim-web-devicons/archive/746ffbb17975ebd6c40142362eee1b0249969c5c.tar.gz", "url": "https://github.com/nvim-tree/nvim-web-devicons/archive/b8221e42cf7287c4dcde81f232f58d7b947c210d.tar.gz",
"hash": "sha256-jXWBPcfLwSkWQ/eRbxVDWC7kFOODSsCRmzC3rHKQLhQ=" "hash": "sha256-lVrakFrpIP9lp7sMfMb33KeMPIkcn1qBFVytJzKCfuE="
}, },
"obsidian-nvim": { "obsidian-nvim": {
"type": "GitRelease", "type": "GitRelease",
@ -2541,19 +2528,6 @@
"url": "https://github.com/supermaven-inc/supermaven-nvim/archive/07d20fce48a5629686aefb0a7cd4b25e33947d50.tar.gz", "url": "https://github.com/supermaven-inc/supermaven-nvim/archive/07d20fce48a5629686aefb0a7cd4b25e33947d50.tar.gz",
"hash": "sha256-1z3WKIiikQqoweReUyK5O8MWSRN5y95qcxM6qzlKMME=" "hash": "sha256-1z3WKIiikQqoweReUyK5O8MWSRN5y95qcxM6qzlKMME="
}, },
"syntax-gaslighting": {
"type": "Git",
"repository": {
"type": "GitHub",
"owner": "NotAShelf",
"repo": "syntax-gaslighting.nvim"
},
"branch": "main",
"submodules": false,
"revision": "4cee4c0550e82b31e07424e0c44379920d716d79",
"url": "https://github.com/NotAShelf/syntax-gaslighting.nvim/archive/4cee4c0550e82b31e07424e0c44379920d716d79.tar.gz",
"hash": "sha256-sRg6UlK4hQubxf3ycGnMLi+tNvX3zvKgnHYVuZgmvOc="
},
"tabular": { "tabular": {
"type": "Git", "type": "Git",
"repository": { "repository": {

115
npins/sources.nix Normal file
View file

@ -0,0 +1,115 @@
{
lib,
fetchurl,
fetchgit,
fetchzip,
}:
builtins.mapAttrs
(
name: spec: let
mayOverride = name: path: let
envVarName = "NPINS_OVERRIDE_${saneName}";
saneName = builtins.concatStringsSep "_" (
builtins.concatLists (
builtins.filter (x: builtins.isList x && x != [""]) (builtins.split "([a-zA-Z0-9]*)" name)
)
);
ersatz = builtins.getEnv envVarName;
in
if ersatz == ""
then path
else
# this turns the string into an actual Nix path (for both absolute and
# relative paths)
builtins.trace "Overriding path of \"${name}\" with \"${ersatz}\" due to set \"${envVarName}\"" (
if builtins.substring 0 1 ersatz == "/"
then /. + ersatz
else /. + builtins.getEnv "PWD" + "/${ersatz}"
);
path =
rec {
GitRelease = Git;
Channel = Tarball;
Git =
if spec.url != null && !spec.submodules
then Tarball
else
fetchgit (
let
repo = spec.repository;
url =
{
Git = repo.url;
GitHub = "https://github.com/${repo.owner}/${repo.repo}.git";
GitLab = "${repo.server}/${repo.repo_path}.git";
Forgejo = "${repo.server}/${repo.owner}/${repo.repo}.git";
}
.${
repo.type
} or (throw "Unrecognized repository type ${repo.type}");
in {
name = let
matched = builtins.match "^.*/([^/]*)(\\.git)?$" url;
appendShort =
if (builtins.match "[a-f0-9]*" spec.revision) != null
then "-${builtins.substring 0 7 spec.revision}"
else "";
in "${
if matched == null
then "source"
else builtins.head matched
}${appendShort}";
inherit url;
rev = spec.revision;
inherit (spec) hash;
fetchSubmodules = spec.submodules;
}
);
PyPi = fetchurl {
inherit (spec) url hash;
};
Tarball = fetchzip {
inherit (spec) url hash;
extension = "tar";
};
}
.${
spec.type
} or (builtins.throw "Unknown source type ${spec.type}");
version =
if spec ? revision
then builtins.substring 0 8 spec.revision
else "0";
in
spec
// {
name = "${name}-${version}";
pname = name;
inherit version;
outPath =
(
# Override logic won't do anything if we're in pure eval
if builtins ? currentSystem
then mayOverride name path
else path
).overrideAttrs
{
pname = name;
name = "${name}-${version}";
inherit version;
};
}
)
(
let
json = lib.importJSON ./sources.json;
in
assert lib.assertMsg (json.version == 7) "Unsupported format version ${toString json.version} in sources.json. Try running `npins upgrade`";
json.pins
)