feat: neovim lsp

This commit is contained in:
DACHXY 2025-01-13 18:46:15 +08:00
parent 45563277d5
commit c8ef495a63
22 changed files with 177 additions and 86 deletions

36
home/user/bin.nix Normal file
View file

@ -0,0 +1,36 @@
{ pkgs, lib, ... }:
let
findDirs = [
"~/practice"
"~/projects"
];
tmuxSessionizer = pkgs.writeShellScriptBin "tmux-sessionizer" ''
if [[ $# -eq 1 ]]; then
selected=$1
else
selected=$(find ${lib.concatStringsSep " " findDirs} mindepth 1 -maxdepth 1 -type d | fzf)
fi
if [[ -z $selected ]]; then
exit 0
fi
selected_name=$(basename "$selected" | tr . _)
tmux_running=$(pgrep tmux)
if [[ -z $TMUX ]] && [[ -z $tmux_running ]]; then
tmux new-session -s $selected_name -c $selected
exit 0
fi
if ! tmux has-session -t=$selected_name 2> /dev/null; then
tmux new-session -ds $selected_name -c $selected
fi
tmux switch-client -t $selected_name
'';
in
{
home.packages = [ tmuxSessionizer ];
}

View file

@ -1,6 +1,7 @@
let
configDir = ../config;
in {
in
{
home.file = {
".config/wallpapers".source = "${configDir}/wallpapers";
".config/kitty".source = "${configDir}/kitty";

View file

@ -1,4 +1,5 @@
{inputs, ...}: {
{ inputs, ... }:
{
imports = [
./git.nix
./gtk.nix
@ -10,8 +11,8 @@
./virtualization.nix
./hyprland.nix
./swaync.nix
./desktop.nix
./neovim.nix
./bin.nix
inputs.hyprland.homeManagerModules.default
];

View file

@ -1,50 +0,0 @@
{
nvidia-offload-enabled,
lib,
pkgs,
...
}:
let
offloadScript = import ../../system/modules/offload.nix { inherit pkgs; };
launcher = "${offloadScript}/bin/offload firefox";
in
with lib;
{
xdg.desktopEntries = lib.mkIf nvidia-offload-enabled {
firefox = {
actions = {
"new-private-window" = {
exec = "${launcher} --private-window %U";
name = "New Private Window";
};
"new-window" = {
exec = "${launcher} --new-window %U";
name = "New Window";
};
"profile-manager-window" = {
exec = "${launcher} --ProfileManager";
name = "Profile Manager";
};
};
exec = "${launcher} --name firefox %U";
categories = [
"Network"
"WebBrowser"
];
genericName = "Web Browser";
name = "Firefox";
startupNotify = true;
terminal = false;
type = "Application";
icon = "firefox";
mimeType = [
"text/html"
"text/xml"
"application/xhtml+xml"
"application/vnd.mozilla.xul+xml"
"x-scheme-handler/http"
"x-scheme-handler/https"
];
};
};
}

View file

@ -11,7 +11,6 @@
QT_WAYLAND_DISABLE_WINDOWDECORATION = "1";
QT_AUTO_SCREEN_SCALE_FACTOR = "1";
GTK_CSD = "0";
WLR_DRM_DEVICES = "/dev/dri/card1";
WLR_NO_HARDWARE_CURSORS = "1";
CLUTTER_BACKEND = "wayland";
EGL_PLATFORM = "wayland";

View file

@ -6,6 +6,10 @@ let
terminal = "${prefix}ghostty";
filemanager = "nemo";
scripts = "~/.config/scripts";
flatEmoji = "it.mijorus.smile";
# freezeShot = "--freeze";
freezeShot = "";
resizeStep = builtins.toString 20;
brightnessStep = builtins.toString 10;
@ -25,17 +29,17 @@ in
''${mainMod}, P, pseudo, # dwindle''
''${mainMod}, S, togglesplit, # dwindle''
''CTRL ${mainMod} SHIFT, L, exec, hyprlock''
''${mainMod} SHIFT, s, exec, hyprshot -m region --clipboard-only --freeze''
''CTRL SHIFT, s, exec, hyprshot -m window --clipboard-only --freeze''
''CTRL SHIFT ${mainMod}, s, exec, hyprshot -m output --clipboard-only --freeze''
''${mainMod}, PERIOD, exec, flatpak run it.mijorus.smile ''
''${mainMod} SHIFT, s, exec, hyprshot -m region --clipboard-only ${freezeShot}''
''CTRL SHIFT, s, exec, hyprshot -m window --clipboard-only ${freezeShot}''
''CTRL SHIFT ${mainMod}, s, exec, hyprshot -m output --clipboard-only ${freezeShot}''
''${mainMod}, PERIOD, exec, flatpak run ${flatEmoji}''
''${mainMod}, X, exec, sleep 0.1 && swaync-client -t -sw''
''${mainMod} SHIFT, C, centerwindow''
'',F11, fullscreen''
''${mainMod}, C, exec, code''
# Color Picker
''${mainMod} SHIFT, P, exec, hyprpicker -f hex -a -z -r''
''${mainMod} SHIFT, P, exec, hyprpicker -f hex -a -z''
# Cycle windows
''ALT, TAB, cyclenext''
@ -73,6 +77,7 @@ in
# ==== Plugins ==== #
# Overview
''${mainMod}, o, hyprexpo:expo, toggle''
''${mainMod}, TAB, hyprexpo:expo, toggle''
]
++ (
# workspaces

View file

@ -19,7 +19,7 @@ in
firefox = {
enable = true;
package = (pkgs.wrapFirefox (pkgs.firefox-unwrapped.override { pipewireSupport = true; }) { });
languagePacks = [
"en-US"
"zh-TW"
@ -50,6 +50,8 @@ in
"font.name.monospace.ja" = "Noto Sans Mono CJK JP";
"font.name.monospace.x-western" = "CaskaydiaCove Nerd Font Mono";
"font.name.monospace.zh-TW" = "Noto Sans Mono CJK TC";
# Disable Ctrl+Q
"browser.quitShortcut.disabled" = true;
};
};