From 14f65a96338b614be9cb0f316e85fdcc24716f3e Mon Sep 17 00:00:00 2001 From: Donovan Glover Date: Sat, 3 Aug 2024 14:22:47 -0400 Subject: [PATCH] home: Format with nixfmt-rfc-style --- home/eww.nix | 95 ++++--- home/fcitx.nix | 315 +++++++++++----------- home/fish.nix | 140 +++++----- home/git.nix | 9 +- home/hyprland.nix | 125 +++++---- home/ironbar.nix | 334 ++++++++++++----------- home/librewolf.nix | 4 +- home/neovim.nix | 597 +++++++++++++++++++++-------------------- home/qutebrowser.nix | 57 +++- home/rofi.nix | 12 +- home/swaync.nix | 4 +- home/swayosd.nix | 4 +- home/thunar.nix | 9 +- home/udiskie.nix | 4 +- home/xdg-user-dirs.nix | 5 +- home/yazi.nix | 7 +- 16 files changed, 914 insertions(+), 807 deletions(-) diff --git a/home/eww.nix b/home/eww.nix index 933d8979..d4ee3ca2 100644 --- a/home/eww.nix +++ b/home/eww.nix @@ -2,62 +2,71 @@ let inherit (config.home) homeDirectory; - inherit (config.xdg.userDirs) download documents music pictures videos; inherit (config.lib.stylix.colors.withHashtag) base00 base05; inherit (pkgs) eww; + inherit (config.xdg.userDirs) + download + documents + music + pictures + videos + ; + fluent-icons = pkgs.callPackage ../packages/fluent-icons.nix { }; in { home.packages = [ eww ]; - xdg.configFile."eww/eww.yuck".text = /* yuck */ '' - (defwidget icons [] - (box :orientation "h" :spacing 32 - (icon :img "default-user-home" :exec "${homeDirectory}") - (icon :img "default-folder-download" :exec "${download}") - (icon :img "default-folder-documents" :exec "${documents}") - (icon :img "default-folder-music" :exec "${music}") - (icon :img "default-folder-pictures" :exec "${pictures}") - (icon :img "default-folder-video" :exec "${videos}"))) + xdg.configFile."eww/eww.yuck".text = # yuck + '' + (defwidget icons [] + (box :orientation "h" :spacing 32 + (icon :img "default-user-home" :exec "${homeDirectory}") + (icon :img "default-folder-download" :exec "${download}") + (icon :img "default-folder-documents" :exec "${documents}") + (icon :img "default-folder-music" :exec "${music}") + (icon :img "default-folder-pictures" :exec "${pictures}") + (icon :img "default-folder-video" :exec "${videos}"))) - (defwidget icon [img exec] - (eventbox :cursor "pointer" :onclick "lnch thunar ''${exec}" :tooltip "''${exec}" - (image :path "${fluent-icons}/''${img}.png" :image-width 128))) + (defwidget icon [img exec] + (eventbox :cursor "pointer" :onclick "lnch thunar ''${exec}" :tooltip "''${exec}" + (image :path "${fluent-icons}/''${img}.png" :image-width 128))) - (defwindow desktop-icons - :monitor 0 - :geometry (geometry :x "32px" :anchor "bottom center" - :y "8px") - :stacking "bg" - (icons)) + (defwindow desktop-icons + :monitor 0 + :geometry (geometry :x "32px" :anchor "bottom center" + :y "8px") + :stacking "bg" + (icons)) - (defpoll time :interval "1s" - "date '+%H:%M'") + (defpoll time :interval "1s" + "date '+%H:%M'") - (defwindow overlay - :monitor 0 - :geometry (geometry :y "4px" :x "8px" :anchor "bottom right") - :stacking "fg" - time) - ''; + (defwindow overlay + :monitor 0 + :geometry (geometry :y "4px" :x "8px" :anchor "bottom right") + :stacking "fg" + time) + ''; - xdg.configFile."eww/eww.scss".text = /* scss */ '' - img { - all: unset; - } + xdg.configFile."eww/eww.scss".text = # scss + '' + img { + all: unset; + } - .desktop-icons { - all: unset; - } + .desktop-icons { + all: unset; + } - .overlay { - background: transparent; - color: ${base05}; - font-weight: bold; - text-shadow: 0 0 0.075em ${base00}; - font-size: 32px; - opacity: 0.4; - } - ''; + .overlay { + background: transparent; + color: ${base05}; + font-weight: bold; + text-shadow: 0 0 0.075em ${base00}; + font-size: 32px; + opacity: 0.4; + } + ''; } diff --git a/home/fcitx.nix b/home/fcitx.nix index d6c1f7f8..24f5aff6 100644 --- a/home/fcitx.nix +++ b/home/fcitx.nix @@ -8,210 +8,217 @@ let in { xdg.dataFile = { - "fcitx5/themes/${themeName}/theme.conf".text = /* ini */ '' - [Metadata] - Name=${themeName} - Version=0.1 - ScaleWithDPI=True + "fcitx5/themes/${themeName}/theme.conf".text = # ini + '' + [Metadata] + Name=${themeName} + Version=0.1 + ScaleWithDPI=True - [InputPanel] - Font=${font} - NormalColor=${base05} - HighlightCandidateColor=${base05} - HighlightColor=${base05} - HighlightBackgroundColor=${base01} - Spacing=6 + [InputPanel] + Font=${font} + NormalColor=${base05} + HighlightCandidateColor=${base05} + HighlightColor=${base05} + HighlightBackgroundColor=${base01} + Spacing=6 - [InputPanel/TextMargin] - Left=5 - Right=5 - Top=5 - Bottom=5 + [InputPanel/TextMargin] + Left=5 + Right=5 + Top=5 + Bottom=5 - [InputPanel/ContentMargin] - Left=2 - Right=2 - Top=2 - Bottom=2 + [InputPanel/ContentMargin] + Left=2 + Right=2 + Top=2 + Bottom=2 - [InputPanel/Background/Margin] - Left=2 - Right=2 - Top=2 - Bottom=2 + [InputPanel/Background/Margin] + Left=2 + Right=2 + Top=2 + Bottom=2 - [InputPanel/Background] - Color=${base01} + [InputPanel/Background] + Color=${base01} - [InputPanel/Highlight] - Color=${base02} + [InputPanel/Highlight] + Color=${base02} - [InputPanel/Highlight/Margin] - Left=5 - Right=7 - Top=5 - Bottom=5 + [InputPanel/Highlight/Margin] + Left=5 + Right=7 + Top=5 + Bottom=5 - [Menu] - NormalColor=${base01} + [Menu] + NormalColor=${base01} - [Menu/Background] - Color=${base01} + [Menu/Background] + Color=${base01} - [Menu/Highlight] - Color=${base02} + [Menu/Highlight] + Color=${base02} - [Menu/Separator] - Color=${base02} + [Menu/Separator] + Color=${base02} - [Menu/Background/Margin] - Left=2 - Right=2 - Top=2 - Bottom=2 + [Menu/Background/Margin] + Left=2 + Right=2 + Top=2 + Bottom=2 - [Menu/ContentMargin] - Left=2 - Right=2 - Top=2 - Bottom=2 + [Menu/ContentMargin] + Left=2 + Right=2 + Top=2 + Bottom=2 - [Menu/Highlight/Margin] - Left=5 - Right=5 - Top=5 - Bottom=5 + [Menu/Highlight/Margin] + Left=5 + Right=5 + Top=5 + Bottom=5 - [Menu/TextMargin] - Left=5 - Right=5 - Top=5 - Bottom=5 - ''; + [Menu/TextMargin] + Left=5 + Right=5 + Top=5 + Bottom=5 + ''; }; xdg.configFile = { "mozc/ibus_config.textproto" = { force = true; - text = /* textproto */ '' - engines { - name : "mozc-jp" - longname : "Mozc" - layout : "default" - layout_variant : "" - layout_option : "" - rank : 80 - } - active_on_launch: True - ''; + text = # textproto + '' + engines { + name : "mozc-jp" + longname : "Mozc" + layout : "default" + layout_variant : "" + layout_option : "" + rank : 80 + } + active_on_launch: True + ''; }; "fcitx5/config" = { force = true; - text = /* ini */ '' - [Hotkey] - EnumerateWithTriggerKeys=True - AltTriggerKeys= - EnumerateForwardKeys= - EnumerateBackwardKeys= - EnumerateSkipFirst=False - EnumerateGroupForwardKeys= - EnumerateGroupBackwardKeys= - ActivateKeys= - DeactivateKeys= + text = # ini + '' + [Hotkey] + EnumerateWithTriggerKeys=True + AltTriggerKeys= + EnumerateForwardKeys= + EnumerateBackwardKeys= + EnumerateSkipFirst=False + EnumerateGroupForwardKeys= + EnumerateGroupBackwardKeys= + ActivateKeys= + DeactivateKeys= - [Hotkey/TriggerKeys] - 0=Super+space + [Hotkey/TriggerKeys] + 0=Super+space - [Hotkey/PrevPage] - 0=Up + [Hotkey/PrevPage] + 0=Up - [Hotkey/NextPage] - 0=Down + [Hotkey/NextPage] + 0=Down - [Hotkey/PrevCandidate] - 0=Shift+Tab + [Hotkey/PrevCandidate] + 0=Shift+Tab - [Hotkey/NextCandidate] - 0=Tab + [Hotkey/NextCandidate] + 0=Tab - [Hotkey/TogglePreedit] - 0=Control+Alt+P + [Hotkey/TogglePreedit] + 0=Control+Alt+P - [Behavior] - ActiveByDefault=False - ShareInputState=No - PreeditEnabledByDefault=True - ShowInputMethodInformation=True - showInputMethodInformationWhenFocusIn=False - CompactInputMethodInformation=True - ShowFirstInputMethodInformation=True - DefaultPageSize=5 - OverrideXkbOption=False - CustomXkbOption= - EnabledAddons= - DisabledAddons= - PreloadInputMethod=True - ''; + [Behavior] + ActiveByDefault=False + ShareInputState=No + PreeditEnabledByDefault=True + ShowInputMethodInformation=True + showInputMethodInformationWhenFocusIn=False + CompactInputMethodInformation=True + ShowFirstInputMethodInformation=True + DefaultPageSize=5 + OverrideXkbOption=False + CustomXkbOption= + EnabledAddons= + DisabledAddons= + PreloadInputMethod=True + ''; }; "fcitx5/profile" = { force = true; - text = /* ini */ '' - [Groups/0] - Name="Group 1" - Default Layout=us - DefaultIM=mozc + text = # ini + '' + [Groups/0] + Name="Group 1" + Default Layout=us + DefaultIM=mozc - [Groups/0/Items/0] - Name=keyboard-us - Layout= + [Groups/0/Items/0] + Name=keyboard-us + Layout= - [Groups/0/Items/1] - Name=mozc - Layout= + [Groups/0/Items/1] + Name=mozc + Layout= - [GroupOrder] - 0="Group 1" - ''; + [GroupOrder] + 0="Group 1" + ''; }; "fcitx5/conf/classicui.conf" = { force = true; - text = /* ini */ '' - Vertical Candidate List=False - PerScreenDPI=True - WheelForPaging=True - Font="${font}" - MenuFont="${font}" - TrayFont="${font}" - TrayOutlineColor=${base02} - TrayTextColor=${base05} - PreferTextIcon=False - ShowLayoutNameInIcon=True - UseInputMethodLangaugeToDisplayText=True - Theme=${themeName} - ''; + text = # ini + '' + Vertical Candidate List=False + PerScreenDPI=True + WheelForPaging=True + Font="${font}" + MenuFont="${font}" + TrayFont="${font}" + TrayOutlineColor=${base02} + TrayTextColor=${base05} + PreferTextIcon=False + ShowLayoutNameInIcon=True + UseInputMethodLangaugeToDisplayText=True + Theme=${themeName} + ''; }; "fcitx5/conf/clipboard.conf" = { force = true; - text = /* ini */ '' - TriggerKey= - PastePrimaryKey= - Number of entries=5 - ''; + text = # ini + '' + TriggerKey= + PastePrimaryKey= + Number of entries=5 + ''; }; "fcitx5/conf/mozc.conf" = { force = true; - text = /* ini */ '' - InitialMode=Hiragana - Vertical=True - ExpandMode="On Focus" - PreeditCursorPositionAtBeginning=False - ExpandKey=Control+Alt+H - ''; + text = # ini + '' + InitialMode=Hiragana + Vertical=True + ExpandMode="On Focus" + PreeditCursorPositionAtBeginning=False + ExpandKey=Control+Alt+H + ''; }; "fcitx5/conf/notifications.conf" = { diff --git a/home/fish.nix b/home/fish.nix index 567e67f5..ad2df866 100644 --- a/home/fish.nix +++ b/home/fish.nix @@ -4,23 +4,24 @@ programs.fish = { enable = true; - shellInit = /* fish */ '' - set -U fish_greeting "" + shellInit = # fish + '' + set -U fish_greeting "" - set -x -U LESS_TERMCAP_md (printf "\e[01;31m") - set -x -U LESS_TERMCAP_me (printf "\e[0m") - set -x -U LESS_TERMCAP_se (printf "\e[0m") - set -x -U LESS_TERMCAP_so (printf "\e[01;44;30m") - set -x -U LESS_TERMCAP_ue (printf "\e[0m") - set -x -U LESS_TERMCAP_us (printf "\e[01;32m") - set -x -U MANROFFOPT "-c" + set -x -U LESS_TERMCAP_md (printf "\e[01;31m") + set -x -U LESS_TERMCAP_me (printf "\e[0m") + set -x -U LESS_TERMCAP_se (printf "\e[0m") + set -x -U LESS_TERMCAP_so (printf "\e[01;44;30m") + set -x -U LESS_TERMCAP_ue (printf "\e[0m") + set -x -U LESS_TERMCAP_us (printf "\e[01;32m") + set -x -U MANROFFOPT "-c" - fish_default_key_bindings + fish_default_key_bindings - if string match -qe -- "/dev/pts/" (tty) - alias ssh="kitty +kitten ssh" - end - ''; + if string match -qe -- "/dev/pts/" (tty) + alias ssh="kitty +kitten ssh" + end + ''; shellAliases = { tree = "eza --all --long --tree"; @@ -129,76 +130,81 @@ }; functions = { - wav2flac = /* fish */ '' - set ORIGINAL_SIZE (du -hs | cut -f1) + wav2flac = # fish + '' + set ORIGINAL_SIZE (du -hs | cut -f1) - fd -e wav -x ffmpeg -i "{}" -loglevel quiet -stats "{.}.flac" - fd -e wav -X trash + fd -e wav -x ffmpeg -i "{}" -loglevel quiet -stats "{.}.flac" + fd -e wav -X trash - set NEW_SIZE (du -hs | cut -f1) + set NEW_SIZE (du -hs | cut -f1) - echo "Done. Reduced file size from $ORIGINAL_SIZE to $NEW_SIZE" - ''; + echo "Done. Reduced file size from $ORIGINAL_SIZE to $NEW_SIZE" + ''; - opus = /* fish */ '' - set ORIGINAL_SIZE (du -hs | cut -f1) + opus = # fish + '' + set ORIGINAL_SIZE (du -hs | cut -f1) - fd -e wav -e flac -x ffmpeg -i "{}" -c:a libopus -b:a 128K -loglevel quiet -stats "{.}.opus" - fd -e wav -e flac -X rm -I + fd -e wav -e flac -x ffmpeg -i "{}" -c:a libopus -b:a 128K -loglevel quiet -stats "{.}.opus" + fd -e wav -e flac -X rm -I - set NEW_SIZE (du -hs | cut -f1) + set NEW_SIZE (du -hs | cut -f1) - echo "Done. Reduced file size from $ORIGINAL_SIZE to $NEW_SIZE" - ''; + echo "Done. Reduced file size from $ORIGINAL_SIZE to $NEW_SIZE" + ''; - epub2pdf = /* fish */ '' - if string match -qe -- ".epub" "$argv"; - set BASE (string split -f 1 ".epub" "$argv") - ${pkgs.calibre}/bin/ebook-convert "$argv" "$BASE.pdf"; and trash "$argv" - else - echo "Usage: epub2pdf [file.epub]" - end - ''; + epub2pdf = # fish + '' + if string match -qe -- ".epub" "$argv"; + set BASE (string split -f 1 ".epub" "$argv") + ${pkgs.calibre}/bin/ebook-convert "$argv" "$BASE.pdf"; and trash "$argv" + else + echo "Usage: epub2pdf [file.epub]" + end + ''; - tmp = /* fish */ '' - set MULLVAD_CACHE "/tmp/mullvad.json" + tmp = # fish + '' + set MULLVAD_CACHE "/tmp/mullvad.json" - if not test -e $MULLVAD_CACHE - curl https://api.mullvad.net/www/relays/wireguard > $MULLVAD_CACHE - end + if not test -e $MULLVAD_CACHE + curl https://api.mullvad.net/www/relays/wireguard > $MULLVAD_CACHE + end - set CONTAINER_PROXY (random choice (cat $MULLVAD_CACHE | jq -r '.[] | select(.active) | select(.hostname | startswith("jp")) | .socks_name')) - set CONTAINER_ID "qtb-$(uuidgen)" - set SHORT (string split "." "$CONTAINER_PROXY" -f 1) + set CONTAINER_PROXY (random choice (cat $MULLVAD_CACHE | jq -r '.[] | select(.active) | select(.hostname | startswith("jp")) | .socks_name')) + set CONTAINER_ID "qtb-$(uuidgen)" + set SHORT (string split "." "$CONTAINER_PROXY" -f 1) - mkdir -p "/tmp/$CONTAINER_ID/config/bookmarks" - mkdir -p "/tmp/$CONTAINER_ID/data/userscripts" + mkdir -p "/tmp/$CONTAINER_ID/config/bookmarks" + mkdir -p "/tmp/$CONTAINER_ID/data/userscripts" - ln -s ~/.config/qutebrowser/bookmarks/urls "/tmp/$CONTAINER_ID/config/bookmarks/urls" - ln -s ~/.config/qutebrowser/quickmarks "/tmp/$CONTAINER_ID/config/quickmarks" + ln -s ~/.config/qutebrowser/bookmarks/urls "/tmp/$CONTAINER_ID/config/bookmarks/urls" + ln -s ~/.config/qutebrowser/quickmarks "/tmp/$CONTAINER_ID/config/quickmarks" - TZ="Asia/Tokyo" lnch qutebrowser \ - --set content.proxy "socks5://$CONTAINER_PROXY:1080" \ - --set window.title_format "{perc}[$SHORT]{title_sep}{current_title}" \ - --basedir "/tmp/$CONTAINER_ID" \ - --config-py "$HOME/.config/qutebrowser/config.py" \ - :adblock-update \ - "$argv" - ''; + TZ="Asia/Tokyo" lnch qutebrowser \ + --set content.proxy "socks5://$CONTAINER_PROXY:1080" \ + --set window.title_format "{perc}[$SHORT]{title_sep}{current_title}" \ + --basedir "/tmp/$CONTAINER_ID" \ + --config-py "$HOME/.config/qutebrowser/config.py" \ + :adblock-update \ + "$argv" + ''; - ex = /* fish */ '' - if string match -qe -- ".part1." "$argv"; - set BASE (string split -f 1 ".part1." "$argv") + ex = # fish + '' + if string match -qe -- ".part1." "$argv"; + set BASE (string split -f 1 ".part1." "$argv") - unar "$argv" && fd -d 1 "$BASE.part" -X trash - else if string match -qe -- ".part01." "$argv"; - set BASE (string split -f 1 ".part01." "$argv") + unar "$argv" && fd -d 1 "$BASE.part" -X trash + else if string match -qe -- ".part01." "$argv"; + set BASE (string split -f 1 ".part01." "$argv") - unar "$argv" && fd -d 1 "$BASE.part" -X trash - else - unar "$argv" && trash "$argv" - end - ''; + unar "$argv" && fd -d 1 "$BASE.part" -X trash + else + unar "$argv" && trash "$argv" + end + ''; }; }; } diff --git a/home/git.nix b/home/git.nix index 0e6227cb..36151d71 100644 --- a/home/git.nix +++ b/home/git.nix @@ -4,7 +4,10 @@ let inherit (pkgs) tig mgitstatus; in { - home.packages = [ tig mgitstatus ]; + home.packages = [ + tig + mgitstatus + ]; xdg.configFile."tig/config".text = '' color cursor black green bold @@ -22,9 +25,7 @@ in verify = "log --show-signature"; }; - attributes = [ - "*.lockb binary diff=lockb" - ]; + attributes = [ "*.lockb binary diff=lockb" ]; extraConfig = { include.path = "~/.gituser"; diff --git a/home/hyprland.nix b/home/hyprland.nix index 6649b93f..e53518c1 100644 --- a/home/hyprland.nix +++ b/home/hyprland.nix @@ -1,4 +1,9 @@ -{ pkgs, lib, vars, ... }: +{ + pkgs, + lib, + vars, + ... +}: let inherit (pkgs) polkit_gnome callPackage; @@ -258,89 +263,95 @@ in ]; }; - extraConfig = /* hyprlang */ '' - bind = CTRL, Alt_L, submap, passthrough - submap = passthrough - bind = CTRL, Alt_L, submap, reset - submap = reset - ''; + extraConfig = # hyprlang + '' + bind = CTRL, Alt_L, submap, passthrough + submap = passthrough + bind = CTRL, Alt_L, submap, reset + submap = reset + ''; }; xdg.configFile = { ${gapsScript} = { executable = true; - text = /* fish */ '' - #!/usr/bin/env fish + text = # fish + '' + #!/usr/bin/env fish - hyprctl keyword general:gaps_out $(math 10 - $(hyprctl getoption general:gaps_out -j | jq -r ".custom" | choose 1)) - hyprctl keyword general:gaps_in $(math 5 - $(hyprctl getoption general:gaps_in -j | jq -r ".custom" | choose 1)) - hyprctl keyword general:border_size $(math 2 - $(hyprctl getoption general:border_size -j | jq -r ".int")) - hyprctl keyword decoration:rounding $(math 8 - $(hyprctl getoption decoration:rounding -j | jq -r ".int")) - ''; + hyprctl keyword general:gaps_out $(math 10 - $(hyprctl getoption general:gaps_out -j | jq -r ".custom" | choose 1)) + hyprctl keyword general:gaps_in $(math 5 - $(hyprctl getoption general:gaps_in -j | jq -r ".custom" | choose 1)) + hyprctl keyword general:border_size $(math 2 - $(hyprctl getoption general:border_size -j | jq -r ".int")) + hyprctl keyword decoration:rounding $(math 8 - $(hyprctl getoption decoration:rounding -j | jq -r ".int")) + ''; }; ${setBackgroundScript} = { executable = true; - text = /* fish */ '' - #!/usr/bin/env fish + text = # fish + '' + #!/usr/bin/env fish - if [ (hyprctl getoption animations:enabled -j | jq -r ".int") = "1" ] - swww img \ - --transition-type $(random choice grow wave outer) \ - --transition-wave 80,40 \ - --transition-angle $(random choice 45 90 135 225 270 315) \ - --transition-pos $(random choice center top left right bottom top-left top-right bottom-left bottom-right) \ - --transition-step 200 \ - --transition-duration 1.5 \ - --transition-fps 240 \ - --outputs "$argv[1]" \ - "$argv[2]" - else - swww img \ - --transition-type simple \ - --transition-step 255 \ - --outputs "$argv[1]" \ - "$argv[2]" - end - ''; + if [ (hyprctl getoption animations:enabled -j | jq -r ".int") = "1" ] + swww img \ + --transition-type $(random choice grow wave outer) \ + --transition-wave 80,40 \ + --transition-angle $(random choice 45 90 135 225 270 315) \ + --transition-pos $(random choice center top left right bottom top-left top-right bottom-left bottom-right) \ + --transition-step 200 \ + --transition-duration 1.5 \ + --transition-fps 240 \ + --outputs "$argv[1]" \ + "$argv[2]" + else + swww img \ + --transition-type simple \ + --transition-step 255 \ + --outputs "$argv[1]" \ + "$argv[2]" + end + ''; }; ${randomBackgroundScript} = { executable = true; - text = /* fish */ '' - #!/usr/bin/env fish + text = # fish + '' + #!/usr/bin/env fish - for monitor in (hyprctl monitors -j | jq -r '.[].name') - ~/.config/${setBackgroundScript} "$monitor" "$(random choice $(fd . ${osu-backgrounds}/2024-07-15-Aerial-Antics-Art-Contest-All-Entries --follow -e jpg -e png))" - end - ''; + for monitor in (hyprctl monitors -j | jq -r '.[].name') + ~/.config/${setBackgroundScript} "$monitor" "$(random choice $(fd . ${osu-backgrounds}/2024-07-15-Aerial-Antics-Art-Contest-All-Entries --follow -e jpg -e png))" + end + ''; }; ${swapBackgroundScript} = { executable = true; - text = /* fish */ '' - #!/usr/bin/env fish + text = # fish + '' + #!/usr/bin/env fish - set M "$(swww query | cut -d ':' -f 5)" - set M1 "$(echo "$M" | head -n 1 | awk '{$1=$1};1')" - set M2 "$(echo "$M" | tail -n 1 | awk '{$1=$1};1')" + set M "$(swww query | cut -d ':' -f 5)" + set M1 "$(echo "$M" | head -n 1 | awk '{$1=$1};1')" + set M2 "$(echo "$M" | tail -n 1 | awk '{$1=$1};1')" - ~/.config/${setBackgroundScript} "$(swww query | choose 0 | choose -c 0..-1 | tail -n 1)" "$M1" - ~/.config/${setBackgroundScript} "$(swww query | choose 0 | choose -c 0..-1 | head -n 1)" "$M2" - ''; + ~/.config/${setBackgroundScript} "$(swww query | choose 0 | choose -c 0..-1 | tail -n 1)" "$M1" + ~/.config/${setBackgroundScript} "$(swww query | choose 0 | choose -c 0..-1 | head -n 1)" "$M2" + ''; }; ${monitorScript} = { executable = true; - text = /* fish */ '' - #!/usr/bin/env fish + text = # fish + '' + #!/usr/bin/env fish - if test -n "$(hyprctl monitors -j | jq -r '.[] | select(.name | contains("eDP-1"))')" - hyprctl keyword monitor eDP-1,disable - else - hyprctl keyword monitor eDP-1,preferred,auto-left,1 - end - ''; + if test -n "$(hyprctl monitors -j | jq -r '.[] | select(.name | contains("eDP-1"))')" + hyprctl keyword monitor eDP-1,disable + else + hyprctl keyword monitor eDP-1,preferred,auto-left,1 + end + ''; }; }; diff --git a/home/ironbar.nix b/home/ironbar.nix index 9f908fd4..ee97befb 100644 --- a/home/ironbar.nix +++ b/home/ironbar.nix @@ -1,11 +1,23 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: let inherit (lib) singleton; - inherit (config.lib.stylix.colors.withHashtag) base00 base01 base04 base05 base0D; inherit (pkgs) ironbar inotify-tools; inherit (builtins) toJSON; + inherit (config.lib.stylix.colors.withHashtag) + base00 + base01 + base04 + base05 + base0D + ; + mullvadScript = "ironbar/mullvad.fish"; volumeScript = "ironbar/volume.fish"; volumeGet = "ironbar/volume-get.fish"; @@ -63,211 +75,213 @@ in type = "clock"; format = "%x(%a)%R"; } - { - type = "notifications"; - } + { type = "notifications"; } ]; }; - "ironbar/style.css".text = /* css */ '' - * { - font-family: "Noto Sans CJK JP", "Font Awesome 6 Free Solid"; - font-size: 16px; - text-shadow: 2px 2px ${base00}; - border: none; - border-radius: 0; - outline: none; - font-weight: 500; - background: none; - color: ${base05}; - } + "ironbar/style.css".text = # css + '' + * { + font-family: "Noto Sans CJK JP", "Font Awesome 6 Free Solid"; + font-size: 16px; + text-shadow: 2px 2px ${base00}; + border: none; + border-radius: 0; + outline: none; + font-weight: 500; + background: none; + color: ${base05}; + } - .background { - background: alpha(${base00}, 0.925); - } + .background { + background: alpha(${base00}, 0.925); + } - button:hover { - background: ${base01}; - } + button:hover { + background: ${base01}; + } - #bar { - border-top: 1px solid ${base01}; - } + #bar { + border-top: 1px solid ${base01}; + } - .label, .script, .tray { - padding-left: 0.5em; - padding-right: 0.5em; - } + .label, .script, .tray { + padding-left: 0.5em; + padding-right: 0.5em; + } - .notifications button { - padding-left: 0.2em; - padding-right: 0.7em; - } + .notifications button { + padding-left: 0.2em; + padding-right: 0.7em; + } - .upower { - padding-left: 0.2em; - padding-right: 0.2em; - } + .upower { + padding-left: 0.2em; + padding-right: 0.2em; + } - .upower .label { - padding-left: 0; - padding-right: 0; - } + .upower .label { + padding-left: 0; + padding-right: 0; + } - .popup { - border: 1px solid ${base01}; - padding: 1em; - } + .popup { + border: 1px solid ${base01}; + padding: 1em; + } - .clock { - padding-right: 0.4em; - } + .clock { + padding-right: 0.4em; + } - .popup-clock .calendar-clock { - font-family: "Maple Mono"; - font-size: 2.5em; - padding-bottom: 0.1em; - } + .popup-clock .calendar-clock { + font-family: "Maple Mono"; + font-size: 2.5em; + padding-bottom: 0.1em; + } - .popup-clock .calendar .header { - padding-top: 1em; - border-top: 1px solid ${base01}; - font-size: 1.5em; - } + .popup-clock .calendar .header { + padding-top: 1em; + border-top: 1px solid ${base01}; + font-size: 1.5em; + } - .popup-clock .calendar { - padding: 0.2em 0.4em; - } + .popup-clock .calendar { + padding: 0.2em 0.4em; + } - .popup-clock .calendar:selected { - color: ${base0D}; - } + .popup-clock .calendar:selected { + color: ${base0D}; + } - .launcher .item { - padding-left: 1em; - padding-right: 1em; - margin-right: 4px; - } + .launcher .item { + padding-left: 1em; + padding-right: 1em; + margin-right: 4px; + } - button:active { - background: ${base04}; - } + button:active { + background: ${base04}; + } - .launcher .open { - box-shadow: inset 0 -2px ${base04}; - } + .launcher .open { + box-shadow: inset 0 -2px ${base04}; + } - .launcher .focused { - box-shadow: inset 0 -2px ${base0D}; - background: ${base01}; - } + .launcher .focused { + box-shadow: inset 0 -2px ${base0D}; + background: ${base01}; + } - .popup-launcher { - padding: 0; - } + .popup-launcher { + padding: 0; + } - .popup-launcher .popup-item:not(:first-child) { - border-top: 1px solid ${base01}; - } + .popup-launcher .popup-item:not(:first-child) { + border-top: 1px solid ${base01}; + } - #startMenu { - padding-left: 1em; - padding-right: 0.5em; - } - ''; + #startMenu { + padding-left: 1em; + padding-right: 0.5em; + } + ''; ${mullvadScript} = { executable = true; - text = /* fish */ '' - #!/usr/bin/env fish + text = # fish + '' + #!/usr/bin/env fish - sleep 2 + sleep 2 - function get_mullvad_status - if test -z "$inside" - set inside true - test -n "$initialized" && sleep 0.2 + function get_mullvad_status + if test -z "$inside" + set inside true + test -n "$initialized" && sleep 0.2 - set MULLVAD (mullvad status | head -1) + set MULLVAD (mullvad status | head -1) - set LOCATION (echo "$MULLVAD" | choose 4.. | sed \ - -e 's/Ashburn.*/アッシュバーン/g' \ - -e 's/Atlanta.*/アトランタ/g' \ - -e 's/Boston.*/ボストン/g' \ - -e 's/Charlotte.*/シャーロット/g' \ - -e 's/Chicago.*/シカゴ/g' \ - -e 's/Cleveland.*/クリーブランド/g' \ - -e 's/Dallas.*/ダラス/g' \ - -e 's/Detroit.*/デトロイト/g' \ - -e 's/Denver.*/デンバー/g' \ - -e 's/Honolulu.*/ホノルル/g' \ - -e 's/Houston.*/ヒューストン/g' \ - -e 's/Jackson.*/ジャクソン/g' \ - -e 's/Los Angeles.*/ロサンゼルス/g' \ - -e 's/Louisville.*/ルイビル/g' \ - -e 's/McAllen.*/マッカレン/g' \ - -e 's/Miami.*/マイアミ/g' \ - -e 's/Milwaukee.*/ミルウォーキー/g' \ - -e 's/Minneapolis.*/ミネアポリス/g' \ - -e 's/New York.*/ニューヨーク/g' \ - -e 's/Oklahoma.*/オクラホマシティ/g' \ - -e 's/Philadelphia.*/フィラデルフィア/g' \ - -e 's/Phoenix.*/フィニックス/g' \ - -e 's/Piscataway.*/ピスカタウェイ/g' \ - -e 's/Portland.*/ポートランド/g' \ - -e 's/Raleigh.*/ローリー/g' \ - -e 's/Richmond.*/リッチモンド/g' \ - -e 's/Salt Lake.*/ソルトレイクシティ/g' \ - -e 's/San Francisco.*/サンフランシスコ/g' \ - -e 's/San Jose.*/サンノゼ/g' \ - -e 's/Seattle.*/シアトル/g' \ - -e 's/Secaucus.*/セコーカス/g' \ - -e 's/Sioux Falls.*/スーフォールズ/g' \ - -e 's/St. Louis.*/セントルイス/g' \ - -e 's/Stamford.*/スタンフォード/g' \ - -e 's/Washington.*/ワシントン/g' - ) + set LOCATION (echo "$MULLVAD" | choose 4.. | sed \ + -e 's/Ashburn.*/アッシュバーン/g' \ + -e 's/Atlanta.*/アトランタ/g' \ + -e 's/Boston.*/ボストン/g' \ + -e 's/Charlotte.*/シャーロット/g' \ + -e 's/Chicago.*/シカゴ/g' \ + -e 's/Cleveland.*/クリーブランド/g' \ + -e 's/Dallas.*/ダラス/g' \ + -e 's/Detroit.*/デトロイト/g' \ + -e 's/Denver.*/デンバー/g' \ + -e 's/Honolulu.*/ホノルル/g' \ + -e 's/Houston.*/ヒューストン/g' \ + -e 's/Jackson.*/ジャクソン/g' \ + -e 's/Los Angeles.*/ロサンゼルス/g' \ + -e 's/Louisville.*/ルイビル/g' \ + -e 's/McAllen.*/マッカレン/g' \ + -e 's/Miami.*/マイアミ/g' \ + -e 's/Milwaukee.*/ミルウォーキー/g' \ + -e 's/Minneapolis.*/ミネアポリス/g' \ + -e 's/New York.*/ニューヨーク/g' \ + -e 's/Oklahoma.*/オクラホマシティ/g' \ + -e 's/Philadelphia.*/フィラデルフィア/g' \ + -e 's/Phoenix.*/フィニックス/g' \ + -e 's/Piscataway.*/ピスカタウェイ/g' \ + -e 's/Portland.*/ポートランド/g' \ + -e 's/Raleigh.*/ローリー/g' \ + -e 's/Richmond.*/リッチモンド/g' \ + -e 's/Salt Lake.*/ソルトレイクシティ/g' \ + -e 's/San Francisco.*/サンフランシスコ/g' \ + -e 's/San Jose.*/サンノゼ/g' \ + -e 's/Seattle.*/シアトル/g' \ + -e 's/Secaucus.*/セコーカス/g' \ + -e 's/Sioux Falls.*/スーフォールズ/g' \ + -e 's/St. Louis.*/セントルイス/g' \ + -e 's/Stamford.*/スタンフォード/g' \ + -e 's/Washington.*/ワシントン/g' + ) - echo "$LOCATION" + echo "$LOCATION" - set -e inside + set -e inside + end end - end - get_mullvad_status - set initialized true - - ${inotify-tools}/bin/inotifywait -q -e close_write,moved_to,create -m /etc/mullvad-vpn | - while read directory events filename get_mullvad_status - end - ''; + set initialized true + + ${inotify-tools}/bin/inotifywait -q -e close_write,moved_to,create -m /etc/mullvad-vpn | + while read directory events filename + get_mullvad_status + end + ''; }; ${volumeScript} = { executable = true; - text = /* fish */ '' - #!/usr/bin/env fish + text = # fish + '' + #!/usr/bin/env fish - function get_volume - set VOLUME (wpctl get-volume @DEFAULT_AUDIO_SINK@ | choose 1) - echo "音量:$(math "$VOLUME * 100")%" - end + function get_volume + set VOLUME (wpctl get-volume @DEFAULT_AUDIO_SINK@ | choose 1) + echo "音量:$(math "$VOLUME * 100")%" + end - ~/.config/${volumeGet} + ~/.config/${volumeGet} - pactl subscribe | grep --line-buffered -e "シンク" | xargs -L 1 ~/.config/${volumeGet} - ''; + pactl subscribe | grep --line-buffered -e "シンク" | xargs -L 1 ~/.config/${volumeGet} + ''; }; ${volumeGet} = { executable = true; - text = /* fish */ '' - #!/usr/bin/env fish + text = # fish + '' + #!/usr/bin/env fish - set VOLUME (wpctl get-volume @DEFAULT_AUDIO_SINK@ | choose 1) - echo "音量:$(math "$VOLUME * 100")%" - ''; + set VOLUME (wpctl get-volume @DEFAULT_AUDIO_SINK@ | choose 1) + echo "音量:$(math "$VOLUME * 100")%" + ''; }; }; } diff --git a/home/librewolf.nix b/home/librewolf.nix index e6b8bedf..e86fa2c6 100644 --- a/home/librewolf.nix +++ b/home/librewolf.nix @@ -7,9 +7,7 @@ in programs.librewolf = { enable = true; - package = librewolf.override { - cfg.speechSynthesisSupport = false; - }; + package = librewolf.override { cfg.speechSynthesisSupport = false; }; settings = { "middlemouse.paste" = false; diff --git a/home/neovim.nix b/home/neovim.nix index cc9c94ec..b72c43a3 100644 --- a/home/neovim.nix +++ b/home/neovim.nix @@ -54,108 +54,113 @@ universal-ctags ]; - extraConfig = /* vim */ '' - filetype plugin indent on - set undofile - set spell - set number - set linebreak - set clipboard=unnamedplus - set fileencoding=utf-8 " Ensure that we always save files as utf-8 - set fileencodings=utf-8,sjis " Automatically open shiftjis files with their proper encoding - set spelllang=en_us,cjk " Don't show errors for CJK characters - set noshowmode " Disable the --MODE-- text (enable if not using the status line) - set mouse=a - set ignorecase " By default use case-insensitive search (combine with smartcase) - set smartcase " Make search case-sensitive when using capital letters - set scrolloff=1 " The minimal number of rows to show when scrolling up/down - set sidescrolloff=5 " The minimal number of columns to show when scrolling left/right - set tabstop=4 " Show a tab character as 4 spaces - set softtabstop=0 " Edit soft tabs as if they're regular spaces - set shiftwidth=4 " Make autoindent appear as 4 spaces + extraConfig = # vim + '' + filetype plugin indent on + set undofile + set spell + set number + set linebreak + set clipboard=unnamedplus + set fileencoding=utf-8 " Ensure that we always save files as utf-8 + set fileencodings=utf-8,sjis " Automatically open shiftjis files with their proper encoding + set spelllang=en_us,cjk " Don't show errors for CJK characters + set noshowmode " Disable the --MODE-- text (enable if not using the status line) + set mouse=a + set ignorecase " By default use case-insensitive search (combine with smartcase) + set smartcase " Make search case-sensitive when using capital letters + set scrolloff=1 " The minimal number of rows to show when scrolling up/down + set sidescrolloff=5 " The minimal number of columns to show when scrolling left/right + set tabstop=4 " Show a tab character as 4 spaces + set softtabstop=0 " Edit soft tabs as if they're regular spaces + set shiftwidth=4 " Make autoindent appear as 4 spaces - set foldmethod=indent - set foldlevelstart=99 + set foldmethod=indent + set foldlevelstart=99 - map - imap - map <2-MiddleMouse> - imap <2-MiddleMouse> - map <3-MiddleMouse> - imap <3-MiddleMouse> - map <4-MiddleMouse> - imap <4-MiddleMouse> + map + imap + map <2-MiddleMouse> + imap <2-MiddleMouse> + map <3-MiddleMouse> + imap <3-MiddleMouse> + map <4-MiddleMouse> + imap <4-MiddleMouse> - highlight Search ctermbg=240 ctermfg=255 - highlight IncSearch ctermbg=255 ctermfg=240 + highlight Search ctermbg=240 ctermfg=255 + highlight IncSearch ctermbg=255 ctermfg=240 - let mapleader = ' ' - nnoremap e :set nu! - nnoremap o :GitBlameToggle - nnoremap a :NvimTreeFocus - nnoremap d :bp\|bd # - nnoremap f :Files - nnoremap g :set hlsearch! - nnoremap j :Buffers - nnoremap l :Rg - nnoremap ; :NvimTreeToggle - nnoremap b :Vista!! - vnoremap y:silent !notify-send -t 4000 "成果" "$(tango '0')": + let mapleader = ' ' + nnoremap e :set nu! + nnoremap o :GitBlameToggle + nnoremap a :NvimTreeFocus + nnoremap d :bp\|bd # + nnoremap f :Files + nnoremap g :set hlsearch! + nnoremap j :Buffers + nnoremap l :Rg + nnoremap ; :NvimTreeToggle + nnoremap b :Vista!! + vnoremap y:silent !notify-send -t 4000 "成果" "$(tango '0')": - autocmd BufNewFile,BufRead *.ecr setlocal syntax=html - autocmd BufWritePre,FileWritePre * silent! call mkdir(expand(':p:h'), 'p') - autocmd VimEnter * silent! :cd `git rev-parse --show-toplevel` + autocmd BufNewFile,BufRead *.ecr setlocal syntax=html + autocmd BufWritePre,FileWritePre * silent! call mkdir(expand(':p:h'), 'p') + autocmd VimEnter * silent! :cd `git rev-parse --show-toplevel` - tnoremap - ''; + tnoremap + ''; plugins = with pkgs.vimPlugins; [ { plugin = nvim-tree-lua; type = "lua"; - config = /* lua */ '' - require("nvim-tree").setup() + config = # lua + '' + require("nvim-tree").setup() - vim.api.nvim_create_autocmd({"QuitPre"}, { - callback = function() - vim.cmd("NvimTreeClose") - end - }) + vim.api.nvim_create_autocmd({"QuitPre"}, { + callback = function() + vim.cmd("NvimTreeClose") + end + }) - local function open_nvim_tree(data) - local real_file = vim.fn.filereadable(data.file) == 1 - local no_name = data.file == "" and vim.bo[data.buf].buftype == "" + local function open_nvim_tree(data) + local real_file = vim.fn.filereadable(data.file) == 1 + local no_name = data.file == "" and vim.bo[data.buf].buftype == "" - if not real_file and not no_name then - return + if not real_file and not no_name then + return + end + + require("nvim-tree.api").tree.toggle({ focus = false, find_file = true }) end - require("nvim-tree.api").tree.toggle({ focus = false, find_file = true }) - end - - vim.api.nvim_create_autocmd({ "VimEnter" }, { callback = open_nvim_tree }) - ''; + vim.api.nvim_create_autocmd({ "VimEnter" }, { callback = open_nvim_tree }) + ''; } { plugin = indent-blankline-nvim; type = "lua"; - config = /* lua */ '' - require("ibl").setup() - ''; + config = # lua + '' + require("ibl").setup() + ''; } { plugin = pkgs.callPackage ../packages/chameleon-nvim.nix { }; type = "lua"; - config = /* lua */ '' - require("chameleon").setup() - ''; + config = # lua + '' + require("chameleon").setup() + ''; } { plugin = gitsigns-nvim; type = "lua"; - config = /* lua */ '' - require('gitsigns').setup() - ''; + config = # lua + '' + require('gitsigns').setup() + ''; } { plugin = nvim-web-devicons; @@ -164,187 +169,192 @@ { plugin = nvim-scrollbar; type = "lua"; - config = /* lua */ '' - require("scrollbar").setup() - ''; + config = # lua + '' + require("scrollbar").setup() + ''; } { plugin = nvim-lspconfig; type = "lua"; - config = /* lua */ '' - local lspconfig = require('lspconfig') - local capabilities = require("cmp_nvim_lsp").default_capabilities() + config = # lua + '' + local lspconfig = require('lspconfig') + local capabilities = require("cmp_nvim_lsp").default_capabilities() - lspconfig.denols.setup { - capabilities = capabilities, - root_dir = lspconfig.util.root_pattern("deno.json", "deno.jsonc"), - } + lspconfig.denols.setup { + capabilities = capabilities, + root_dir = lspconfig.util.root_pattern("deno.json", "deno.jsonc"), + } - lspconfig.tsserver.setup { - capabilities = capabilities, - root_dir = lspconfig.util.root_pattern("package.json"), - single_file_support = false - } + lspconfig.tsserver.setup { + capabilities = capabilities, + root_dir = lspconfig.util.root_pattern("package.json"), + single_file_support = false + } - lspconfig.eslint.setup { - capabilities = capabilities, - on_attach = function(client, bufnr) - vim.api.nvim_create_autocmd("BufWritePre", { - buffer = bufnr, - command = "EslintFixAll", - }) - end - } + lspconfig.eslint.setup { + capabilities = capabilities, + on_attach = function(client, bufnr) + vim.api.nvim_create_autocmd("BufWritePre", { + buffer = bufnr, + command = "EslintFixAll", + }) + end + } - lspconfig.tailwindcss.setup { - capabilities = capabilities, - on_attach = function(client, bufnr) - require("tailwindcss-colors").buf_attach(bufnr) - end - } + lspconfig.tailwindcss.setup { + capabilities = capabilities, + on_attach = function(client, bufnr) + require("tailwindcss-colors").buf_attach(bufnr) + end + } - vim.keymap.set('n', 'e', vim.diagnostic.open_float) - vim.keymap.set('n', '[d', vim.diagnostic.goto_prev) - vim.keymap.set('n', ']d', vim.diagnostic.goto_next) - vim.keymap.set('n', 'q', vim.diagnostic.setloclist) + vim.keymap.set('n', 'e', vim.diagnostic.open_float) + vim.keymap.set('n', '[d', vim.diagnostic.goto_prev) + vim.keymap.set('n', ']d', vim.diagnostic.goto_next) + vim.keymap.set('n', 'q', vim.diagnostic.setloclist) - vim.api.nvim_create_autocmd('LspAttach', { - group = vim.api.nvim_create_augroup('UserLspConfig', {}), + vim.api.nvim_create_autocmd('LspAttach', { + group = vim.api.nvim_create_augroup('UserLspConfig', {}), - callback = function(ev) - local opts = { buffer = ev.buf } + callback = function(ev) + local opts = { buffer = ev.buf } - vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, opts) - vim.keymap.set('n', 'gd', vim.lsp.buf.definition, opts) - vim.keymap.set('n', 'K', vim.lsp.buf.hover, opts) - vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, opts) - vim.keymap.set('n', '', vim.lsp.buf.signature_help, opts) - vim.keymap.set('n', 'D', vim.lsp.buf.type_definition, opts) - vim.keymap.set('n', 'rn', vim.lsp.buf.rename, opts) - vim.keymap.set({ 'n', 'v' }, 'ca', vim.lsp.buf.code_action, opts) - vim.keymap.set('n', 'gr', vim.lsp.buf.references, opts) - end, - }) + vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, opts) + vim.keymap.set('n', 'gd', vim.lsp.buf.definition, opts) + vim.keymap.set('n', 'K', vim.lsp.buf.hover, opts) + vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, opts) + vim.keymap.set('n', '', vim.lsp.buf.signature_help, opts) + vim.keymap.set('n', 'D', vim.lsp.buf.type_definition, opts) + vim.keymap.set('n', 'rn', vim.lsp.buf.rename, opts) + vim.keymap.set({ 'n', 'v' }, 'ca', vim.lsp.buf.code_action, opts) + vim.keymap.set('n', 'gr', vim.lsp.buf.references, opts) + end, + }) - vim.lsp.handlers["textDocument/hover"] = vim.lsp.with( - vim.lsp.handlers.hover, { border = "single" } - ) + vim.lsp.handlers["textDocument/hover"] = vim.lsp.with( + vim.lsp.handlers.hover, { border = "single" } + ) - vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with( - vim.lsp.handlers.signature_help, { border = "single" } - ) + vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with( + vim.lsp.handlers.signature_help, { border = "single" } + ) - vim.diagnostic.config { - float = { border = "single" } - } - ''; + vim.diagnostic.config { + float = { border = "single" } + } + ''; } { plugin = nvim-cmp; type = "lua"; - config = /* lua */ '' - local capabilities = require("cmp_nvim_lsp").default_capabilities() - local lspconfig = require('lspconfig') + config = # lua + '' + local capabilities = require("cmp_nvim_lsp").default_capabilities() + local lspconfig = require('lspconfig') - local servers = { - 'nixd', - 'rust_analyzer', - 'markdown_oxide', - 'lua_ls', - 'html', - 'clangd', - 'texlab', - 'crystalline', - 'prismals', - 'jsonls', - 'vuels', - 'sqlls', - 'emmet_language_server', - 'astro', - 'cssls', - } - - for _, lsp in ipairs(servers) do - lspconfig[lsp].setup { - capabilities = capabilities, + local servers = { + 'nixd', + 'rust_analyzer', + 'markdown_oxide', + 'lua_ls', + 'html', + 'clangd', + 'texlab', + 'crystalline', + 'prismals', + 'jsonls', + 'vuels', + 'sqlls', + 'emmet_language_server', + 'astro', + 'cssls', } - end - local luasnip = require('luasnip') - local cmp = require('cmp') + for _, lsp in ipairs(servers) do + lspconfig[lsp].setup { + capabilities = capabilities, + } + end - cmp.setup { - snippet = { - expand = function(args) - luasnip.lsp_expand(args.body) - end, - }, - mapping = cmp.mapping.preset.insert({ - [''] = cmp.mapping.scroll_docs(-4), - [''] = cmp.mapping.scroll_docs(4), - [''] = cmp.mapping.complete(), - [''] = cmp.mapping.confirm { - behavior = cmp.ConfirmBehavior.Replace, - select = true, + local luasnip = require('luasnip') + local cmp = require('cmp') + + cmp.setup { + snippet = { + expand = function(args) + luasnip.lsp_expand(args.body) + end, }, - [''] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_next_item() - elseif luasnip.expand_or_jumpable() then - luasnip.expand_or_jump() - else - fallback() - end - end, { 'i', 's' }), - [''] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_prev_item() - elseif luasnip.jumpable(-1) then - luasnip.jump(-1) - else - fallback() - end - end, { 'i', 's' }), - }), - sources = { - { name = 'nvim_lsp' }, - { name = 'luasnip' }, - }, - } - ''; + mapping = cmp.mapping.preset.insert({ + [''] = cmp.mapping.scroll_docs(-4), + [''] = cmp.mapping.scroll_docs(4), + [''] = cmp.mapping.complete(), + [''] = cmp.mapping.confirm { + behavior = cmp.ConfirmBehavior.Replace, + select = true, + }, + [''] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_next_item() + elseif luasnip.expand_or_jumpable() then + luasnip.expand_or_jump() + else + fallback() + end + end, { 'i', 's' }), + [''] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_prev_item() + elseif luasnip.jumpable(-1) then + luasnip.jump(-1) + else + fallback() + end + end, { 'i', 's' }), + }), + sources = { + { name = 'nvim_lsp' }, + { name = 'luasnip' }, + }, + } + ''; } cmp-nvim-lsp cmp_luasnip { plugin = luasnip; type = "lua"; - config = /* lua */ '' - require("luasnip.loaders.from_vscode").lazy_load() - ''; + config = # lua + '' + require("luasnip.loaders.from_vscode").lazy_load() + ''; } friendly-snippets { plugin = lualine-nvim; type = "lua"; - config = /* lua */ '' - local theme = require("lualine.themes.base16") - theme.normal.b.bg = nil - theme.normal.c.bg = nil - theme.replace.b.bg = nil - theme.insert.b.bg = nil - theme.visual.b.bg = nil - theme.inactive.a.bg = nil - theme.inactive.b.bg = nil - theme.inactive.c.bg = nil + config = # lua + '' + local theme = require("lualine.themes.base16") + theme.normal.b.bg = nil + theme.normal.c.bg = nil + theme.replace.b.bg = nil + theme.insert.b.bg = nil + theme.visual.b.bg = nil + theme.inactive.a.bg = nil + theme.inactive.b.bg = nil + theme.inactive.c.bg = nil - require('lualine').setup { - options = { - theme = theme, - disabled_filetypes = {'NvimTree', 'tagbar'} - }, - sections = { lualine_c = {'%f'} } - } - ''; + require('lualine').setup { + options = { + theme = theme, + disabled_filetypes = {'NvimTree', 'tagbar'} + }, + sections = { lualine_c = {'%f'} } + } + ''; } { plugin = git-blame-nvim; @@ -353,114 +363,125 @@ { plugin = comment-nvim; type = "lua"; - config = /* lua */ '' - require('Comment').setup { - pre_hook = require('ts_context_commentstring.integrations.comment_nvim').create_pre_hook() - } - ''; + config = # lua + '' + require('Comment').setup { + pre_hook = require('ts_context_commentstring.integrations.comment_nvim').create_pre_hook() + } + ''; } { plugin = nvim-autopairs; type = "lua"; - config = /* lua */ '' - require("nvim-autopairs").setup() - ''; + config = # lua + '' + require("nvim-autopairs").setup() + ''; } { plugin = auto-save-nvim; type = "lua"; - config = /* lua */ '' - require("auto-save").setup() - ''; + config = # lua + '' + require("auto-save").setup() + ''; } { plugin = vimtex; - config = /* vim */ '' - let g:vimtex_mappings_enabled = 0 - let g:vimtex_imaps_enabled = 0 - let g:vimtex_view_method = 'zathura' - let g:vimtex_compiler_latexmk = {'out_dir': '/tmp/vimtex'} + config = # vim + '' + let g:vimtex_mappings_enabled = 0 + let g:vimtex_imaps_enabled = 0 + let g:vimtex_view_method = 'zathura' + let g:vimtex_compiler_latexmk = {'out_dir': '/tmp/vimtex'} - nnoremap f (vimtex-view) - nnoremap g (vimtex-compile) - nnoremap d (vimtex-env-delete) - nnoremap c (vimtex-env-change) - ''; + nnoremap f (vimtex-view) + nnoremap g (vimtex-compile) + nnoremap d (vimtex-env-delete) + nnoremap c (vimtex-env-change) + ''; } { plugin = vim-markdown; - config = /* vim */ '' - let g:vim_markdown_folding_disabled = 1 - let g:vim_markdown_conceal = 0 - let g:vim_markdown_frontmatter = 1 - let g:vim_markdown_toml_frontmatter = 1 - let g:vim_markdown_json_frontmatter = 1 - ''; + config = # vim + '' + let g:vim_markdown_folding_disabled = 1 + let g:vim_markdown_conceal = 0 + let g:vim_markdown_frontmatter = 1 + let g:vim_markdown_toml_frontmatter = 1 + let g:vim_markdown_json_frontmatter = 1 + ''; } { plugin = nvim-ts-autotag; type = "lua"; - config = /* lua */ '' - require('nvim-ts-autotag').setup() - ''; + config = # lua + '' + require('nvim-ts-autotag').setup() + ''; } { plugin = nvim-surround; type = "lua"; - config = /* lua */ '' - require('nvim-surround').setup() - ''; + config = # lua + '' + require('nvim-surround').setup() + ''; } { plugin = tailwindcss-colors-nvim; type = "lua"; - config = /* lua */ '' - require('tailwindcss-colors').setup() - ''; + config = # lua + '' + require('tailwindcss-colors').setup() + ''; } { plugin = nvim-ts-context-commentstring; type = "lua"; - config = /* lua */ '' - require('ts_context_commentstring').setup { - enable_autocmd = false, - } - ''; + config = # lua + '' + require('ts_context_commentstring').setup { + enable_autocmd = false, + } + ''; } { plugin = nvim-treesitter.withAllGrammars; type = "lua"; - config = /* lua */ '' - require'nvim-treesitter.configs'.setup { - highlight = { - enable = true, - disable = function(lang) - return lang ~= "javascript" - and lang ~= "tsx" - and lang ~= "typescript" - and lang ~= "astro" - and lang ~= "css" - and lang ~= "glsl" - and lang ~= "nix" - and lang ~= "vue" - and lang ~= "pug" - and lang ~= "prisma" - end, - additional_vim_regex_highlighting = true, - }, - } - ''; + config = # lua + '' + require'nvim-treesitter.configs'.setup { + highlight = { + enable = true, + disable = function(lang) + return lang ~= "javascript" + and lang ~= "tsx" + and lang ~= "typescript" + and lang ~= "astro" + and lang ~= "css" + and lang ~= "glsl" + and lang ~= "nix" + and lang ~= "vue" + and lang ~= "pug" + and lang ~= "prisma" + end, + additional_vim_regex_highlighting = true, + }, + } + ''; } { plugin = vista-vim; - config = /* vim */ '' - let g:vista_default_executive = 'nvim_lsp' - let g:vista_executive_for = { - \ 'rust': 'ctags', - \ } + config = # vim + '' + let g:vista_default_executive = 'nvim_lsp' + let g:vista_executive_for = { + \ 'rust': 'ctags', + \ } - autocmd QuitPre * silent! :Vista! - ''; + autocmd QuitPre * silent! :Vista! + ''; } fzf-vim vim-caddyfile diff --git a/home/qutebrowser.nix b/home/qutebrowser.nix index bd6a9b43..e363e709 100644 --- a/home/qutebrowser.nix +++ b/home/qutebrowser.nix @@ -9,10 +9,7 @@ in settings = { url = { - start_pages = [ - "about:blank" - ]; - + start_pages = [ "about:blank" ]; default_page = "about:blank"; }; @@ -42,9 +39,30 @@ in fileselect = { handler = "external"; - folder.command = [ "kitty" "-e" "yazi" "--cwd-file" "{}" ]; - multiple_files.command = [ "kitty" "-e" "yazi" "--chooser-file" "{}" ]; - single_file.command = [ "kitty" "-e" "yazi" "--chooser-file" "{}" ]; + + folder.command = [ + "kitty" + "-e" + "yazi" + "--cwd-file" + "{}" + ]; + + multiple_files.command = [ + "kitty" + "-e" + "yazi" + "--chooser-file" + "{}" + ]; + + single_file.command = [ + "kitty" + "-e" + "yazi" + "--chooser-file" + "{}" + ]; }; downloads = { @@ -55,11 +73,21 @@ in }; qt = { - args = [ "disable-backing-store-limit" "enable-accelerated-video-decode" "disable-gpu-driver-bug-workarounds" ]; + args = [ + "disable-backing-store-limit" + "enable-accelerated-video-decode" + "disable-gpu-driver-bug-workarounds" + ]; + chromium.low_end_device_mode = "never"; }; - editor.command = [ "kitty" "-e" "nvim" "{}" ]; + editor.command = [ + "kitty" + "-e" + "nvim" + "{}" + ]; }; keyBindings = { @@ -104,11 +132,12 @@ in DEFAULT = "https://search.goo.ne.jp/web.jsp?MT={}"; }; - extraConfig = /* python */ '' - from qutebrowser.mainwindow import tabwidget + extraConfig = # python + '' + from qutebrowser.mainwindow import tabwidget - tabwidget.TabWidget.MUTE_STRING = "" - tabwidget.TabWidget.AUDIBLE_STRING = "[A]" - ''; + tabwidget.TabWidget.MUTE_STRING = "" + tabwidget.TabWidget.AUDIBLE_STRING = "[A]" + ''; }; } diff --git a/home/rofi.nix b/home/rofi.nix index 129ec131..533bbd9c 100644 --- a/home/rofi.nix +++ b/home/rofi.nix @@ -1,4 +1,9 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: let inherit (pkgs) rofi-wayland; @@ -64,7 +69,10 @@ in border-radius = mkLiteral "2px"; border-color = mkLiteral "${base05}40"; - children = map mkLiteral [ "icon-search" "entry" ]; + children = map mkLiteral [ + "icon-search" + "entry" + ]; }; prompt = { diff --git a/home/swaync.nix b/home/swaync.nix index ef593c38..8ec264ce 100644 --- a/home/swaync.nix +++ b/home/swaync.nix @@ -1,3 +1 @@ -{ - services.swaync.enable = true; -} +{ services.swaync.enable = true; } diff --git a/home/swayosd.nix b/home/swayosd.nix index f0e6c551..c0acbc57 100644 --- a/home/swayosd.nix +++ b/home/swayosd.nix @@ -1,3 +1 @@ -{ - services.swayosd.enable = true; -} +{ services.swayosd.enable = true; } diff --git a/home/thunar.nix b/home/thunar.nix index e37ba529..3b875dfa 100644 --- a/home/thunar.nix +++ b/home/thunar.nix @@ -1,6 +1,7 @@ { - xdg.configFile."xfce4/helpers.rc".text = /* ini */ '' - TerminalEmulator=kitty - TerminalEmulatorDismissed=true - ''; + xdg.configFile."xfce4/helpers.rc".text = # ini + '' + TerminalEmulator=kitty + TerminalEmulatorDismissed=true + ''; } diff --git a/home/udiskie.nix b/home/udiskie.nix index f3ea3b85..9c40c0a4 100644 --- a/home/udiskie.nix +++ b/home/udiskie.nix @@ -1,3 +1 @@ -{ - services.udiskie.enable = true; -} +{ services.udiskie.enable = true; } diff --git a/home/xdg-user-dirs.nix b/home/xdg-user-dirs.nix index 74359d2b..cc43c06a 100644 --- a/home/xdg-user-dirs.nix +++ b/home/xdg-user-dirs.nix @@ -3,7 +3,10 @@ let inherit (config.home) homeDirectory; - no = { name = ""; noDisplay = true; }; + no = { + name = ""; + noDisplay = true; + }; in { xdg = { diff --git a/home/yazi.nix b/home/yazi.nix index ff544952..f19127e3 100644 --- a/home/yazi.nix +++ b/home/yazi.nix @@ -4,9 +4,14 @@ settings = { manager = { - ratio = [ 1 2 4 ]; sort_dir_first = true; linemode = "mtime"; + + ratio = [ + 1 + 2 + 4 + ]; }; preview = {