neovim lspconfig

This commit is contained in:
Tristan 2023-12-23 15:43:26 +00:00
parent fb5c04a84a
commit 34aaaf63d2
29 changed files with 1705 additions and 1399 deletions

View file

@ -1,9 +1,13 @@
{ user }: { lib, pkgs, config, ... }:
with lib;
let
{user}: {
lib,
pkgs,
config,
...
}:
with lib; let
scripts = config.programs.scripts;
hotkeyType = types.submodule ({ ... }: {
hotkeyType = types.submodule ({...}: {
options = {
key = mkOption {
description = "the key";
@ -19,7 +23,7 @@ let
};
});
scriptType = types.submodule ({ ... }: {
scriptType = types.submodule ({...}: {
options = {
name = mkOption {
description = "name of the executable";
@ -30,7 +34,7 @@ let
hotkeys = mkOption {
type = types.listOf hotkeyType;
description = "keys that run this script";
default = [ ];
default = [];
};
install = mkOption {
type = types.bool;
@ -42,33 +46,35 @@ let
scriptToPackage = script:
pkgs.writeShellScriptBin script.name script.text;
scriptExec = { script, hotkey }:
"${scriptToPackage script}/bin/${script.name} ${hotkey.args}";
scriptExec = {
script,
hotkey,
}: "${scriptToPackage script}/bin/${script.name} ${hotkey.args}";
installScripts = scripts:
(map scriptToPackage (filter (s: s.install) scripts));
installScripts = scripts: (map scriptToPackage (filter (s: s.install) scripts));
bindScript = script: concatStrings (
map
(hotkey:
"${hotkey.modifier}, ${hotkey.key}, exec, ${scriptExec {inherit script hotkey;}}"
bindScript = script:
concatStrings (
map
(
hotkey: "${hotkey.modifier}, ${hotkey.key}, exec, ${scriptExec {inherit script hotkey;}}"
)
script.hotkeys);
in
{
script.hotkeys
);
in {
options.programs = {
scripts = mkOption {
type = types.listOf scriptType;
default = [ ];
default = [];
};
};
config = {
home-manager.users.${user}.imports = [{
home.packages = installScripts scripts;
wayland.windowManager.hyprland.settings.bind = (map bindScript scripts);
}];
home-manager.users.${user}.imports = [
{
home.packages = installScripts scripts;
wayland.windowManager.hyprland.settings.bind = map bindScript scripts;
}
];
};
}