adding helix, vanilla neovim
This commit is contained in:
302
flake.lock
generated
302
flake.lock
generated
@@ -150,6 +150,27 @@
|
||||
}
|
||||
},
|
||||
"crane": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"helix",
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1709610799,
|
||||
"narHash": "sha256-5jfLQx0U9hXbi2skYMGodDJkIgffrjIOgMRjZqms2QE=",
|
||||
"owner": "ipetkov",
|
||||
"repo": "crane",
|
||||
"rev": "81c393c776d5379c030607866afef6406ca1be57",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "ipetkov",
|
||||
"repo": "crane",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"crane_2": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"lanzaboote",
|
||||
@@ -457,6 +478,59 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-utils_4": {
|
||||
"inputs": {
|
||||
"systems": "systems_6"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1709126324,
|
||||
"narHash": "sha256-q6EQdSeUZOG26WelxqkmR7kArjgWCdw5sfJVHPH/7j8=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "d465f4819400de7c8d874d50b982301f28a84605",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-utils_5": {
|
||||
"inputs": {
|
||||
"systems": "systems_9"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1710146030,
|
||||
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"freetype2": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1687587065,
|
||||
"narHash": "sha256-+Fh+/k+NWL5Ow9sDLtp8Cv/8rLNA1oByQQCIQS/bysY=",
|
||||
"owner": "wez",
|
||||
"repo": "freetype2",
|
||||
"rev": "e4586d960f339cf75e2e0b34aee30a0ed8353c0d",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "wez",
|
||||
"repo": "freetype2",
|
||||
"rev": "e4586d960f339cf75e2e0b34aee30a0ed8353c0d",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"gitignore": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
@@ -494,6 +568,45 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"harfbuzz": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1711722720,
|
||||
"narHash": "sha256-GdxcAPx5QyniSHPAN1ih28AD9JLUPR0ItqW9JEsl3pU=",
|
||||
"owner": "harfbuzz",
|
||||
"repo": "harfbuzz",
|
||||
"rev": "63973005bc07aba599b47fdd4cf788647b601ccd",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "harfbuzz",
|
||||
"ref": "8.4.0",
|
||||
"repo": "harfbuzz",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"helix": {
|
||||
"inputs": {
|
||||
"crane": "crane",
|
||||
"flake-utils": "flake-utils_4",
|
||||
"nixpkgs": "nixpkgs_4",
|
||||
"rust-overlay": "rust-overlay"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1722261200,
|
||||
"narHash": "sha256-t/z874HWh74Y87m/6QWP1piwwf/9egrrBAYo66340FI=",
|
||||
"owner": "SoraTenshi",
|
||||
"repo": "helix",
|
||||
"rev": "a1260d4e315670ad9ee70060dae6ed668655a59c",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "SoraTenshi",
|
||||
"ref": "new-daily-driver",
|
||||
"repo": "helix",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"hercules-ci-effects": {
|
||||
"inputs": {
|
||||
"flake-parts": [
|
||||
@@ -650,8 +763,8 @@
|
||||
"hyprlang": "hyprlang",
|
||||
"hyprutils": "hyprutils",
|
||||
"hyprwayland-scanner": "hyprwayland-scanner",
|
||||
"nixpkgs": "nixpkgs_4",
|
||||
"systems": "systems_6",
|
||||
"nixpkgs": "nixpkgs_5",
|
||||
"systems": "systems_7",
|
||||
"xdph": "xdph"
|
||||
},
|
||||
"locked": {
|
||||
@@ -913,12 +1026,12 @@
|
||||
},
|
||||
"lanzaboote": {
|
||||
"inputs": {
|
||||
"crane": "crane",
|
||||
"crane": "crane_2",
|
||||
"flake-compat": "flake-compat_3",
|
||||
"flake-parts": "flake-parts_3",
|
||||
"nixpkgs": "nixpkgs_5",
|
||||
"nixpkgs": "nixpkgs_6",
|
||||
"pre-commit-hooks-nix": "pre-commit-hooks-nix",
|
||||
"rust-overlay": "rust-overlay"
|
||||
"rust-overlay": "rust-overlay_2"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1722329086,
|
||||
@@ -953,9 +1066,26 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"libpng": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1549245649,
|
||||
"narHash": "sha256-1+cRp0Ungme/OGfc9kGJbklYIWAFxk8Il1M+NV4KSgw=",
|
||||
"owner": "glennrp",
|
||||
"repo": "libpng",
|
||||
"rev": "8439534daa1d3a5705ba92e653eda9251246dd61",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "glennrp",
|
||||
"repo": "libpng",
|
||||
"rev": "8439534daa1d3a5705ba92e653eda9251246dd61",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"microfetch": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs_6"
|
||||
"nixpkgs": "nixpkgs_7"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1723918449,
|
||||
@@ -1154,6 +1284,22 @@
|
||||
}
|
||||
},
|
||||
"nixpkgs_4": {
|
||||
"locked": {
|
||||
"lastModified": 1709479366,
|
||||
"narHash": "sha256-n6F0n8UV6lnTZbYPl1A9q1BS0p4hduAv1mGAP17CVd0=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "b8697e57f10292a6165a20f03d2f42920dfaf973",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nixos",
|
||||
"ref": "nixos-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs_5": {
|
||||
"locked": {
|
||||
"lastModified": 1725103162,
|
||||
"narHash": "sha256-Ym04C5+qovuQDYL/rKWSR+WESseQBbNAe5DsXNx5trY=",
|
||||
@@ -1169,7 +1315,7 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs_5": {
|
||||
"nixpkgs_6": {
|
||||
"locked": {
|
||||
"lastModified": 1722264024,
|
||||
"narHash": "sha256-gomyYQrlOltr2/prDRikRDQoPz+J5Qq6SEJrqVC5x2c=",
|
||||
@@ -1185,7 +1331,7 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs_6": {
|
||||
"nixpkgs_7": {
|
||||
"locked": {
|
||||
"lastModified": 1722719969,
|
||||
"narHash": "sha256-E47qbT/mRtBCSZra+9S9208sp/QnNeOAq7EhHX+eMNE=",
|
||||
@@ -1200,7 +1346,7 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs_7": {
|
||||
"nixpkgs_8": {
|
||||
"locked": {
|
||||
"lastModified": 1725103162,
|
||||
"narHash": "sha256-Ym04C5+qovuQDYL/rKWSR+WESseQBbNAe5DsXNx5trY=",
|
||||
@@ -1256,6 +1402,7 @@
|
||||
"flake-parts": "flake-parts_2",
|
||||
"flake-utils": "flake-utils_3",
|
||||
"hardware": "hardware",
|
||||
"helix": "helix",
|
||||
"hm": "hm",
|
||||
"hypridle": "hypridle",
|
||||
"hyprland": "hyprland",
|
||||
@@ -1266,9 +1413,10 @@
|
||||
"microfetch": "microfetch",
|
||||
"nix-gaming": "nix-gaming",
|
||||
"nixpak": "nixpak",
|
||||
"nixpkgs": "nixpkgs_7",
|
||||
"nixpkgs": "nixpkgs_8",
|
||||
"nixpkgs-small": "nixpkgs-small",
|
||||
"systems": "systems_7"
|
||||
"systems": "systems_8",
|
||||
"wezterm": "wezterm"
|
||||
}
|
||||
},
|
||||
"rust-analyzer-src": {
|
||||
@@ -1306,6 +1454,31 @@
|
||||
}
|
||||
},
|
||||
"rust-overlay": {
|
||||
"inputs": {
|
||||
"flake-utils": [
|
||||
"helix",
|
||||
"flake-utils"
|
||||
],
|
||||
"nixpkgs": [
|
||||
"helix",
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1709604635,
|
||||
"narHash": "sha256-le4fwmWmjGRYWwkho0Gr7mnnZndOOe4XGbLw68OvF40=",
|
||||
"owner": "oxalica",
|
||||
"repo": "rust-overlay",
|
||||
"rev": "e86c0fb5d3a22a5f30d7f64ecad88643fe26449d",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "oxalica",
|
||||
"repo": "rust-overlay",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"rust-overlay_2": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"lanzaboote",
|
||||
@@ -1326,6 +1499,27 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"rust-overlay_3": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"wezterm",
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1721441897,
|
||||
"narHash": "sha256-gYGX9/22tPNeF7dR6bWN5rsrpU4d06GnQNNgZ6ZiXz0=",
|
||||
"owner": "oxalica",
|
||||
"repo": "rust-overlay",
|
||||
"rev": "b7996075da11a2d441cfbf4e77c2939ce51506fd",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "oxalica",
|
||||
"repo": "rust-overlay",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"systems": {
|
||||
"locked": {
|
||||
"lastModified": 1681028828,
|
||||
@@ -1403,16 +1597,16 @@
|
||||
},
|
||||
"systems_6": {
|
||||
"locked": {
|
||||
"lastModified": 1689347949,
|
||||
"narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=",
|
||||
"lastModified": 1681028828,
|
||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||
"owner": "nix-systems",
|
||||
"repo": "default-linux",
|
||||
"rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68",
|
||||
"repo": "default",
|
||||
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-systems",
|
||||
"repo": "default-linux",
|
||||
"repo": "default",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
@@ -1431,6 +1625,36 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"systems_8": {
|
||||
"locked": {
|
||||
"lastModified": 1689347949,
|
||||
"narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=",
|
||||
"owner": "nix-systems",
|
||||
"repo": "default-linux",
|
||||
"rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-systems",
|
||||
"repo": "default-linux",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"systems_9": {
|
||||
"locked": {
|
||||
"lastModified": 1681028828,
|
||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"umu": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
@@ -1456,6 +1680,35 @@
|
||||
"url": "https://github.com/Open-Wine-Components/umu-launcher/"
|
||||
}
|
||||
},
|
||||
"wezterm": {
|
||||
"inputs": {
|
||||
"flake-utils": "flake-utils_5",
|
||||
"freetype2": "freetype2",
|
||||
"harfbuzz": "harfbuzz",
|
||||
"libpng": "libpng",
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
],
|
||||
"rust-overlay": "rust-overlay_3",
|
||||
"zlib": "zlib"
|
||||
},
|
||||
"locked": {
|
||||
"dir": "nix",
|
||||
"lastModified": 1723525023,
|
||||
"narHash": "sha256-ZsDJQSUokodwFMP4FIZm2dYojf5iC4F/EeKC5VuQlqY=",
|
||||
"owner": "wez",
|
||||
"repo": "wezterm",
|
||||
"rev": "30345b36d8a00fed347e4df5dadd83915a7693fb",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"dir": "nix",
|
||||
"owner": "wez",
|
||||
"ref": "main",
|
||||
"repo": "wezterm",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"xdph": {
|
||||
"inputs": {
|
||||
"hyprland-protocols": "hyprland-protocols",
|
||||
@@ -1510,6 +1763,23 @@
|
||||
"repo": "yafas",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"zlib": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1484501380,
|
||||
"narHash": "sha256-j5b6aki1ztrzfCqu8y729sPar8GpyQWIrajdzpJC+ww=",
|
||||
"owner": "madler",
|
||||
"repo": "zlib",
|
||||
"rev": "cacf7f1d4e3d44d871b605da3b647f07d718623f",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "madler",
|
||||
"ref": "v1.2.11",
|
||||
"repo": "zlib",
|
||||
"type": "github"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
|
||||
@@ -52,6 +52,9 @@
|
||||
# cachyos
|
||||
chaotic.url = "https://flakehub.com/f/chaotic-cx/nyx/*.tar.gz";
|
||||
|
||||
#hmm
|
||||
helix.url = "github:SoraTenshi/helix/new-daily-driver";
|
||||
|
||||
# hyprland environ
|
||||
hyprland.url = "git+https://github.com/hyprwm/Hyprland?submodules=1";
|
||||
hyprland-contrib = {
|
||||
@@ -113,6 +116,10 @@
|
||||
url = "github:nix-community/fenix";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
wezterm = {
|
||||
url = "github:wez/wezterm/main?dir=nix";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
# naersk = {
|
||||
# url = "github:nix-community/naersk";
|
||||
# inputs.nixpkgs.follows = "nixpkgs";
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
"${userModules}/comm/discord"
|
||||
"${userModules}/devtools/neovim"
|
||||
"${userModules}/devtools/vscode"
|
||||
"${userModules}/devtools/helix"
|
||||
"${userModules}/gaming/lutris"
|
||||
"${userModules}/gaming/mangohud"
|
||||
"${userModules}/terminal/alacritty"
|
||||
|
||||
63
home/modules/devtools/helix/default.nix
Normal file
63
home/modules/devtools/helix/default.nix
Normal file
@@ -0,0 +1,63 @@
|
||||
{
|
||||
inputs,
|
||||
pkgs,
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf mkEnableOption;
|
||||
cfg = config.modules.devtools.helix;
|
||||
in {
|
||||
imports = [./languages.nix];
|
||||
|
||||
options = {
|
||||
modules.devtools.helix.enable = mkEnableOption "Enable helix";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
programs.helix = {
|
||||
enable = true;
|
||||
package = inputs.helix.packages.${pkgs.system}.default;
|
||||
|
||||
settings = {
|
||||
theme = "gruvbox_material_dark_soft";
|
||||
editor = {
|
||||
color-modes = true;
|
||||
cursorline = true;
|
||||
cursor-shape = {
|
||||
insert = "bar";
|
||||
normal = "block";
|
||||
select = "underline";
|
||||
};
|
||||
indent-guides.render = true;
|
||||
inline-diagnostics = {
|
||||
cursor-line = "hint";
|
||||
other-lines = "error";
|
||||
};
|
||||
lsp.display-inlay-hints = true;
|
||||
statusline.center = ["position-percentage"];
|
||||
true-color = true;
|
||||
whitespace.characters = {
|
||||
newline = "↴";
|
||||
tab = "⇥";
|
||||
};
|
||||
};
|
||||
|
||||
keys = {
|
||||
normal = {
|
||||
y = "yank_to_clipboard";
|
||||
p = "paste_clipboard_after";
|
||||
space.u = {
|
||||
f = ":format"; # format using LSP formatter
|
||||
w = ":set whitespace.render all";
|
||||
W = ":set whitespace.render none";
|
||||
};
|
||||
};
|
||||
insert = {
|
||||
C-v = "paste_clipboard_after";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
188
home/modules/devtools/helix/languages.nix
Normal file
188
home/modules/devtools/helix/languages.nix
Normal file
@@ -0,0 +1,188 @@
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
programs.helix.languages = {
|
||||
language = let
|
||||
deno = lang: {
|
||||
command = lib.getExe pkgs.deno;
|
||||
args = ["fmt" "-" "--ext" lang];
|
||||
};
|
||||
|
||||
prettier = lang: {
|
||||
command = lib.getExe pkgs.nodePackages.prettier;
|
||||
args = ["--parser" lang];
|
||||
};
|
||||
prettierLangs = map (e: {
|
||||
name = e;
|
||||
formatter = prettier e;
|
||||
});
|
||||
langs = ["css" "scss" "html"];
|
||||
in
|
||||
[
|
||||
{
|
||||
name = "bash";
|
||||
auto-format = true;
|
||||
formatter = {
|
||||
command = lib.getExe pkgs.shfmt;
|
||||
args = ["-i" "2"];
|
||||
};
|
||||
}
|
||||
{
|
||||
name = "clojure";
|
||||
injection-regex = "(clojure|clj|edn|boot|yuck)";
|
||||
file-types = ["clj" "cljs" "cljc" "clje" "cljr" "cljx" "edn" "boot" "yuck"];
|
||||
}
|
||||
{
|
||||
name = "cmake";
|
||||
auto-format = true;
|
||||
language-servers = ["cmake-language-server"];
|
||||
formatter = {
|
||||
command = lib.getExe pkgs.cmake-format;
|
||||
args = ["-"];
|
||||
};
|
||||
}
|
||||
{
|
||||
name = "lua";
|
||||
auto-format = true;
|
||||
language-servers = ["lua-language-server"];
|
||||
formatter = {
|
||||
command = lib.getExe pkgs.stylua;
|
||||
};
|
||||
}
|
||||
{
|
||||
name = "javascript";
|
||||
auto-format = true;
|
||||
language-servers = ["dprint" "typescript-language-server"];
|
||||
}
|
||||
{
|
||||
name = "json";
|
||||
formatter = deno "json";
|
||||
}
|
||||
{
|
||||
name = "markdown";
|
||||
auto-format = true;
|
||||
formatter = deno "md";
|
||||
}
|
||||
{
|
||||
name = "python";
|
||||
language-servers = ["pyright"];
|
||||
formatter = {
|
||||
command = lib.getExe pkgs.black;
|
||||
args = ["-" "--quiet" "--line-length 100"];
|
||||
};
|
||||
}
|
||||
{
|
||||
name = "typescript";
|
||||
auto-format = true;
|
||||
language-servers = ["dprint" "typescript-language-server"];
|
||||
}
|
||||
]
|
||||
++ prettierLangs langs;
|
||||
|
||||
language-server = {
|
||||
bash-language-server = {
|
||||
command = lib.getExe pkgs.bash-language-server;
|
||||
args = ["start"];
|
||||
};
|
||||
|
||||
clangd = {
|
||||
command = "${pkgs.clang-tools}/bin/clangd";
|
||||
clangd.fallbackFlags = ["-std=c++2b"];
|
||||
};
|
||||
|
||||
cmake-language-server = {
|
||||
command = lib.getExe pkgs.cmake-language-server;
|
||||
};
|
||||
|
||||
lua-language-server = {
|
||||
command = lib.getExe pkgs.lua-language-server;
|
||||
};
|
||||
|
||||
deno-lsp = {
|
||||
command = lib.getExe pkgs.deno;
|
||||
args = ["lsp"];
|
||||
environment.NO_COLOR = "1";
|
||||
config.deno = {
|
||||
enable = true;
|
||||
lint = true;
|
||||
unstable = true;
|
||||
suggest = {
|
||||
completeFunctionCalls = false;
|
||||
imports = {hosts."https://deno.land" = true;};
|
||||
};
|
||||
inlayHints = {
|
||||
enumMemberValues.enabled = true;
|
||||
functionLikeReturnTypes.enabled = true;
|
||||
parameterNames.enabled = "all";
|
||||
parameterTypes.enabled = true;
|
||||
propertyDeclarationTypes.enabled = true;
|
||||
variableTypes.enabled = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
dprint = {
|
||||
command = lib.getExe pkgs.dprint;
|
||||
args = ["lsp"];
|
||||
};
|
||||
|
||||
nil = {
|
||||
command = lib.getExe pkgs.nil;
|
||||
config.nil.formatting.command = ["${lib.getExe pkgs.alejandra}" "-q"];
|
||||
};
|
||||
|
||||
pyright = {
|
||||
command = "${pkgs.pyright}/bin/pyright-langserver";
|
||||
args = ["--stdio"];
|
||||
config = {
|
||||
reportMissingTypeStubs = false;
|
||||
analysis = {
|
||||
typeCheckingMode = "basic";
|
||||
autoImportCompletions = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
typescript-language-server = {
|
||||
command = lib.getExe pkgs.nodePackages.typescript-language-server;
|
||||
args = ["--stdio"];
|
||||
config = let
|
||||
inlayHints = {
|
||||
includeInlayEnumMemberValueHints = true;
|
||||
includeInlayFunctionLikeReturnTypeHints = true;
|
||||
includeInlayFunctionParameterTypeHints = true;
|
||||
includeInlayParameterNameHints = "all";
|
||||
includeInlayParameterNameHintsWhenArgumentMatchesName = true;
|
||||
includeInlayPropertyDeclarationTypeHints = true;
|
||||
includeInlayVariableTypeHints = true;
|
||||
};
|
||||
in {
|
||||
typescript-language-server.source = {
|
||||
addMissingImports.ts = true;
|
||||
fixAll.ts = true;
|
||||
organizeImports.ts = true;
|
||||
removeUnusedImports.ts = true;
|
||||
sortImports.ts = true;
|
||||
};
|
||||
|
||||
typescript = {inherit inlayHints;};
|
||||
javascript = {inherit inlayHints;};
|
||||
|
||||
hostInfo = "helix";
|
||||
};
|
||||
};
|
||||
|
||||
vscode-css-language-server = {
|
||||
command = "${pkgs.nodePackages.vscode-langservers-extracted}/bin/vscode-css-languageserver";
|
||||
args = ["--stdio"];
|
||||
config = {
|
||||
provideFormatter = true;
|
||||
css.validate.enable = true;
|
||||
scss.validate.enable = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,4 +1,3 @@
|
||||
# Yanked from Misterio77's great config: https://github.com/Misterio77/nix-config
|
||||
{
|
||||
pkgs,
|
||||
config,
|
||||
@@ -12,7 +11,9 @@ in {
|
||||
./plugins
|
||||
./lsp.nix
|
||||
./syntaxes.nix
|
||||
./keybindings.nix
|
||||
];
|
||||
|
||||
options = {
|
||||
modules.devtools.neovim.enable = mkEnableOption "Enable neovim";
|
||||
};
|
||||
@@ -20,145 +21,75 @@ in {
|
||||
config = mkIf cfg.enable {
|
||||
programs.neovim = {
|
||||
enable = true;
|
||||
|
||||
extraConfig =
|
||||
/*
|
||||
vim
|
||||
*/
|
||||
''
|
||||
"Use system clipboard
|
||||
set clipboard=unnamedplus
|
||||
"colorscheme
|
||||
colorscheme gruvbox-material
|
||||
|
||||
set number
|
||||
|
||||
"Lets us easily trigger completion from binds
|
||||
set wildcharm=<tab>
|
||||
|
||||
"Folding
|
||||
set foldmethod=manual
|
||||
"Should be expr, but it's slow. So just use ':set fdm=expr' when it's needed.
|
||||
|
||||
"Tabs
|
||||
set tabstop=4 "4 char-wide tab
|
||||
set expandtab "Use spaces
|
||||
set softtabstop=0 "Use same length as 'tabstop'
|
||||
set shiftwidth=0 "Use same length as 'tabstop'
|
||||
"2 char-wide overrides
|
||||
augroup two_space_tab
|
||||
autocmd!
|
||||
autocmd FileType json,html,htmldjango,hamlet,nix,scss,typescript,php,haskell,terraform setlocal tabstop=2
|
||||
augroup END
|
||||
|
||||
"Set tera to use htmldjango syntax
|
||||
augroup tera_htmldjango
|
||||
autocmd!
|
||||
autocmd BufRead,BufNewFile *.tera setfiletype htmldjango
|
||||
augroup END
|
||||
|
||||
"Options when composing mutt mail
|
||||
augroup mail_settings
|
||||
autocmd FileType mail set noautoindent wrapmargin=0 textwidth=0 linebreak wrap formatoptions +=w
|
||||
augroup END
|
||||
|
||||
"Fix nvim size according to terminal
|
||||
"(https://github.com/neovim/neovim/issues/11330)
|
||||
augroup fix_size
|
||||
autocmd VimEnter * silent exec "!kill -s SIGWINCH" getpid()
|
||||
augroup END
|
||||
|
||||
"Scroll up and down
|
||||
nmap <C-j> <C-e>
|
||||
nmap <C-k> <C-y>
|
||||
|
||||
"Buffers
|
||||
nmap <space>b :buffers<CR>
|
||||
nmap <C-l> :bnext<CR>
|
||||
nmap <C-h> :bprev<CR>
|
||||
nmap <C-q> :bdel<CR>
|
||||
|
||||
"Navigate
|
||||
nmap <space>e :e<space>
|
||||
nmap <space>e :e %:h<tab>
|
||||
"CD to current dir
|
||||
nmap <space>c :cd<space>
|
||||
nmap <space>C :cd %:h<tab>
|
||||
|
||||
"Loclist
|
||||
nmap <space>l :lwindow<cr>
|
||||
nmap [l :lprev<cr>
|
||||
nmap ]l :lnext<cr>
|
||||
|
||||
nmap <space>L :lhistory<cr>
|
||||
nmap [L :lolder<cr>
|
||||
nmap ]L :lnewer<cr>
|
||||
|
||||
"Quickfix
|
||||
nmap <space>q :cwindow<cr>
|
||||
nmap [q :cprev<cr>
|
||||
nmap ]q :cnext<cr>
|
||||
|
||||
nmap <space>Q :chistory<cr>
|
||||
nmap [Q :colder<cr>
|
||||
nmap ]Q :cnewer<cr>
|
||||
|
||||
"Make
|
||||
nmap <space>m :make<cr>
|
||||
|
||||
"Grep (replace with ripgrep)
|
||||
nmap <space>g :grep<space>
|
||||
if executable('rg')
|
||||
set grepprg=rg\ --vimgrep
|
||||
set grepformat=%f:%l:%c:%m
|
||||
endif
|
||||
|
||||
"Close other splits
|
||||
nmap <space>o :only<cr>
|
||||
|
||||
"Sudo save
|
||||
cmap w!! w !sudo tee > /dev/null %
|
||||
'';
|
||||
extraLuaConfig =
|
||||
/*
|
||||
lua
|
||||
*/
|
||||
''
|
||||
vim.g.have_nerd_font = true
|
||||
vim.wo.relativenumber = false
|
||||
-- Use system clipboard
|
||||
vim.opt.clipboard = "unnamedplus"
|
||||
|
||||
-- Colorscheme
|
||||
vim.cmd("colorscheme gruvbox-material")
|
||||
|
||||
-- Line Numbers and Cursorline
|
||||
vim.opt.number = true
|
||||
vim.opt.cursorline = true
|
||||
vim.wo.relativenumber = false
|
||||
|
||||
vim.keymap.set("n", "<C-a>", "ggVG", { desc = "Select all" })
|
||||
vim.keymap.set("n", "<C-v>", "p", { desc = "Paste" })
|
||||
vim.keymap.set("i", "<C-v>", "<esc>p", { desc = "Paste" })
|
||||
vim.keymap.set("v", "<C-c>", "y", { desc = "Yank" })
|
||||
-- Nerd Font
|
||||
vim.g.have_nerd_font = true
|
||||
|
||||
vim.keymap.set("n", "gD", vim.lsp.buf.declaration, { desc = "Go to declaration" })
|
||||
vim.keymap.set("n", "gd", vim.lsp.buf.definition, { desc = "Go to definition" })
|
||||
vim.keymap.set("n", "gi", vim.lsp.buf.implementation, { desc = "Go to implementation" })
|
||||
vim.keymap.set("n", "K", vim.lsp.buf.hover, { desc = "Hover Documentation" })
|
||||
vim.keymap.set("n", "<space>a", vim.lsp.buf.code_action, { desc = "Code action" })
|
||||
-- Enable persistent undo
|
||||
vim.opt.undofile = true
|
||||
vim.opt.undodir = vim.fn.expand("~/.config/nvim/undo")
|
||||
|
||||
-- Diagnostic
|
||||
vim.keymap.set("n", "<space>d", vim.diagnostic.open_float, { desc = "Floating diagnostic" })
|
||||
vim.keymap.set("n", "[d", vim.diagnostic.goto_prev, { desc = "Previous diagnostic" })
|
||||
vim.keymap.set("n", "]d", vim.diagnostic.goto_next, { desc = "Next diagnostic" })
|
||||
vim.keymap.set("n", "gl", vim.diagnostic.setloclist, { desc = "Diagnostics on loclist" })
|
||||
vim.keymap.set("n", "gq", vim.diagnostic.setqflist, { desc = "Diagnostics on quickfix" })
|
||||
|
||||
function add_sign(name, text)
|
||||
vim.fn.sign_define(name, { text = text, texthl = name, numhl = name })
|
||||
end
|
||||
|
||||
add_sign("DiagnosticSignError", " ")
|
||||
add_sign("DiagnosticSignWarn", " ")
|
||||
add_sign("DiagnosticSignHint", " ")
|
||||
add_sign("DiagnosticSignInfo", " ")
|
||||
-- Set wildcharm to tab for triggering completion
|
||||
vim.opt.wildcharm = vim.fn.char2nr(vim.api.nvim_replace_termcodes("<Tab>", true, true, true))
|
||||
|
||||
-- Folding
|
||||
vim.opt.foldmethod = "manual"
|
||||
vim.opt.foldexpr = "v:lua.vim.treesitter.foldexpr()"
|
||||
-- When it releases
|
||||
-- vim.opt.foldexpr = "v:lua.vim.treesitter.foldtext()"
|
||||
|
||||
-- Tabs
|
||||
vim.opt.tabstop = 4
|
||||
vim.opt.expandtab = true
|
||||
vim.opt.softtabstop = 0
|
||||
vim.opt.shiftwidth = 0
|
||||
|
||||
-- 2 char-wide overrides for specific file types
|
||||
vim.api.nvim_create_augroup("two_space_tab", { clear = true })
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
pattern = { "json", "html", "htmldjango", "hamlet", "nix", "scss", "typescript", "php", "haskell", "terraform" },
|
||||
command = "setlocal tabstop=2",
|
||||
group = "two_space_tab",
|
||||
})
|
||||
|
||||
-- Set tera to use htmldjango syntax
|
||||
vim.api.nvim_create_augroup("tera_htmldjango", { clear = true })
|
||||
vim.api.nvim_create_autocmd({ "BufRead", "BufNewFile" }, {
|
||||
pattern = "*.tera",
|
||||
command = "setfiletype htmldjango",
|
||||
group = "tera_htmldjango",
|
||||
})
|
||||
|
||||
-- Options when composing mutt mail
|
||||
vim.api.nvim_create_augroup("mail_settings", { clear = true })
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
pattern = "mail",
|
||||
command = "set noautoindent wrapmargin=0 textwidth=0 linebreak wrap formatoptions+=w",
|
||||
group = "mail_settings",
|
||||
})
|
||||
|
||||
-- Fix nvim size according to terminal
|
||||
vim.api.nvim_create_augroup("fix_size", { clear = true })
|
||||
vim.api.nvim_create_autocmd("VimEnter", {
|
||||
pattern = "*",
|
||||
command = "silent exec '!kill -s SIGWINCH' getpid()",
|
||||
group = "fix_size",
|
||||
})
|
||||
|
||||
-- Highlight when yanking (copying) text
|
||||
vim.api.nvim_create_autocmd("TextYankPost", {
|
||||
desc = "Highlight when yanking (copying) text",
|
||||
@@ -167,24 +98,24 @@ in {
|
||||
vim.highlight.on_yank()
|
||||
end,
|
||||
})
|
||||
'';
|
||||
|
||||
-- Diagnostic signs
|
||||
function add_sign(name, text)
|
||||
vim.fn.sign_define(name, { text = text, texthl = name, numhl = name })
|
||||
end
|
||||
|
||||
add_sign("DiagnosticSignError", " ")
|
||||
add_sign("DiagnosticSignWarn", " ")
|
||||
add_sign("DiagnosticSignHint", " ")
|
||||
add_sign("DiagnosticSignInfo", " ")
|
||||
|
||||
'';
|
||||
|
||||
plugins = with pkgs.vimPlugins; [
|
||||
vim-table-mode
|
||||
editorconfig-nvim
|
||||
vim-surround
|
||||
gruvbox-material-nvim
|
||||
{
|
||||
plugin = nvim-autopairs;
|
||||
type = "lua";
|
||||
config =
|
||||
/*
|
||||
lua
|
||||
*/
|
||||
''
|
||||
require("nvim-autopairs").setup({})
|
||||
'';
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
|
||||
79
home/modules/devtools/neovim/keybindings.nix
Normal file
79
home/modules/devtools/neovim/keybindings.nix
Normal file
@@ -0,0 +1,79 @@
|
||||
{
|
||||
config = {
|
||||
programs.neovim = {
|
||||
extraLuaConfig =
|
||||
/*
|
||||
lua
|
||||
*/
|
||||
''
|
||||
-- Key mappings for various commands and navigation
|
||||
vim.api.nvim_set_keymap("n", "<C-j>", "<C-e>", { noremap = true })
|
||||
vim.api.nvim_set_keymap("n", "<C-k>", "<C-y>", { noremap = true })
|
||||
|
||||
-- Buffers
|
||||
vim.api.nvim_set_keymap("n", "<space>b", ":buffers<CR>", { noremap = true })
|
||||
vim.api.nvim_set_keymap("n", "<C-l>", ":bnext<CR>", { noremap = true })
|
||||
vim.api.nvim_set_keymap("n", "<C-h>", ":bprev<CR>", { noremap = true })
|
||||
vim.api.nvim_set_keymap("n", "<C-q>", ":bdel<CR>", { noremap = true })
|
||||
|
||||
-- Navigation
|
||||
vim.api.nvim_set_keymap("n", "<space>e", ":e<space>", { noremap = true })
|
||||
vim.api.nvim_set_keymap("n", "<space>E", ":e %:h<tab>", { noremap = true })
|
||||
vim.api.nvim_set_keymap("n", "<space>c", ":cd<space>", { noremap = true })
|
||||
vim.api.nvim_set_keymap("n", "<space>C", ":cd %:h<tab>", { noremap = true })
|
||||
|
||||
-- Loclist
|
||||
vim.api.nvim_set_keymap("n", "<space>l", ":lwindow<cr>", { noremap = true })
|
||||
vim.api.nvim_set_keymap("n", "[l", ":lprev<cr>", { noremap = true })
|
||||
vim.api.nvim_set_keymap("n", "]l", ":lnext<cr>", { noremap = true })
|
||||
vim.api.nvim_set_keymap("n", "<space>L", ":lhistory<cr>", { noremap = true })
|
||||
vim.api.nvim_set_keymap("n", "[L", ":lolder<cr>", { noremap = true })
|
||||
vim.api.nvim_set_keymap("n", "]L", ":lnewer<cr>", { noremap = true })
|
||||
|
||||
-- Quickfix
|
||||
vim.api.nvim_set_keymap("n", "<space>q", ":cwindow<cr>", { noremap = true })
|
||||
vim.api.nvim_set_keymap("n", "[q", ":cprev<cr>", { noremap = true })
|
||||
vim.api.nvim_set_keymap("n", "]q", ":cnext<cr>", { noremap = true })
|
||||
vim.api.nvim_set_keymap("n", "<space>Q", ":chistory<cr>", { noremap = true })
|
||||
vim.api.nvim_set_keymap("n", "[Q", ":colder<cr>", { noremap = true })
|
||||
vim.api.nvim_set_keymap("n", "]Q", ":cnewer<cr>", { noremap = true })
|
||||
|
||||
-- Make
|
||||
vim.api.nvim_set_keymap("n", "<space>m", ":make<cr>", { noremap = true })
|
||||
|
||||
-- Grep (replace with ripgrep)
|
||||
vim.api.nvim_set_keymap("n", "<space>g", ":grep<space>", { noremap = true })
|
||||
if vim.fn.executable("rg") == 1 then
|
||||
vim.opt.grepprg = "rg --vimgrep"
|
||||
vim.opt.grepformat = "%f:%l:%c:%m"
|
||||
end
|
||||
|
||||
-- Close other splits
|
||||
vim.api.nvim_set_keymap("n", "<space>o", ":only<cr>", { noremap = true })
|
||||
|
||||
-- Sudo save
|
||||
vim.api.nvim_set_keymap("c", "w!!", "w !sudo tee > /dev/null %", { noremap = true })
|
||||
|
||||
-- Other utility key mappings
|
||||
vim.keymap.set("n", "<C-a>", "ggVG", { desc = "Select all" })
|
||||
vim.keymap.set("n", "<C-v>", "p", { desc = "Paste" })
|
||||
vim.keymap.set("i", "<C-v>", "<esc>p", { desc = "Paste" })
|
||||
vim.keymap.set("v", "<C-c>", "y", { desc = "Yank" })
|
||||
|
||||
-- LSP-related mappings
|
||||
vim.keymap.set("n", "gD", vim.lsp.buf.declaration, { desc = "Go to declaration" })
|
||||
vim.keymap.set("n", "gd", vim.lsp.buf.definition, { desc = "Go to definition" })
|
||||
vim.keymap.set("n", "gi", vim.lsp.buf.implementation, { desc = "Go to implementation" })
|
||||
vim.keymap.set("n", "K", vim.lsp.buf.hover, { desc = "Hover Documentation" })
|
||||
vim.keymap.set("n", "<space>a", vim.lsp.buf.code_action, { desc = "Code action" })
|
||||
|
||||
-- Diagnostics
|
||||
vim.keymap.set("n", "<space>d", vim.diagnostic.open_float, { desc = "Floating diagnostic" })
|
||||
vim.keymap.set("n", "[d", vim.diagnostic.goto_prev, { desc = "Previous diagnostic" })
|
||||
vim.keymap.set("n", "]d", vim.diagnostic.goto_next, { desc = "Next diagnostic" })
|
||||
vim.keymap.set("n", "gl", vim.diagnostic.setloclist, { desc = "Diagnostics on loclist" })
|
||||
vim.keymap.set("n", "gq", vim.diagnostic.setqflist, { desc = "Diagnostics on quickfix" })
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -27,19 +27,6 @@
|
||||
end
|
||||
end
|
||||
|
||||
-- Add LSPs with lsp-format attached
|
||||
add_lsp(lspconfig.lua_ls, {})
|
||||
|
||||
add_lsp(lspconfig.nixd, {
|
||||
settings = {
|
||||
nixd = {
|
||||
formatting = {
|
||||
command = { "alejandra" },
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
-- Other LSPs
|
||||
add_lsp(lspconfig.bashls, {})
|
||||
add_lsp(lspconfig.clangd, {})
|
||||
@@ -51,6 +38,8 @@
|
||||
add_lsp(lspconfig.kotlin_language_server, {})
|
||||
add_lsp(lspconfig.phpactor, { init_options = { ["language_server_php_cs_fixer.enabled"] = true } })
|
||||
add_lsp(lspconfig.rust_analyzer, {})
|
||||
add_lsp(lspconfig.nixd, {})
|
||||
add_lsp(lspconfig.lua_ls, {})
|
||||
add_lsp(lspconfig.pylsp, {})
|
||||
add_lsp(lspconfig.solargraph, {})
|
||||
add_lsp(lspconfig.terraformls, {})
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
{pkgs, ...}: {
|
||||
programs.neovim.plugins = with pkgs.vimPlugins; [
|
||||
{
|
||||
plugin = alpha-nvim;
|
||||
type = "lua";
|
||||
config =
|
||||
/*
|
||||
lua
|
||||
*/
|
||||
''
|
||||
local alpha = require("alpha")
|
||||
local dashboard = require("alpha.themes.dashboard")
|
||||
|
||||
dashboard.section.header.val = {
|
||||
" ",
|
||||
" ███╗ ██╗███████╗ ██████╗ ██╗ ██╗██╗███╗ ███╗ ",
|
||||
" ████╗ ██║██╔════╝██╔═══██╗██║ ██║██║████╗ ████║ ",
|
||||
" ██╔██╗ ██║█████╗ ██║ ██║██║ ██║██║██╔████╔██║ ",
|
||||
" ██║╚██╗██║██╔══╝ ██║ ██║╚██╗ ██╔╝██║██║╚██╔╝██║ ",
|
||||
" ██║ ╚████║███████╗╚██████╔╝ ╚████╔╝ ██║██║ ╚═╝ ██║ ",
|
||||
" ╚═╝ ╚═══╝╚══════╝ ╚═════╝ ╚═══╝ ╚═╝╚═╝ ╚═╝ ",
|
||||
" ",
|
||||
}
|
||||
dashboard.section.header.opts.hl = "Title"
|
||||
|
||||
dashboard.section.buttons.val = {
|
||||
dashboard.button( "n", " New file" , ":enew<CR>"),
|
||||
dashboard.button( "e", " Explore", ":Explore<CR>"),
|
||||
dashboard.button( "g", " Git summary", ":Git | :only<CR>"),
|
||||
dashboard.button( "c", " Nix config flake" , ":e ~/.nix-config/flake.nix<CR>"),
|
||||
}
|
||||
|
||||
alpha.setup(dashboard.opts)
|
||||
vim.keymap.set("n", "<space>h", ":Alpha<CR>", { desc = "Open home dashboard" })
|
||||
'';
|
||||
}
|
||||
];
|
||||
}
|
||||
38
home/modules/devtools/neovim/plugins/alpha.nix
Normal file
38
home/modules/devtools/neovim/plugins/alpha.nix
Normal file
@@ -0,0 +1,38 @@
|
||||
{pkgs, ...}: {
|
||||
programs.neovim.plugins = with pkgs.vimPlugins; [
|
||||
{
|
||||
plugin = alpha-nvim;
|
||||
type = "lua";
|
||||
config =
|
||||
/*
|
||||
lua
|
||||
*/
|
||||
''
|
||||
local alpha = require("alpha")
|
||||
local dashboard = require("alpha.themes.dashboard")
|
||||
|
||||
dashboard.section.header.val = {
|
||||
" ",
|
||||
" ███╗ ██╗███████╗ ██████╗ ██╗ ██╗██╗███╗ ███╗ ",
|
||||
" ████╗ ██║██╔════╝██╔═══██╗██║ ██║██║████╗ ████║ ",
|
||||
" ██╔██╗ ██║█████╗ ██║ ██║██║ ██║██║██╔████╔██║ ",
|
||||
" ██║╚██╗██║██╔══╝ ██║ ██║╚██╗ ██╔╝██║██║╚██╔╝██║ ",
|
||||
" ██║ ╚████║███████╗╚██████╔╝ ╚████╔╝ ██║██║ ╚═╝ ██║ ",
|
||||
" ╚═╝ ╚═══╝╚══════╝ ╚═════╝ ╚═══╝ ╚═╝╚═╝ ╚═╝ ",
|
||||
" ",
|
||||
}
|
||||
dashboard.section.header.opts.hl = "Title"
|
||||
|
||||
dashboard.section.buttons.val = {
|
||||
dashboard.button("n", " New file", ":enew<CR>"),
|
||||
dashboard.button("e", " Explore", ":Explore<CR>"),
|
||||
dashboard.button("g", " Git summary", ":Git | :only<CR>"),
|
||||
dashboard.button("c", " Nix config flake", ":e ~/.nix-config/flake.nix<CR>"),
|
||||
}
|
||||
|
||||
alpha.setup(dashboard.opts)
|
||||
vim.keymap.set("n", "<space>h", ":Alpha<CR>", { desc = "Open home dashboard" })
|
||||
'';
|
||||
}
|
||||
];
|
||||
}
|
||||
15
home/modules/devtools/neovim/plugins/autopairs.nix
Normal file
15
home/modules/devtools/neovim/plugins/autopairs.nix
Normal file
@@ -0,0 +1,15 @@
|
||||
{pkgs, ...}: {
|
||||
programs.neovim.plugins = with pkgs.vimPlugins; [
|
||||
{
|
||||
plugin = nvim-autopairs;
|
||||
type = "lua";
|
||||
config =
|
||||
/*
|
||||
lua
|
||||
*/
|
||||
''
|
||||
require("nvim-autopairs").setup({})
|
||||
'';
|
||||
}
|
||||
];
|
||||
}
|
||||
@@ -8,7 +8,7 @@
|
||||
lua
|
||||
*/
|
||||
''
|
||||
require('bqf').setup{}
|
||||
require("bqf").setup({})
|
||||
'';
|
||||
}
|
||||
];
|
||||
@@ -8,7 +8,7 @@
|
||||
lua
|
||||
*/
|
||||
''
|
||||
require('bufferline').setup{}
|
||||
require("bufferline").setup({})
|
||||
'';
|
||||
}
|
||||
];
|
||||
@@ -8,7 +8,7 @@
|
||||
lua
|
||||
*/
|
||||
''
|
||||
require('colorizer').setup{}
|
||||
require("colorizer").setup({})
|
||||
'';
|
||||
}
|
||||
];
|
||||
@@ -8,14 +8,14 @@
|
||||
lua
|
||||
*/
|
||||
''
|
||||
require('Comment').setup{
|
||||
require("Comment").setup({
|
||||
opleader = {
|
||||
line = '<C-b>'
|
||||
line = "<C-b>",
|
||||
},
|
||||
toggler = {
|
||||
line = '<C-b>'
|
||||
line = "<C-b>",
|
||||
},
|
||||
}
|
||||
})
|
||||
'';
|
||||
}
|
||||
];
|
||||
@@ -9,6 +9,12 @@
|
||||
*/
|
||||
''
|
||||
require("conform").setup({
|
||||
default_format_opts = {
|
||||
timeout_ms = 3000,
|
||||
async = false, -- not recommended to change
|
||||
quiet = false, -- not recommended to change
|
||||
lsp_format = "fallback", -- not recommended to change
|
||||
},
|
||||
formatters_by_ft = {
|
||||
bash = { "shfmt" },
|
||||
css = { "prettierd" },
|
||||
@@ -31,8 +37,8 @@
|
||||
-- Optionally, set up a command or auto-command to format on save
|
||||
vim.api.nvim_create_autocmd("BufWritePre", {
|
||||
pattern = "*",
|
||||
callback = function(args)
|
||||
require("conform").format({ bufnr = args.buf })
|
||||
callback = function()
|
||||
require("conform").format()
|
||||
end,
|
||||
})
|
||||
'';
|
||||
@@ -1,45 +0,0 @@
|
||||
{pkgs, ...}: {
|
||||
programs.neovim.plugins = with pkgs.vimPlugins; [
|
||||
{
|
||||
plugin = copilot-lua;
|
||||
type = "lua";
|
||||
config =
|
||||
/*
|
||||
lua
|
||||
*/
|
||||
''
|
||||
require('copilot').setup({
|
||||
panel = {
|
||||
enabled = true,
|
||||
auto_refresh = true,
|
||||
keymap = {
|
||||
jump_prev = "[[",
|
||||
jump_next = "]]",
|
||||
accept = "<CR>",
|
||||
refresh = "gr",
|
||||
open = "<M-CR>"
|
||||
},
|
||||
layout = {
|
||||
position = "bottom", -- | top | left | right
|
||||
ratio = 0.4
|
||||
},
|
||||
},
|
||||
suggestion = {
|
||||
enabled = true,
|
||||
auto_trigger = true,
|
||||
hide_during_completion = true,
|
||||
debounce = 75,
|
||||
keymap = {
|
||||
accept = "<C-CR>",
|
||||
accept_word = false,
|
||||
accept_line = false,
|
||||
next = "<M-]>",
|
||||
prev = "<M-[>",
|
||||
dismiss = "<C-]>",
|
||||
},
|
||||
},
|
||||
})
|
||||
'';
|
||||
}
|
||||
];
|
||||
}
|
||||
45
home/modules/devtools/neovim/plugins/copilot.nix
Normal file
45
home/modules/devtools/neovim/plugins/copilot.nix
Normal file
@@ -0,0 +1,45 @@
|
||||
{pkgs, ...}: {
|
||||
programs.neovim.plugins = with pkgs.vimPlugins; [
|
||||
{
|
||||
plugin = copilot-lua;
|
||||
type = "lua";
|
||||
config =
|
||||
/*
|
||||
lua
|
||||
*/
|
||||
''
|
||||
require("copilot").setup({
|
||||
panel = {
|
||||
enabled = true,
|
||||
auto_refresh = true,
|
||||
keymap = {
|
||||
jump_prev = "[[",
|
||||
jump_next = "]]",
|
||||
accept = "<CR>",
|
||||
refresh = "gr",
|
||||
open = "<M-CR>",
|
||||
},
|
||||
layout = {
|
||||
position = "bottom", -- | top | left | right
|
||||
ratio = 0.4,
|
||||
},
|
||||
},
|
||||
suggestion = {
|
||||
enabled = true,
|
||||
auto_trigger = true,
|
||||
hide_during_completion = true,
|
||||
debounce = 75,
|
||||
keymap = {
|
||||
accept = "<C-CR>",
|
||||
accept_word = false,
|
||||
accept_line = false,
|
||||
next = "<M-]>",
|
||||
prev = "<M-[>",
|
||||
dismiss = "<C-]>",
|
||||
},
|
||||
},
|
||||
})
|
||||
'';
|
||||
}
|
||||
];
|
||||
}
|
||||
@@ -3,22 +3,23 @@
|
||||
vim-illuminate
|
||||
];
|
||||
imports = [
|
||||
./alpha-nvim.nix
|
||||
./bufferline-nvim.nix
|
||||
./comment-nvim.nix
|
||||
./copilot-lua.nix
|
||||
./fidget-nvim.nix
|
||||
./gitsigns-nvim.nix
|
||||
./alpha.nix
|
||||
./bufferline.nix
|
||||
./comment.nix
|
||||
./copilot.nix
|
||||
./fidget.nix
|
||||
./gitsigns.nix
|
||||
./treesitter.nix
|
||||
./conform-nvim.nix
|
||||
./gx-nvim.nix
|
||||
./nvim-bqf.nix
|
||||
./nvim-colorizer-lua.nix
|
||||
./nvim-web-devicons.nix
|
||||
./conform.nix
|
||||
./gx.nix
|
||||
./bqf.nix
|
||||
./colorizer.nix
|
||||
./web-devicons.nix
|
||||
./oil.nix
|
||||
./lualine.nix
|
||||
./range-highlight-nvim.nix
|
||||
./vim-fugitive.nix
|
||||
./range-highlight.nix
|
||||
./fugitive.nix
|
||||
./which-key.nix
|
||||
./autopairs.nix
|
||||
];
|
||||
}
|
||||
|
||||
@@ -8,13 +8,13 @@
|
||||
lua
|
||||
*/
|
||||
''
|
||||
require('fidget').setup{
|
||||
require("fidget").setup({
|
||||
progress = {
|
||||
display = {
|
||||
progress_icon = { pattern = "dots", period = 1 },
|
||||
},
|
||||
},
|
||||
}
|
||||
})
|
||||
'';
|
||||
}
|
||||
];
|
||||
@@ -1,23 +0,0 @@
|
||||
{pkgs, ...}: {
|
||||
programs.neovim.plugins = with pkgs.vimPlugins; [
|
||||
{
|
||||
plugin = gitsigns-nvim;
|
||||
type = "lua";
|
||||
config =
|
||||
/*
|
||||
lua
|
||||
*/
|
||||
''
|
||||
require('gitsigns').setup{
|
||||
signs = {
|
||||
add = { text = '+' },
|
||||
change = { text = '~' },
|
||||
delete = { text = '_' },
|
||||
topdelete = { text = '‾' },
|
||||
changedelete = { text = '~' },
|
||||
},
|
||||
}
|
||||
'';
|
||||
}
|
||||
];
|
||||
}
|
||||
23
home/modules/devtools/neovim/plugins/gitsigns.nix
Normal file
23
home/modules/devtools/neovim/plugins/gitsigns.nix
Normal file
@@ -0,0 +1,23 @@
|
||||
{pkgs, ...}: {
|
||||
programs.neovim.plugins = with pkgs.vimPlugins; [
|
||||
{
|
||||
plugin = gitsigns-nvim;
|
||||
type = "lua";
|
||||
config =
|
||||
/*
|
||||
lua
|
||||
*/
|
||||
''
|
||||
require("gitsigns").setup({
|
||||
signs = {
|
||||
add = { text = "+" },
|
||||
change = { text = "~" },
|
||||
delete = { text = "_" },
|
||||
topdelete = { text = "‾" },
|
||||
changedelete = { text = "~" },
|
||||
},
|
||||
})
|
||||
'';
|
||||
}
|
||||
];
|
||||
}
|
||||
@@ -18,9 +18,9 @@ in {
|
||||
lua
|
||||
*/
|
||||
''
|
||||
require('gx').setup{}
|
||||
vim.keymap.set({"n", "x"}, "gx", ":Browse<CR>", {
|
||||
desc = "Open the file under cursor with system app"
|
||||
require("gx").setup({})
|
||||
vim.keymap.set({ "n", "x" }, "gx", ":Browse<CR>", {
|
||||
desc = "Open the file under cursor with system app",
|
||||
})
|
||||
'';
|
||||
}
|
||||
@@ -8,12 +8,12 @@
|
||||
lua
|
||||
*/
|
||||
''
|
||||
require('lualine').setup{
|
||||
require("lualine").setup({
|
||||
options = {
|
||||
icons_enabled = true,
|
||||
theme = 'gruvbox-material',
|
||||
component_separators = { left = '', right = ''},
|
||||
section_separators = { left = '', right = ''},
|
||||
theme = "gruvbox-material",
|
||||
component_separators = { left = "", right = "" },
|
||||
section_separators = { left = "", right = "" },
|
||||
disabled_filetypes = {
|
||||
statusline = {},
|
||||
winbar = {},
|
||||
@@ -25,29 +25,29 @@
|
||||
statusline = 1000,
|
||||
tabline = 1000,
|
||||
winbar = 1000,
|
||||
}
|
||||
},
|
||||
},
|
||||
sections = {
|
||||
lualine_a = {'mode'},
|
||||
lualine_b = {'branch', 'diff', 'diagnostics'},
|
||||
lualine_c = {'filename'},
|
||||
lualine_x = {'encoding', 'fileformat', 'filetype'},
|
||||
lualine_y = {'progress'},
|
||||
lualine_z = {'location'}
|
||||
lualine_a = { "mode" },
|
||||
lualine_b = { "branch", "diff", "diagnostics" },
|
||||
lualine_c = { "filename" },
|
||||
lualine_x = { "encoding", "fileformat", "filetype" },
|
||||
lualine_y = { "progress" },
|
||||
lualine_z = { "location" },
|
||||
},
|
||||
inactive_sections = {
|
||||
lualine_a = {},
|
||||
lualine_b = {},
|
||||
lualine_c = {'filename'},
|
||||
lualine_x = {'location'},
|
||||
lualine_c = { "filename" },
|
||||
lualine_x = { "location" },
|
||||
lualine_y = {},
|
||||
lualine_z = {}
|
||||
lualine_z = {},
|
||||
},
|
||||
tabline = {},
|
||||
winbar = {},
|
||||
inactive_winbar = {},
|
||||
extensions = {}
|
||||
}
|
||||
extensions = {},
|
||||
})
|
||||
'';
|
||||
}
|
||||
];
|
||||
|
||||
51
home/modules/devtools/neovim/plugins/none-ls.nix
Normal file
51
home/modules/devtools/neovim/plugins/none-ls.nix
Normal file
@@ -0,0 +1,51 @@
|
||||
{pkgs, ...}: {
|
||||
programs.neovim = {
|
||||
plugins = with pkgs.vimPlugins; [
|
||||
none-ls-nvim
|
||||
plenary-nvim
|
||||
nvim-treesitter.withAllGrammars
|
||||
];
|
||||
extraConfig =
|
||||
/*
|
||||
lua
|
||||
*/
|
||||
''
|
||||
-- Require necessary plugins
|
||||
require("plenary")
|
||||
require("nvim-treesitter.configs").setup({
|
||||
highlight = {
|
||||
enable = true,
|
||||
},
|
||||
indent = {
|
||||
enable = true,
|
||||
},
|
||||
})
|
||||
|
||||
local null_ls = require("null-ls")
|
||||
|
||||
-- Setup null-ls with stylua and other formatters
|
||||
null_ls.setup({
|
||||
sources = {
|
||||
null_ls.builtins.formatting.alejandra,
|
||||
null_ls.builtins.formatting.stylua,
|
||||
null_ls.builtins.formatting.black,
|
||||
null_ls.builtins.formatting.isort,
|
||||
null_ls.builtins.formatting.phpcsfixer,
|
||||
null_ls.builtins.formatting.pint,
|
||||
null_ls.builtins.formatting.prettier,
|
||||
null_ls.builtins.formatting.sql_formatter,
|
||||
null_ls.builtins.formatting.xmllint,
|
||||
null_ls.builtins.formatting.shfmt,
|
||||
},
|
||||
})
|
||||
|
||||
-- Function to format on save
|
||||
local function format_on_save()
|
||||
vim.cmd([[autocmd BufWritePre * lua vim.lsp.buf.format({ async = true })]])
|
||||
end
|
||||
|
||||
-- Call the function to enable auto format on save
|
||||
format_on_save()
|
||||
'';
|
||||
};
|
||||
}
|
||||
@@ -8,7 +8,7 @@
|
||||
lua
|
||||
*/
|
||||
''
|
||||
require('oil').setup{
|
||||
require("oil").setup({
|
||||
buf_options = {
|
||||
buflisted = true,
|
||||
bufhidden = "delete",
|
||||
@@ -28,7 +28,7 @@
|
||||
["g."] = "actions.toggle_hidden",
|
||||
["g\\"] = "actions.toggle_trash",
|
||||
},
|
||||
}
|
||||
})
|
||||
'';
|
||||
}
|
||||
];
|
||||
|
||||
15
home/modules/devtools/neovim/plugins/plenary.nix
Normal file
15
home/modules/devtools/neovim/plugins/plenary.nix
Normal file
@@ -0,0 +1,15 @@
|
||||
{pkgs, ...}: {
|
||||
programs.neovim.plugins = with pkgs.vimPlugins; [
|
||||
{
|
||||
plugin = plenary-nvim;
|
||||
type = "lua";
|
||||
config =
|
||||
/*
|
||||
lua
|
||||
*/
|
||||
''
|
||||
require("plenary").setup({})
|
||||
'';
|
||||
}
|
||||
];
|
||||
}
|
||||
@@ -8,7 +8,7 @@
|
||||
lua
|
||||
*/
|
||||
''
|
||||
require('range-highlight').setup{}
|
||||
require("range-highlight").setup({})
|
||||
'';
|
||||
}
|
||||
];
|
||||
@@ -9,15 +9,10 @@
|
||||
*/
|
||||
''
|
||||
require("nvim-treesitter.configs").setup({
|
||||
-- ensure_installed = { "nix", "lua" },
|
||||
highlight = {
|
||||
enable = true,
|
||||
additional_vim_regex_highlighting = false,
|
||||
disable = function(lang, bufnr)
|
||||
return vim.fn.getfsize(vim.api.nvim_buf_get_name(bufnr)) > 1048576
|
||||
end,
|
||||
},
|
||||
parser_install_dir = vim.fn.stdpath("data") .. "/parsers",
|
||||
})
|
||||
'';
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
lua
|
||||
*/
|
||||
''
|
||||
require('nvim-web-devicons').setup{}
|
||||
require("nvim-web-devicons").setup({})
|
||||
'';
|
||||
}
|
||||
];
|
||||
@@ -8,7 +8,7 @@
|
||||
lua
|
||||
*/
|
||||
''
|
||||
require('which-key').setup{}
|
||||
require("which-key").setup({})
|
||||
'';
|
||||
}
|
||||
];
|
||||
|
||||
@@ -2,10 +2,12 @@
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
inputs,
|
||||
...
|
||||
}: let
|
||||
enable_wayland = "true";
|
||||
weztermPkg = pkgs.wezterm;
|
||||
# weztermPkg = pkgs.wezterm;
|
||||
weztermFlake = inputs.wezterm.packages.${pkgs.system}.default;
|
||||
inherit (lib) mkIf mkEnableOption;
|
||||
cfg = config.modules.terminal.wezterm;
|
||||
in {
|
||||
@@ -15,8 +17,12 @@ in {
|
||||
config = mkIf cfg.enable {
|
||||
programs.wezterm = {
|
||||
enable = true;
|
||||
package = weztermPkg;
|
||||
extraConfig = ''
|
||||
package = weztermFlake;
|
||||
extraConfig =
|
||||
/*
|
||||
lua
|
||||
*/
|
||||
''
|
||||
local wezterm = require 'wezterm';
|
||||
|
||||
local config = {
|
||||
@@ -25,8 +31,9 @@ in {
|
||||
check_for_updates = false,
|
||||
color_scheme = 'Gruvbox Material (Gogh)',
|
||||
default_cursor_style = 'SteadyBar',
|
||||
enable_scroll_bar = true,
|
||||
hide_tab_bar_if_only_one_tab = true,
|
||||
enable_scroll_bar = false,
|
||||
enable_tab_bar = false,
|
||||
use_fancy_tab_bar = false,
|
||||
scrollback_lines = 10000,
|
||||
window_background_opacity = 0.9,
|
||||
}
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
{
|
||||
pkgs,
|
||||
inputs,
|
||||
...
|
||||
}: {
|
||||
programs.wezterm = {
|
||||
enable = true;
|
||||
package = inputs.wezterm.packages.${pkgs.system}.default;
|
||||
|
||||
extraConfig = ''
|
||||
return {
|
||||
enable_wayland = true,
|
||||
font = wezterm.font("Input Mono Compressed"),
|
||||
font_size = 12,
|
||||
check_for_updates = false,
|
||||
color_scheme = 'Gruvbox Material (Gogh)',
|
||||
default_cursor_style = 'SteadyBar',
|
||||
enable_scroll_bar = true,
|
||||
hide_tab_bar_if_only_one_tab = true,
|
||||
scrollback_lines = 10000,
|
||||
window_background_opacity = 0.9,
|
||||
}
|
||||
'';
|
||||
};
|
||||
}
|
||||
@@ -12,14 +12,14 @@ in {
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
wayland.windowManager.hyprland.settings = {
|
||||
"$terminal" = "kitty";
|
||||
"$terminal" = "wezterm";
|
||||
"$fileManager" = "thunar";
|
||||
"$passwordManager" = "keepassxc";
|
||||
"$menu" = "pkill anyrun || anyrun | xargs hyprctl dispatch exec --";
|
||||
"$menuw" = "pkill anyrun || anyrun | xargs hyprctl dispatch exec --";
|
||||
"$browser" = "firefox";
|
||||
"$browserinc" = "firefox --private-window";
|
||||
"$yazi" = "alacritty -e yazi";
|
||||
"$yazi" = "wezterm -e yazi";
|
||||
|
||||
# See https://wiki.hyprland.org/Configuring/Keywords/ for more
|
||||
"$mod" = "SUPER";
|
||||
|
||||
@@ -20,6 +20,9 @@
|
||||
vscode = {
|
||||
enable = false;
|
||||
};
|
||||
helix = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
gaming = {
|
||||
lutris = {
|
||||
@@ -40,7 +43,7 @@
|
||||
enable = true;
|
||||
};
|
||||
wezterm = {
|
||||
enable = false;
|
||||
enable = true;
|
||||
};
|
||||
zellij = {
|
||||
enable = false;
|
||||
|
||||
@@ -104,6 +104,9 @@
|
||||
udisks = {
|
||||
enable = true;
|
||||
};
|
||||
pcscd = {
|
||||
enable = true;
|
||||
};
|
||||
xserver = {
|
||||
amd = {
|
||||
hhkbse = {
|
||||
@@ -140,6 +143,9 @@
|
||||
npm = {
|
||||
enable = true;
|
||||
};
|
||||
yubikey = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -31,6 +31,12 @@
|
||||
php84Packages.php-cs-fixer
|
||||
phpactor
|
||||
python312Packages.python-lsp-server
|
||||
bash-language-server
|
||||
nil
|
||||
nodePackages.vscode-langservers-extracted
|
||||
clang-tools
|
||||
marksman
|
||||
pyright
|
||||
|
||||
# Formatters
|
||||
alejandra
|
||||
@@ -39,6 +45,7 @@
|
||||
nodePackages_latest.sql-formatter
|
||||
prettierd
|
||||
shfmt
|
||||
luaformatter
|
||||
black
|
||||
];
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
"${systemModules}/sysd/powerd"
|
||||
"${systemModules}/sysd/samba"
|
||||
"${systemModules}/sysd/ssh"
|
||||
"${systemModules}/sysd/pcscd"
|
||||
"${systemModules}/sysd/udisks"
|
||||
"${systemModules}/sysd/xserver/amd"
|
||||
"${systemModules}/sysd/xserver/amd/hhkbse"
|
||||
@@ -35,8 +36,9 @@
|
||||
"${systemModules}/utils/anyrun"
|
||||
"${systemModules}/utils/corectrl"
|
||||
"${systemModules}/utils/microfetch"
|
||||
"${systemModules}/utils/nix-ld"
|
||||
"${systemModules}/utils/misc"
|
||||
"${systemModules}/utils/nix-ld"
|
||||
"${systemModules}/utils/npm"
|
||||
"${systemModules}/utils/yubikey"
|
||||
];
|
||||
}
|
||||
|
||||
15
system/modules/sysd/pcscd/default.nix
Normal file
15
system/modules/sysd/pcscd/default.nix
Normal file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf mkEnableOption;
|
||||
cfg = config.modules.sysd.pcscd;
|
||||
in {
|
||||
options = {
|
||||
modules.sysd.pcscd.enable = mkEnableOption "Enables pcscd";
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
services.pcscd.enable = true;
|
||||
};
|
||||
}
|
||||
22
system/modules/utils/yubikey/default.nix
Normal file
22
system/modules/utils/yubikey/default.nix
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf mkEnableOption;
|
||||
cfg = config.modules.utils.yubikey;
|
||||
in {
|
||||
options = {
|
||||
modules.utils.yubikey.enable = mkEnableOption "Enables yubikey utilities";
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
environment.systemPackages = [
|
||||
pkgs.yubioath-flutter
|
||||
pkgs.yubikey-manager
|
||||
pkgs.yubikey-personalization
|
||||
pkgs.yubikey-personalization-gui
|
||||
pkgs.pcsc-tools
|
||||
];
|
||||
};
|
||||
}
|
||||
@@ -1,94 +0,0 @@
|
||||
{
|
||||
lib,
|
||||
ncurses,
|
||||
pkg-config,
|
||||
fontconfig,
|
||||
installShellFiles,
|
||||
openssl,
|
||||
libGL,
|
||||
libX11,
|
||||
libxkbcommon,
|
||||
xcbutil,
|
||||
xcbutilimage,
|
||||
wayland,
|
||||
nixosTests,
|
||||
runCommand,
|
||||
wezterm-flake,
|
||||
naersk,
|
||||
}: let
|
||||
date = lib.substring 0 8 wezterm-flake.lastModifiedDate; # YYYYMMDD
|
||||
time = lib.substring 8 14 wezterm-flake.lastModifiedDate; # HHMMSS
|
||||
rev = lib.substring 0 8 wezterm-flake.rev;
|
||||
in
|
||||
naersk.buildPackage rec {
|
||||
name = "wezterm";
|
||||
# git -c core.abbrev=8 show -s --format=%cd-%h --date=format:%Y%m%d-%H%M%S | wl-copy -n
|
||||
version = "${date}-${time}-${rev}";
|
||||
|
||||
src = wezterm-flake;
|
||||
gitSubmodules = true;
|
||||
|
||||
nativeBuildInputs = [
|
||||
installShellFiles
|
||||
pkg-config
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
fontconfig
|
||||
libX11
|
||||
libxkbcommon
|
||||
openssl
|
||||
wayland
|
||||
xcbutil
|
||||
xcbutilimage
|
||||
];
|
||||
|
||||
cargoBuildOptions = x: x ++ ["--features distro-defaults"];
|
||||
|
||||
overrideMain = {...}: {
|
||||
postPatch = ''
|
||||
echo ${version} > .tag
|
||||
|
||||
# tests are failing with: Unable to exchange encryption keys
|
||||
rm -r wezterm-ssh/tests
|
||||
'';
|
||||
|
||||
postInstall = ''
|
||||
mkdir -p $out/nix-support
|
||||
echo "${passthru.terminfo}" >> $out/nix-support/propagated-user-env-packages
|
||||
|
||||
install -Dm644 assets/icon/terminal.png $out/share/icons/hicolor/128x128/apps/org.wezfurlong.wezterm.png
|
||||
install -Dm644 assets/wezterm.desktop $out/share/applications/org.wezfurlong.wezterm.desktop
|
||||
install -Dm644 assets/wezterm.appdata.xml $out/share/metainfo/org.wezfurlong.wezterm.appdata.xml
|
||||
|
||||
install -Dm644 assets/shell-integration/wezterm.sh -t $out/etc/profile.d
|
||||
installShellCompletion --cmd wezterm \
|
||||
--bash assets/shell-completion/bash \
|
||||
--fish assets/shell-completion/fish \
|
||||
--zsh assets/shell-completion/zsh
|
||||
|
||||
install -Dm644 assets/wezterm-nautilus.py -t $out/share/nautilus-python/extensions
|
||||
'';
|
||||
|
||||
preFixup = ''
|
||||
patchelf --add-needed "${libGL}/lib/libEGL.so.1" $out/bin/wezterm-gui
|
||||
'';
|
||||
};
|
||||
|
||||
passthru = {
|
||||
tests = {
|
||||
all-terminfo = nixosTests.allTerminfo;
|
||||
terminal-emulators = nixosTests.terminal-emulators.wezterm;
|
||||
};
|
||||
terminfo =
|
||||
runCommand "wezterm-terminfo"
|
||||
{
|
||||
nativeBuildInputs = [
|
||||
ncurses
|
||||
];
|
||||
} ''
|
||||
mkdir -p $out/share/terminfo $out/nix-support
|
||||
tic -x -o $out/share/terminfo ${src}/termwiz/data/wezterm.terminfo
|
||||
'';
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user