home: Format with nixfmt-rfc-style

This commit is contained in:
Donovan Glover 2024-08-03 14:22:47 -04:00
parent 4f8625c1bf
commit 14f65a9633
No known key found for this signature in database
GPG Key ID: EA7408A77AE1BE65
16 changed files with 914 additions and 807 deletions

View File

@ -2,62 +2,71 @@
let let
inherit (config.home) homeDirectory; inherit (config.home) homeDirectory;
inherit (config.xdg.userDirs) download documents music pictures videos;
inherit (config.lib.stylix.colors.withHashtag) base00 base05; inherit (config.lib.stylix.colors.withHashtag) base00 base05;
inherit (pkgs) eww; inherit (pkgs) eww;
inherit (config.xdg.userDirs)
download
documents
music
pictures
videos
;
fluent-icons = pkgs.callPackage ../packages/fluent-icons.nix { }; fluent-icons = pkgs.callPackage ../packages/fluent-icons.nix { };
in in
{ {
home.packages = [ eww ]; home.packages = [ eww ];
xdg.configFile."eww/eww.yuck".text = /* yuck */ '' xdg.configFile."eww/eww.yuck".text = # yuck
(defwidget icons [] ''
(box :orientation "h" :spacing 32 (defwidget icons []
(icon :img "default-user-home" :exec "${homeDirectory}") (box :orientation "h" :spacing 32
(icon :img "default-folder-download" :exec "${download}") (icon :img "default-user-home" :exec "${homeDirectory}")
(icon :img "default-folder-documents" :exec "${documents}") (icon :img "default-folder-download" :exec "${download}")
(icon :img "default-folder-music" :exec "${music}") (icon :img "default-folder-documents" :exec "${documents}")
(icon :img "default-folder-pictures" :exec "${pictures}") (icon :img "default-folder-music" :exec "${music}")
(icon :img "default-folder-video" :exec "${videos}"))) (icon :img "default-folder-pictures" :exec "${pictures}")
(icon :img "default-folder-video" :exec "${videos}")))
(defwidget icon [img exec] (defwidget icon [img exec]
(eventbox :cursor "pointer" :onclick "lnch thunar ''${exec}" :tooltip "''${exec}" (eventbox :cursor "pointer" :onclick "lnch thunar ''${exec}" :tooltip "''${exec}"
(image :path "${fluent-icons}/''${img}.png" :image-width 128))) (image :path "${fluent-icons}/''${img}.png" :image-width 128)))
(defwindow desktop-icons (defwindow desktop-icons
:monitor 0 :monitor 0
:geometry (geometry :x "32px" :anchor "bottom center" :geometry (geometry :x "32px" :anchor "bottom center"
:y "8px") :y "8px")
:stacking "bg" :stacking "bg"
(icons)) (icons))
(defpoll time :interval "1s" (defpoll time :interval "1s"
"date '+%H:%M'") "date '+%H:%M'")
(defwindow overlay (defwindow overlay
:monitor 0 :monitor 0
:geometry (geometry :y "4px" :x "8px" :anchor "bottom right") :geometry (geometry :y "4px" :x "8px" :anchor "bottom right")
:stacking "fg" :stacking "fg"
time) time)
''; '';
xdg.configFile."eww/eww.scss".text = /* scss */ '' xdg.configFile."eww/eww.scss".text = # scss
img { ''
all: unset; img {
} all: unset;
}
.desktop-icons { .desktop-icons {
all: unset; all: unset;
} }
.overlay { .overlay {
background: transparent; background: transparent;
color: ${base05}; color: ${base05};
font-weight: bold; font-weight: bold;
text-shadow: 0 0 0.075em ${base00}; text-shadow: 0 0 0.075em ${base00};
font-size: 32px; font-size: 32px;
opacity: 0.4; opacity: 0.4;
} }
''; '';
} }

View File

@ -8,210 +8,217 @@ let
in in
{ {
xdg.dataFile = { xdg.dataFile = {
"fcitx5/themes/${themeName}/theme.conf".text = /* ini */ '' "fcitx5/themes/${themeName}/theme.conf".text = # ini
[Metadata] ''
Name=${themeName} [Metadata]
Version=0.1 Name=${themeName}
ScaleWithDPI=True Version=0.1
ScaleWithDPI=True
[InputPanel] [InputPanel]
Font=${font} Font=${font}
NormalColor=${base05} NormalColor=${base05}
HighlightCandidateColor=${base05} HighlightCandidateColor=${base05}
HighlightColor=${base05} HighlightColor=${base05}
HighlightBackgroundColor=${base01} HighlightBackgroundColor=${base01}
Spacing=6 Spacing=6
[InputPanel/TextMargin] [InputPanel/TextMargin]
Left=5 Left=5
Right=5 Right=5
Top=5 Top=5
Bottom=5 Bottom=5
[InputPanel/ContentMargin] [InputPanel/ContentMargin]
Left=2 Left=2
Right=2 Right=2
Top=2 Top=2
Bottom=2 Bottom=2
[InputPanel/Background/Margin] [InputPanel/Background/Margin]
Left=2 Left=2
Right=2 Right=2
Top=2 Top=2
Bottom=2 Bottom=2
[InputPanel/Background] [InputPanel/Background]
Color=${base01} Color=${base01}
[InputPanel/Highlight] [InputPanel/Highlight]
Color=${base02} Color=${base02}
[InputPanel/Highlight/Margin] [InputPanel/Highlight/Margin]
Left=5 Left=5
Right=7 Right=7
Top=5 Top=5
Bottom=5 Bottom=5
[Menu] [Menu]
NormalColor=${base01} NormalColor=${base01}
[Menu/Background] [Menu/Background]
Color=${base01} Color=${base01}
[Menu/Highlight] [Menu/Highlight]
Color=${base02} Color=${base02}
[Menu/Separator] [Menu/Separator]
Color=${base02} Color=${base02}
[Menu/Background/Margin] [Menu/Background/Margin]
Left=2 Left=2
Right=2 Right=2
Top=2 Top=2
Bottom=2 Bottom=2
[Menu/ContentMargin] [Menu/ContentMargin]
Left=2 Left=2
Right=2 Right=2
Top=2 Top=2
Bottom=2 Bottom=2
[Menu/Highlight/Margin] [Menu/Highlight/Margin]
Left=5 Left=5
Right=5 Right=5
Top=5 Top=5
Bottom=5 Bottom=5
[Menu/TextMargin] [Menu/TextMargin]
Left=5 Left=5
Right=5 Right=5
Top=5 Top=5
Bottom=5 Bottom=5
''; '';
}; };
xdg.configFile = { xdg.configFile = {
"mozc/ibus_config.textproto" = { "mozc/ibus_config.textproto" = {
force = true; force = true;
text = /* textproto */ '' text = # textproto
engines { ''
name : "mozc-jp" engines {
longname : "Mozc" name : "mozc-jp"
layout : "default" longname : "Mozc"
layout_variant : "" layout : "default"
layout_option : "" layout_variant : ""
rank : 80 layout_option : ""
} rank : 80
active_on_launch: True }
''; active_on_launch: True
'';
}; };
"fcitx5/config" = { "fcitx5/config" = {
force = true; force = true;
text = /* ini */ '' text = # ini
[Hotkey] ''
EnumerateWithTriggerKeys=True [Hotkey]
AltTriggerKeys= EnumerateWithTriggerKeys=True
EnumerateForwardKeys= AltTriggerKeys=
EnumerateBackwardKeys= EnumerateForwardKeys=
EnumerateSkipFirst=False EnumerateBackwardKeys=
EnumerateGroupForwardKeys= EnumerateSkipFirst=False
EnumerateGroupBackwardKeys= EnumerateGroupForwardKeys=
ActivateKeys= EnumerateGroupBackwardKeys=
DeactivateKeys= ActivateKeys=
DeactivateKeys=
[Hotkey/TriggerKeys] [Hotkey/TriggerKeys]
0=Super+space 0=Super+space
[Hotkey/PrevPage] [Hotkey/PrevPage]
0=Up 0=Up
[Hotkey/NextPage] [Hotkey/NextPage]
0=Down 0=Down
[Hotkey/PrevCandidate] [Hotkey/PrevCandidate]
0=Shift+Tab 0=Shift+Tab
[Hotkey/NextCandidate] [Hotkey/NextCandidate]
0=Tab 0=Tab
[Hotkey/TogglePreedit] [Hotkey/TogglePreedit]
0=Control+Alt+P 0=Control+Alt+P
[Behavior] [Behavior]
ActiveByDefault=False ActiveByDefault=False
ShareInputState=No ShareInputState=No
PreeditEnabledByDefault=True PreeditEnabledByDefault=True
ShowInputMethodInformation=True ShowInputMethodInformation=True
showInputMethodInformationWhenFocusIn=False showInputMethodInformationWhenFocusIn=False
CompactInputMethodInformation=True CompactInputMethodInformation=True
ShowFirstInputMethodInformation=True ShowFirstInputMethodInformation=True
DefaultPageSize=5 DefaultPageSize=5
OverrideXkbOption=False OverrideXkbOption=False
CustomXkbOption= CustomXkbOption=
EnabledAddons= EnabledAddons=
DisabledAddons= DisabledAddons=
PreloadInputMethod=True PreloadInputMethod=True
''; '';
}; };
"fcitx5/profile" = { "fcitx5/profile" = {
force = true; force = true;
text = /* ini */ '' text = # ini
[Groups/0] ''
Name="Group 1" [Groups/0]
Default Layout=us Name="Group 1"
DefaultIM=mozc Default Layout=us
DefaultIM=mozc
[Groups/0/Items/0] [Groups/0/Items/0]
Name=keyboard-us Name=keyboard-us
Layout= Layout=
[Groups/0/Items/1] [Groups/0/Items/1]
Name=mozc Name=mozc
Layout= Layout=
[GroupOrder] [GroupOrder]
0="Group 1" 0="Group 1"
''; '';
}; };
"fcitx5/conf/classicui.conf" = { "fcitx5/conf/classicui.conf" = {
force = true; force = true;
text = /* ini */ '' text = # ini
Vertical Candidate List=False ''
PerScreenDPI=True Vertical Candidate List=False
WheelForPaging=True PerScreenDPI=True
Font="${font}" WheelForPaging=True
MenuFont="${font}" Font="${font}"
TrayFont="${font}" MenuFont="${font}"
TrayOutlineColor=${base02} TrayFont="${font}"
TrayTextColor=${base05} TrayOutlineColor=${base02}
PreferTextIcon=False TrayTextColor=${base05}
ShowLayoutNameInIcon=True PreferTextIcon=False
UseInputMethodLangaugeToDisplayText=True ShowLayoutNameInIcon=True
Theme=${themeName} UseInputMethodLangaugeToDisplayText=True
''; Theme=${themeName}
'';
}; };
"fcitx5/conf/clipboard.conf" = { "fcitx5/conf/clipboard.conf" = {
force = true; force = true;
text = /* ini */ '' text = # ini
TriggerKey= ''
PastePrimaryKey= TriggerKey=
Number of entries=5 PastePrimaryKey=
''; Number of entries=5
'';
}; };
"fcitx5/conf/mozc.conf" = { "fcitx5/conf/mozc.conf" = {
force = true; force = true;
text = /* ini */ '' text = # ini
InitialMode=Hiragana ''
Vertical=True InitialMode=Hiragana
ExpandMode="On Focus" Vertical=True
PreeditCursorPositionAtBeginning=False ExpandMode="On Focus"
ExpandKey=Control+Alt+H PreeditCursorPositionAtBeginning=False
''; ExpandKey=Control+Alt+H
'';
}; };
"fcitx5/conf/notifications.conf" = { "fcitx5/conf/notifications.conf" = {

View File

@ -4,23 +4,24 @@
programs.fish = { programs.fish = {
enable = true; enable = true;
shellInit = /* fish */ '' shellInit = # fish
set -U fish_greeting "" ''
set -U fish_greeting ""
set -x -U LESS_TERMCAP_md (printf "\e[01;31m") set -x -U LESS_TERMCAP_md (printf "\e[01;31m")
set -x -U LESS_TERMCAP_me (printf "\e[0m") set -x -U LESS_TERMCAP_me (printf "\e[0m")
set -x -U LESS_TERMCAP_se (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_so (printf "\e[01;44;30m")
set -x -U LESS_TERMCAP_ue (printf "\e[0m") set -x -U LESS_TERMCAP_ue (printf "\e[0m")
set -x -U LESS_TERMCAP_us (printf "\e[01;32m") set -x -U LESS_TERMCAP_us (printf "\e[01;32m")
set -x -U MANROFFOPT "-c" set -x -U MANROFFOPT "-c"
fish_default_key_bindings fish_default_key_bindings
if string match -qe -- "/dev/pts/" (tty) if string match -qe -- "/dev/pts/" (tty)
alias ssh="kitty +kitten ssh" alias ssh="kitty +kitten ssh"
end end
''; '';
shellAliases = { shellAliases = {
tree = "eza --all --long --tree"; tree = "eza --all --long --tree";
@ -129,76 +130,81 @@
}; };
functions = { functions = {
wav2flac = /* fish */ '' wav2flac = # fish
set ORIGINAL_SIZE (du -hs | cut -f1) ''
set ORIGINAL_SIZE (du -hs | cut -f1)
fd -e wav -x ffmpeg -i "{}" -loglevel quiet -stats "{.}.flac" fd -e wav -x ffmpeg -i "{}" -loglevel quiet -stats "{.}.flac"
fd -e wav -X trash 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 */ '' opus = # fish
set ORIGINAL_SIZE (du -hs | cut -f1) ''
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 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 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 */ '' epub2pdf = # fish
if string match -qe -- ".epub" "$argv"; ''
set BASE (string split -f 1 ".epub" "$argv") if string match -qe -- ".epub" "$argv";
${pkgs.calibre}/bin/ebook-convert "$argv" "$BASE.pdf"; and trash "$argv" set BASE (string split -f 1 ".epub" "$argv")
else ${pkgs.calibre}/bin/ebook-convert "$argv" "$BASE.pdf"; and trash "$argv"
echo "Usage: epub2pdf [file.epub]" else
end echo "Usage: epub2pdf [file.epub]"
''; end
'';
tmp = /* fish */ '' tmp = # fish
set MULLVAD_CACHE "/tmp/mullvad.json" ''
set MULLVAD_CACHE "/tmp/mullvad.json"
if not test -e $MULLVAD_CACHE if not test -e $MULLVAD_CACHE
curl https://api.mullvad.net/www/relays/wireguard > $MULLVAD_CACHE curl https://api.mullvad.net/www/relays/wireguard > $MULLVAD_CACHE
end end
set CONTAINER_PROXY (random choice (cat $MULLVAD_CACHE | jq -r '.[] | select(.active) | select(.hostname | startswith("jp")) | .socks_name')) set CONTAINER_PROXY (random choice (cat $MULLVAD_CACHE | jq -r '.[] | select(.active) | select(.hostname | startswith("jp")) | .socks_name'))
set CONTAINER_ID "qtb-$(uuidgen)" set CONTAINER_ID "qtb-$(uuidgen)"
set SHORT (string split "." "$CONTAINER_PROXY" -f 1) set SHORT (string split "." "$CONTAINER_PROXY" -f 1)
mkdir -p "/tmp/$CONTAINER_ID/config/bookmarks" mkdir -p "/tmp/$CONTAINER_ID/config/bookmarks"
mkdir -p "/tmp/$CONTAINER_ID/data/userscripts" mkdir -p "/tmp/$CONTAINER_ID/data/userscripts"
ln -s ~/.config/qutebrowser/bookmarks/urls "/tmp/$CONTAINER_ID/config/bookmarks/urls" 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/quickmarks "/tmp/$CONTAINER_ID/config/quickmarks"
TZ="Asia/Tokyo" lnch qutebrowser \ TZ="Asia/Tokyo" lnch qutebrowser \
--set content.proxy "socks5://$CONTAINER_PROXY:1080" \ --set content.proxy "socks5://$CONTAINER_PROXY:1080" \
--set window.title_format "{perc}[$SHORT]{title_sep}{current_title}" \ --set window.title_format "{perc}[$SHORT]{title_sep}{current_title}" \
--basedir "/tmp/$CONTAINER_ID" \ --basedir "/tmp/$CONTAINER_ID" \
--config-py "$HOME/.config/qutebrowser/config.py" \ --config-py "$HOME/.config/qutebrowser/config.py" \
:adblock-update \ :adblock-update \
"$argv" "$argv"
''; '';
ex = /* fish */ '' ex = # fish
if string match -qe -- ".part1." "$argv"; ''
set BASE (string split -f 1 ".part1." "$argv") if string match -qe -- ".part1." "$argv";
set BASE (string split -f 1 ".part1." "$argv")
unar "$argv" && fd -d 1 "$BASE.part" -X trash unar "$argv" && fd -d 1 "$BASE.part" -X trash
else if string match -qe -- ".part01." "$argv"; else if string match -qe -- ".part01." "$argv";
set BASE (string split -f 1 ".part01." "$argv") set BASE (string split -f 1 ".part01." "$argv")
unar "$argv" && fd -d 1 "$BASE.part" -X trash unar "$argv" && fd -d 1 "$BASE.part" -X trash
else else
unar "$argv" && trash "$argv" unar "$argv" && trash "$argv"
end end
''; '';
}; };
}; };
} }

View File

@ -4,7 +4,10 @@ let
inherit (pkgs) tig mgitstatus; inherit (pkgs) tig mgitstatus;
in in
{ {
home.packages = [ tig mgitstatus ]; home.packages = [
tig
mgitstatus
];
xdg.configFile."tig/config".text = '' xdg.configFile."tig/config".text = ''
color cursor black green bold color cursor black green bold
@ -22,9 +25,7 @@ in
verify = "log --show-signature"; verify = "log --show-signature";
}; };
attributes = [ attributes = [ "*.lockb binary diff=lockb" ];
"*.lockb binary diff=lockb"
];
extraConfig = { extraConfig = {
include.path = "~/.gituser"; include.path = "~/.gituser";

View File

@ -1,4 +1,9 @@
{ pkgs, lib, vars, ... }: {
pkgs,
lib,
vars,
...
}:
let let
inherit (pkgs) polkit_gnome callPackage; inherit (pkgs) polkit_gnome callPackage;
@ -258,89 +263,95 @@ in
]; ];
}; };
extraConfig = /* hyprlang */ '' extraConfig = # hyprlang
bind = CTRL, Alt_L, submap, passthrough ''
submap = passthrough bind = CTRL, Alt_L, submap, passthrough
bind = CTRL, Alt_L, submap, reset submap = passthrough
submap = reset bind = CTRL, Alt_L, submap, reset
''; submap = reset
'';
}; };
xdg.configFile = { xdg.configFile = {
${gapsScript} = { ${gapsScript} = {
executable = true; executable = true;
text = /* fish */ '' text = # fish
#!/usr/bin/env 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_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: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 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 decoration:rounding $(math 8 - $(hyprctl getoption decoration:rounding -j | jq -r ".int"))
''; '';
}; };
${setBackgroundScript} = { ${setBackgroundScript} = {
executable = true; executable = true;
text = /* fish */ '' text = # fish
#!/usr/bin/env fish ''
#!/usr/bin/env fish
if [ (hyprctl getoption animations:enabled -j | jq -r ".int") = "1" ] if [ (hyprctl getoption animations:enabled -j | jq -r ".int") = "1" ]
swww img \ swww img \
--transition-type $(random choice grow wave outer) \ --transition-type $(random choice grow wave outer) \
--transition-wave 80,40 \ --transition-wave 80,40 \
--transition-angle $(random choice 45 90 135 225 270 315) \ --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-pos $(random choice center top left right bottom top-left top-right bottom-left bottom-right) \
--transition-step 200 \ --transition-step 200 \
--transition-duration 1.5 \ --transition-duration 1.5 \
--transition-fps 240 \ --transition-fps 240 \
--outputs "$argv[1]" \ --outputs "$argv[1]" \
"$argv[2]" "$argv[2]"
else else
swww img \ swww img \
--transition-type simple \ --transition-type simple \
--transition-step 255 \ --transition-step 255 \
--outputs "$argv[1]" \ --outputs "$argv[1]" \
"$argv[2]" "$argv[2]"
end end
''; '';
}; };
${randomBackgroundScript} = { ${randomBackgroundScript} = {
executable = true; executable = true;
text = /* fish */ '' text = # fish
#!/usr/bin/env fish ''
#!/usr/bin/env fish
for monitor in (hyprctl monitors -j | jq -r '.[].name') 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))" ~/.config/${setBackgroundScript} "$monitor" "$(random choice $(fd . ${osu-backgrounds}/2024-07-15-Aerial-Antics-Art-Contest-All-Entries --follow -e jpg -e png))"
end end
''; '';
}; };
${swapBackgroundScript} = { ${swapBackgroundScript} = {
executable = true; executable = true;
text = /* fish */ '' text = # fish
#!/usr/bin/env fish ''
#!/usr/bin/env fish
set M "$(swww query | cut -d ':' -f 5)" set M "$(swww query | cut -d ':' -f 5)"
set M1 "$(echo "$M" | head -n 1 | awk '{$1=$1};1')" set M1 "$(echo "$M" | head -n 1 | awk '{$1=$1};1')"
set M2 "$(echo "$M" | tail -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 | 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 | head -n 1)" "$M2"
''; '';
}; };
${monitorScript} = { ${monitorScript} = {
executable = true; executable = true;
text = /* fish */ '' text = # fish
#!/usr/bin/env fish ''
#!/usr/bin/env fish
if test -n "$(hyprctl monitors -j | jq -r '.[] | select(.name | contains("eDP-1"))')" if test -n "$(hyprctl monitors -j | jq -r '.[] | select(.name | contains("eDP-1"))')"
hyprctl keyword monitor eDP-1,disable hyprctl keyword monitor eDP-1,disable
else else
hyprctl keyword monitor eDP-1,preferred,auto-left,1 hyprctl keyword monitor eDP-1,preferred,auto-left,1
end end
''; '';
}; };
}; };

View File

@ -1,11 +1,23 @@
{ config, lib, pkgs, ... }: {
config,
lib,
pkgs,
...
}:
let let
inherit (lib) singleton; inherit (lib) singleton;
inherit (config.lib.stylix.colors.withHashtag) base00 base01 base04 base05 base0D;
inherit (pkgs) ironbar inotify-tools; inherit (pkgs) ironbar inotify-tools;
inherit (builtins) toJSON; inherit (builtins) toJSON;
inherit (config.lib.stylix.colors.withHashtag)
base00
base01
base04
base05
base0D
;
mullvadScript = "ironbar/mullvad.fish"; mullvadScript = "ironbar/mullvad.fish";
volumeScript = "ironbar/volume.fish"; volumeScript = "ironbar/volume.fish";
volumeGet = "ironbar/volume-get.fish"; volumeGet = "ironbar/volume-get.fish";
@ -63,211 +75,213 @@ in
type = "clock"; type = "clock";
format = "%x%a%R"; format = "%x%a%R";
} }
{ { type = "notifications"; }
type = "notifications";
}
]; ];
}; };
"ironbar/style.css".text = /* css */ '' "ironbar/style.css".text = # css
* { ''
font-family: "Noto Sans CJK JP", "Font Awesome 6 Free Solid"; * {
font-size: 16px; font-family: "Noto Sans CJK JP", "Font Awesome 6 Free Solid";
text-shadow: 2px 2px ${base00}; font-size: 16px;
border: none; text-shadow: 2px 2px ${base00};
border-radius: 0; border: none;
outline: none; border-radius: 0;
font-weight: 500; outline: none;
background: none; font-weight: 500;
color: ${base05}; background: none;
} color: ${base05};
}
.background { .background {
background: alpha(${base00}, 0.925); background: alpha(${base00}, 0.925);
} }
button:hover { button:hover {
background: ${base01}; background: ${base01};
} }
#bar { #bar {
border-top: 1px solid ${base01}; border-top: 1px solid ${base01};
} }
.label, .script, .tray { .label, .script, .tray {
padding-left: 0.5em; padding-left: 0.5em;
padding-right: 0.5em; padding-right: 0.5em;
} }
.notifications button { .notifications button {
padding-left: 0.2em; padding-left: 0.2em;
padding-right: 0.7em; padding-right: 0.7em;
} }
.upower { .upower {
padding-left: 0.2em; padding-left: 0.2em;
padding-right: 0.2em; padding-right: 0.2em;
} }
.upower .label { .upower .label {
padding-left: 0; padding-left: 0;
padding-right: 0; padding-right: 0;
} }
.popup { .popup {
border: 1px solid ${base01}; border: 1px solid ${base01};
padding: 1em; padding: 1em;
} }
.clock { .clock {
padding-right: 0.4em; padding-right: 0.4em;
} }
.popup-clock .calendar-clock { .popup-clock .calendar-clock {
font-family: "Maple Mono"; font-family: "Maple Mono";
font-size: 2.5em; font-size: 2.5em;
padding-bottom: 0.1em; padding-bottom: 0.1em;
} }
.popup-clock .calendar .header { .popup-clock .calendar .header {
padding-top: 1em; padding-top: 1em;
border-top: 1px solid ${base01}; border-top: 1px solid ${base01};
font-size: 1.5em; font-size: 1.5em;
} }
.popup-clock .calendar { .popup-clock .calendar {
padding: 0.2em 0.4em; padding: 0.2em 0.4em;
} }
.popup-clock .calendar:selected { .popup-clock .calendar:selected {
color: ${base0D}; color: ${base0D};
} }
.launcher .item { .launcher .item {
padding-left: 1em; padding-left: 1em;
padding-right: 1em; padding-right: 1em;
margin-right: 4px; margin-right: 4px;
} }
button:active { button:active {
background: ${base04}; background: ${base04};
} }
.launcher .open { .launcher .open {
box-shadow: inset 0 -2px ${base04}; box-shadow: inset 0 -2px ${base04};
} }
.launcher .focused { .launcher .focused {
box-shadow: inset 0 -2px ${base0D}; box-shadow: inset 0 -2px ${base0D};
background: ${base01}; background: ${base01};
} }
.popup-launcher { .popup-launcher {
padding: 0; padding: 0;
} }
.popup-launcher .popup-item:not(:first-child) { .popup-launcher .popup-item:not(:first-child) {
border-top: 1px solid ${base01}; border-top: 1px solid ${base01};
} }
#startMenu { #startMenu {
padding-left: 1em; padding-left: 1em;
padding-right: 0.5em; padding-right: 0.5em;
} }
''; '';
${mullvadScript} = { ${mullvadScript} = {
executable = true; executable = true;
text = /* fish */ '' text = # fish
#!/usr/bin/env fish ''
#!/usr/bin/env fish
sleep 2 sleep 2
function get_mullvad_status function get_mullvad_status
if test -z "$inside" if test -z "$inside"
set inside true set inside true
test -n "$initialized" && sleep 0.2 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 \ set LOCATION (echo "$MULLVAD" | choose 4.. | sed \
-e 's/Ashburn.*//g' \ -e 's/Ashburn.*//g' \
-e 's/Atlanta.*//g' \ -e 's/Atlanta.*//g' \
-e 's/Boston.*//g' \ -e 's/Boston.*//g' \
-e 's/Charlotte.*//g' \ -e 's/Charlotte.*//g' \
-e 's/Chicago.*//g' \ -e 's/Chicago.*//g' \
-e 's/Cleveland.*//g' \ -e 's/Cleveland.*//g' \
-e 's/Dallas.*//g' \ -e 's/Dallas.*//g' \
-e 's/Detroit.*//g' \ -e 's/Detroit.*//g' \
-e 's/Denver.*//g' \ -e 's/Denver.*//g' \
-e 's/Honolulu.*//g' \ -e 's/Honolulu.*//g' \
-e 's/Houston.*//g' \ -e 's/Houston.*//g' \
-e 's/Jackson.*//g' \ -e 's/Jackson.*//g' \
-e 's/Los Angeles.*//g' \ -e 's/Los Angeles.*//g' \
-e 's/Louisville.*//g' \ -e 's/Louisville.*//g' \
-e 's/McAllen.*//g' \ -e 's/McAllen.*//g' \
-e 's/Miami.*//g' \ -e 's/Miami.*//g' \
-e 's/Milwaukee.*//g' \ -e 's/Milwaukee.*//g' \
-e 's/Minneapolis.*//g' \ -e 's/Minneapolis.*//g' \
-e 's/New York.*//g' \ -e 's/New York.*//g' \
-e 's/Oklahoma.*//g' \ -e 's/Oklahoma.*//g' \
-e 's/Philadelphia.*//g' \ -e 's/Philadelphia.*//g' \
-e 's/Phoenix.*//g' \ -e 's/Phoenix.*//g' \
-e 's/Piscataway.*//g' \ -e 's/Piscataway.*//g' \
-e 's/Portland.*//g' \ -e 's/Portland.*//g' \
-e 's/Raleigh.*//g' \ -e 's/Raleigh.*//g' \
-e 's/Richmond.*//g' \ -e 's/Richmond.*//g' \
-e 's/Salt Lake.*//g' \ -e 's/Salt Lake.*//g' \
-e 's/San Francisco.*//g' \ -e 's/San Francisco.*//g' \
-e 's/San Jose.*//g' \ -e 's/San Jose.*//g' \
-e 's/Seattle.*//g' \ -e 's/Seattle.*//g' \
-e 's/Secaucus.*//g' \ -e 's/Secaucus.*//g' \
-e 's/Sioux Falls.*//g' \ -e 's/Sioux Falls.*//g' \
-e 's/St. Louis.*//g' \ -e 's/St. Louis.*//g' \
-e 's/Stamford.*//g' \ -e 's/Stamford.*//g' \
-e 's/Washington.*//g' -e 's/Washington.*//g'
) )
echo "$LOCATION" echo "$LOCATION"
set -e inside set -e inside
end
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 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} = { ${volumeScript} = {
executable = true; executable = true;
text = /* fish */ '' text = # fish
#!/usr/bin/env fish ''
#!/usr/bin/env fish
function get_volume function get_volume
set VOLUME (wpctl get-volume @DEFAULT_AUDIO_SINK@ | choose 1) set VOLUME (wpctl get-volume @DEFAULT_AUDIO_SINK@ | choose 1)
echo "$(math "$VOLUME * 100")%" echo "$(math "$VOLUME * 100")%"
end 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} = { ${volumeGet} = {
executable = true; executable = true;
text = /* fish */ '' text = # fish
#!/usr/bin/env fish ''
#!/usr/bin/env fish
set VOLUME (wpctl get-volume @DEFAULT_AUDIO_SINK@ | choose 1) set VOLUME (wpctl get-volume @DEFAULT_AUDIO_SINK@ | choose 1)
echo "$(math "$VOLUME * 100")%" echo "$(math "$VOLUME * 100")%"
''; '';
}; };
}; };
} }

View File

@ -7,9 +7,7 @@ in
programs.librewolf = { programs.librewolf = {
enable = true; enable = true;
package = librewolf.override { package = librewolf.override { cfg.speechSynthesisSupport = false; };
cfg.speechSynthesisSupport = false;
};
settings = { settings = {
"middlemouse.paste" = false; "middlemouse.paste" = false;

View File

@ -54,108 +54,113 @@
universal-ctags universal-ctags
]; ];
extraConfig = /* vim */ '' extraConfig = # vim
filetype plugin indent on ''
set undofile filetype plugin indent on
set spell set undofile
set number set spell
set linebreak set number
set clipboard=unnamedplus set linebreak
set fileencoding=utf-8 " Ensure that we always save files as utf-8 set clipboard=unnamedplus
set fileencodings=utf-8,sjis " Automatically open shiftjis files with their proper encoding set fileencoding=utf-8 " Ensure that we always save files as utf-8
set spelllang=en_us,cjk " Don't show errors for CJK characters set fileencodings=utf-8,sjis " Automatically open shiftjis files with their proper encoding
set noshowmode " Disable the --MODE-- text (enable if not using the status line) set spelllang=en_us,cjk " Don't show errors for CJK characters
set mouse=a set noshowmode " Disable the --MODE-- text (enable if not using the status line)
set ignorecase " By default use case-insensitive search (combine with smartcase) set mouse=a
set smartcase " Make search case-sensitive when using capital letters set ignorecase " By default use case-insensitive search (combine with smartcase)
set scrolloff=1 " The minimal number of rows to show when scrolling up/down set smartcase " Make search case-sensitive when using capital letters
set sidescrolloff=5 " The minimal number of columns to show when scrolling left/right set scrolloff=1 " The minimal number of rows to show when scrolling up/down
set tabstop=4 " Show a tab character as 4 spaces set sidescrolloff=5 " The minimal number of columns to show when scrolling left/right
set softtabstop=0 " Edit soft tabs as if they're regular spaces set tabstop=4 " Show a tab character as 4 spaces
set shiftwidth=4 " Make autoindent appear 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 foldmethod=indent
set foldlevelstart=99 set foldlevelstart=99
map <MiddleMouse> <Nop> map <MiddleMouse> <Nop>
imap <MiddleMouse> <Nop> imap <MiddleMouse> <Nop>
map <2-MiddleMouse> <Nop> map <2-MiddleMouse> <Nop>
imap <2-MiddleMouse> <Nop> imap <2-MiddleMouse> <Nop>
map <3-MiddleMouse> <Nop> map <3-MiddleMouse> <Nop>
imap <3-MiddleMouse> <Nop> imap <3-MiddleMouse> <Nop>
map <4-MiddleMouse> <Nop> map <4-MiddleMouse> <Nop>
imap <4-MiddleMouse> <Nop> imap <4-MiddleMouse> <Nop>
highlight Search ctermbg=240 ctermfg=255 highlight Search ctermbg=240 ctermfg=255
highlight IncSearch ctermbg=255 ctermfg=240 highlight IncSearch ctermbg=255 ctermfg=240
let mapleader = ' ' let mapleader = ' '
nnoremap <silent> <leader>e :set nu!<CR> nnoremap <silent> <leader>e :set nu!<CR>
nnoremap <silent> <leader>o :GitBlameToggle<CR> nnoremap <silent> <leader>o :GitBlameToggle<CR>
nnoremap <silent> <leader>a :NvimTreeFocus<CR> nnoremap <silent> <leader>a :NvimTreeFocus<CR>
nnoremap <silent> <leader>d :bp\|bd #<CR> nnoremap <silent> <leader>d :bp\|bd #<CR>
nnoremap <silent> <leader>f :Files<CR> nnoremap <silent> <leader>f :Files<CR>
nnoremap <silent> <leader>g :set hlsearch!<CR> nnoremap <silent> <leader>g :set hlsearch!<CR>
nnoremap <silent> <leader>j :Buffers<CR> nnoremap <silent> <leader>j :Buffers<CR>
nnoremap <silent> <leader>l :Rg<CR> nnoremap <silent> <leader>l :Rg<CR>
nnoremap <silent> <leader>; :NvimTreeToggle<CR> nnoremap <silent> <leader>; :NvimTreeToggle<CR>
nnoremap <silent> <leader>b :Vista!!<CR> nnoremap <silent> <leader>b :Vista!!<CR>
vnoremap <C-s> y:silent !notify-send -t 4000 "" "$(tango '<C-r>0')"<CR>:<Esc> vnoremap <C-s> y:silent !notify-send -t 4000 "" "$(tango '<C-r>0')"<CR>:<Esc>
autocmd BufNewFile,BufRead *.ecr setlocal syntax=html autocmd BufNewFile,BufRead *.ecr setlocal syntax=html
autocmd BufWritePre,FileWritePre * silent! call mkdir(expand('<afile>:p:h'), 'p') autocmd BufWritePre,FileWritePre * silent! call mkdir(expand('<afile>:p:h'), 'p')
autocmd VimEnter * silent! :cd `git rev-parse --show-toplevel` autocmd VimEnter * silent! :cd `git rev-parse --show-toplevel`
tnoremap <C-space> <C-\><C-n> tnoremap <C-space> <C-\><C-n>
''; '';
plugins = with pkgs.vimPlugins; [ plugins = with pkgs.vimPlugins; [
{ {
plugin = nvim-tree-lua; plugin = nvim-tree-lua;
type = "lua"; type = "lua";
config = /* lua */ '' config = # lua
require("nvim-tree").setup() ''
require("nvim-tree").setup()
vim.api.nvim_create_autocmd({"QuitPre"}, { vim.api.nvim_create_autocmd({"QuitPre"}, {
callback = function() callback = function()
vim.cmd("NvimTreeClose") vim.cmd("NvimTreeClose")
end end
}) })
local function open_nvim_tree(data) local function open_nvim_tree(data)
local real_file = vim.fn.filereadable(data.file) == 1 local real_file = vim.fn.filereadable(data.file) == 1
local no_name = data.file == "" and vim.bo[data.buf].buftype == "" local no_name = data.file == "" and vim.bo[data.buf].buftype == ""
if not real_file and not no_name then if not real_file and not no_name then
return return
end
require("nvim-tree.api").tree.toggle({ focus = false, find_file = true })
end end
require("nvim-tree.api").tree.toggle({ focus = false, find_file = true }) vim.api.nvim_create_autocmd({ "VimEnter" }, { callback = open_nvim_tree })
end '';
vim.api.nvim_create_autocmd({ "VimEnter" }, { callback = open_nvim_tree })
'';
} }
{ {
plugin = indent-blankline-nvim; plugin = indent-blankline-nvim;
type = "lua"; type = "lua";
config = /* lua */ '' config = # lua
require("ibl").setup() ''
''; require("ibl").setup()
'';
} }
{ {
plugin = pkgs.callPackage ../packages/chameleon-nvim.nix { }; plugin = pkgs.callPackage ../packages/chameleon-nvim.nix { };
type = "lua"; type = "lua";
config = /* lua */ '' config = # lua
require("chameleon").setup() ''
''; require("chameleon").setup()
'';
} }
{ {
plugin = gitsigns-nvim; plugin = gitsigns-nvim;
type = "lua"; type = "lua";
config = /* lua */ '' config = # lua
require('gitsigns').setup() ''
''; require('gitsigns').setup()
'';
} }
{ {
plugin = nvim-web-devicons; plugin = nvim-web-devicons;
@ -164,187 +169,192 @@
{ {
plugin = nvim-scrollbar; plugin = nvim-scrollbar;
type = "lua"; type = "lua";
config = /* lua */ '' config = # lua
require("scrollbar").setup() ''
''; require("scrollbar").setup()
'';
} }
{ {
plugin = nvim-lspconfig; plugin = nvim-lspconfig;
type = "lua"; type = "lua";
config = /* lua */ '' config = # lua
local lspconfig = require('lspconfig') ''
local capabilities = require("cmp_nvim_lsp").default_capabilities() local lspconfig = require('lspconfig')
local capabilities = require("cmp_nvim_lsp").default_capabilities()
lspconfig.denols.setup { lspconfig.denols.setup {
capabilities = capabilities, capabilities = capabilities,
root_dir = lspconfig.util.root_pattern("deno.json", "deno.jsonc"), root_dir = lspconfig.util.root_pattern("deno.json", "deno.jsonc"),
} }
lspconfig.tsserver.setup { lspconfig.tsserver.setup {
capabilities = capabilities, capabilities = capabilities,
root_dir = lspconfig.util.root_pattern("package.json"), root_dir = lspconfig.util.root_pattern("package.json"),
single_file_support = false single_file_support = false
} }
lspconfig.eslint.setup { lspconfig.eslint.setup {
capabilities = capabilities, capabilities = capabilities,
on_attach = function(client, bufnr) on_attach = function(client, bufnr)
vim.api.nvim_create_autocmd("BufWritePre", { vim.api.nvim_create_autocmd("BufWritePre", {
buffer = bufnr, buffer = bufnr,
command = "EslintFixAll", command = "EslintFixAll",
}) })
end end
} }
lspconfig.tailwindcss.setup { lspconfig.tailwindcss.setup {
capabilities = capabilities, capabilities = capabilities,
on_attach = function(client, bufnr) on_attach = function(client, bufnr)
require("tailwindcss-colors").buf_attach(bufnr) require("tailwindcss-colors").buf_attach(bufnr)
end end
} }
vim.keymap.set('n', '<space>e', vim.diagnostic.open_float) vim.keymap.set('n', '<space>e', vim.diagnostic.open_float)
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev) vim.keymap.set('n', '[d', vim.diagnostic.goto_prev)
vim.keymap.set('n', ']d', vim.diagnostic.goto_next) vim.keymap.set('n', ']d', vim.diagnostic.goto_next)
vim.keymap.set('n', '<space>q', vim.diagnostic.setloclist) vim.keymap.set('n', '<space>q', vim.diagnostic.setloclist)
vim.api.nvim_create_autocmd('LspAttach', { vim.api.nvim_create_autocmd('LspAttach', {
group = vim.api.nvim_create_augroup('UserLspConfig', {}), group = vim.api.nvim_create_augroup('UserLspConfig', {}),
callback = function(ev) callback = function(ev)
local opts = { buffer = ev.buf } local opts = { buffer = ev.buf }
vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, opts) vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, opts)
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, 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', 'K', vim.lsp.buf.hover, opts)
vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, opts) vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, opts)
vim.keymap.set('n', '<C-k>', vim.lsp.buf.signature_help, opts) vim.keymap.set('n', '<C-k>', vim.lsp.buf.signature_help, opts)
vim.keymap.set('n', '<space>D', vim.lsp.buf.type_definition, opts) vim.keymap.set('n', '<space>D', vim.lsp.buf.type_definition, opts)
vim.keymap.set('n', '<space>rn', vim.lsp.buf.rename, opts) vim.keymap.set('n', '<space>rn', vim.lsp.buf.rename, opts)
vim.keymap.set({ 'n', 'v' }, '<space>ca', vim.lsp.buf.code_action, opts) vim.keymap.set({ 'n', 'v' }, '<space>ca', vim.lsp.buf.code_action, opts)
vim.keymap.set('n', 'gr', vim.lsp.buf.references, opts) vim.keymap.set('n', 'gr', vim.lsp.buf.references, opts)
end, end,
}) })
vim.lsp.handlers["textDocument/hover"] = vim.lsp.with( vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(
vim.lsp.handlers.hover, { border = "single" } vim.lsp.handlers.hover, { border = "single" }
) )
vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with( vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with(
vim.lsp.handlers.signature_help, { border = "single" } vim.lsp.handlers.signature_help, { border = "single" }
) )
vim.diagnostic.config { vim.diagnostic.config {
float = { border = "single" } float = { border = "single" }
} }
''; '';
} }
{ {
plugin = nvim-cmp; plugin = nvim-cmp;
type = "lua"; type = "lua";
config = /* lua */ '' config = # lua
local capabilities = require("cmp_nvim_lsp").default_capabilities() ''
local lspconfig = require('lspconfig') local capabilities = require("cmp_nvim_lsp").default_capabilities()
local lspconfig = require('lspconfig')
local servers = { local servers = {
'nixd', 'nixd',
'rust_analyzer', 'rust_analyzer',
'markdown_oxide', 'markdown_oxide',
'lua_ls', 'lua_ls',
'html', 'html',
'clangd', 'clangd',
'texlab', 'texlab',
'crystalline', 'crystalline',
'prismals', 'prismals',
'jsonls', 'jsonls',
'vuels', 'vuels',
'sqlls', 'sqlls',
'emmet_language_server', 'emmet_language_server',
'astro', 'astro',
'cssls', 'cssls',
}
for _, lsp in ipairs(servers) do
lspconfig[lsp].setup {
capabilities = capabilities,
} }
end
local luasnip = require('luasnip') for _, lsp in ipairs(servers) do
local cmp = require('cmp') lspconfig[lsp].setup {
capabilities = capabilities,
}
end
cmp.setup { local luasnip = require('luasnip')
snippet = { local cmp = require('cmp')
expand = function(args)
luasnip.lsp_expand(args.body) cmp.setup {
end, snippet = {
}, expand = function(args)
mapping = cmp.mapping.preset.insert({ luasnip.lsp_expand(args.body)
['<C-u>'] = cmp.mapping.scroll_docs(-4), end,
['<C-d>'] = cmp.mapping.scroll_docs(4),
['<C-Space>'] = cmp.mapping.complete(),
['<CR>'] = cmp.mapping.confirm {
behavior = cmp.ConfirmBehavior.Replace,
select = true,
}, },
['<Tab>'] = cmp.mapping(function(fallback) mapping = cmp.mapping.preset.insert({
if cmp.visible() then ['<C-u>'] = cmp.mapping.scroll_docs(-4),
cmp.select_next_item() ['<C-d>'] = cmp.mapping.scroll_docs(4),
elseif luasnip.expand_or_jumpable() then ['<C-Space>'] = cmp.mapping.complete(),
luasnip.expand_or_jump() ['<CR>'] = cmp.mapping.confirm {
else behavior = cmp.ConfirmBehavior.Replace,
fallback() select = true,
end },
end, { 'i', 's' }), ['<Tab>'] = cmp.mapping(function(fallback)
['<S-Tab>'] = cmp.mapping(function(fallback) if cmp.visible() then
if cmp.visible() then cmp.select_next_item()
cmp.select_prev_item() elseif luasnip.expand_or_jumpable() then
elseif luasnip.jumpable(-1) then luasnip.expand_or_jump()
luasnip.jump(-1) else
else fallback()
fallback() end
end end, { 'i', 's' }),
end, { 'i', 's' }), ['<S-Tab>'] = cmp.mapping(function(fallback)
}), if cmp.visible() then
sources = { cmp.select_prev_item()
{ name = 'nvim_lsp' }, elseif luasnip.jumpable(-1) then
{ name = 'luasnip' }, luasnip.jump(-1)
}, else
} fallback()
''; end
end, { 'i', 's' }),
}),
sources = {
{ name = 'nvim_lsp' },
{ name = 'luasnip' },
},
}
'';
} }
cmp-nvim-lsp cmp-nvim-lsp
cmp_luasnip cmp_luasnip
{ {
plugin = luasnip; plugin = luasnip;
type = "lua"; type = "lua";
config = /* lua */ '' config = # lua
require("luasnip.loaders.from_vscode").lazy_load() ''
''; require("luasnip.loaders.from_vscode").lazy_load()
'';
} }
friendly-snippets friendly-snippets
{ {
plugin = lualine-nvim; plugin = lualine-nvim;
type = "lua"; type = "lua";
config = /* lua */ '' config = # lua
local theme = require("lualine.themes.base16") ''
theme.normal.b.bg = nil local theme = require("lualine.themes.base16")
theme.normal.c.bg = nil theme.normal.b.bg = nil
theme.replace.b.bg = nil theme.normal.c.bg = nil
theme.insert.b.bg = nil theme.replace.b.bg = nil
theme.visual.b.bg = nil theme.insert.b.bg = nil
theme.inactive.a.bg = nil theme.visual.b.bg = nil
theme.inactive.b.bg = nil theme.inactive.a.bg = nil
theme.inactive.c.bg = nil theme.inactive.b.bg = nil
theme.inactive.c.bg = nil
require('lualine').setup { require('lualine').setup {
options = { options = {
theme = theme, theme = theme,
disabled_filetypes = {'NvimTree', 'tagbar'} disabled_filetypes = {'NvimTree', 'tagbar'}
}, },
sections = { lualine_c = {'%f'} } sections = { lualine_c = {'%f'} }
} }
''; '';
} }
{ {
plugin = git-blame-nvim; plugin = git-blame-nvim;
@ -353,114 +363,125 @@
{ {
plugin = comment-nvim; plugin = comment-nvim;
type = "lua"; type = "lua";
config = /* lua */ '' config = # lua
require('Comment').setup { ''
pre_hook = require('ts_context_commentstring.integrations.comment_nvim').create_pre_hook() require('Comment').setup {
} pre_hook = require('ts_context_commentstring.integrations.comment_nvim').create_pre_hook()
''; }
'';
} }
{ {
plugin = nvim-autopairs; plugin = nvim-autopairs;
type = "lua"; type = "lua";
config = /* lua */ '' config = # lua
require("nvim-autopairs").setup() ''
''; require("nvim-autopairs").setup()
'';
} }
{ {
plugin = auto-save-nvim; plugin = auto-save-nvim;
type = "lua"; type = "lua";
config = /* lua */ '' config = # lua
require("auto-save").setup() ''
''; require("auto-save").setup()
'';
} }
{ {
plugin = vimtex; plugin = vimtex;
config = /* vim */ '' config = # vim
let g:vimtex_mappings_enabled = 0 ''
let g:vimtex_imaps_enabled = 0 let g:vimtex_mappings_enabled = 0
let g:vimtex_view_method = 'zathura' let g:vimtex_imaps_enabled = 0
let g:vimtex_compiler_latexmk = {'out_dir': '/tmp/vimtex'} let g:vimtex_view_method = 'zathura'
let g:vimtex_compiler_latexmk = {'out_dir': '/tmp/vimtex'}
nnoremap <localleader>f <plug>(vimtex-view) nnoremap <localleader>f <plug>(vimtex-view)
nnoremap <localleader>g <plug>(vimtex-compile) nnoremap <localleader>g <plug>(vimtex-compile)
nnoremap <localleader>d <plug>(vimtex-env-delete) nnoremap <localleader>d <plug>(vimtex-env-delete)
nnoremap <localleader>c <plug>(vimtex-env-change) nnoremap <localleader>c <plug>(vimtex-env-change)
''; '';
} }
{ {
plugin = vim-markdown; plugin = vim-markdown;
config = /* vim */ '' config = # vim
let g:vim_markdown_folding_disabled = 1 ''
let g:vim_markdown_conceal = 0 let g:vim_markdown_folding_disabled = 1
let g:vim_markdown_frontmatter = 1 let g:vim_markdown_conceal = 0
let g:vim_markdown_toml_frontmatter = 1 let g:vim_markdown_frontmatter = 1
let g:vim_markdown_json_frontmatter = 1 let g:vim_markdown_toml_frontmatter = 1
''; let g:vim_markdown_json_frontmatter = 1
'';
} }
{ {
plugin = nvim-ts-autotag; plugin = nvim-ts-autotag;
type = "lua"; type = "lua";
config = /* lua */ '' config = # lua
require('nvim-ts-autotag').setup() ''
''; require('nvim-ts-autotag').setup()
'';
} }
{ {
plugin = nvim-surround; plugin = nvim-surround;
type = "lua"; type = "lua";
config = /* lua */ '' config = # lua
require('nvim-surround').setup() ''
''; require('nvim-surround').setup()
'';
} }
{ {
plugin = tailwindcss-colors-nvim; plugin = tailwindcss-colors-nvim;
type = "lua"; type = "lua";
config = /* lua */ '' config = # lua
require('tailwindcss-colors').setup() ''
''; require('tailwindcss-colors').setup()
'';
} }
{ {
plugin = nvim-ts-context-commentstring; plugin = nvim-ts-context-commentstring;
type = "lua"; type = "lua";
config = /* lua */ '' config = # lua
require('ts_context_commentstring').setup { ''
enable_autocmd = false, require('ts_context_commentstring').setup {
} enable_autocmd = false,
''; }
'';
} }
{ {
plugin = nvim-treesitter.withAllGrammars; plugin = nvim-treesitter.withAllGrammars;
type = "lua"; type = "lua";
config = /* lua */ '' config = # lua
require'nvim-treesitter.configs'.setup { ''
highlight = { require'nvim-treesitter.configs'.setup {
enable = true, highlight = {
disable = function(lang) enable = true,
return lang ~= "javascript" disable = function(lang)
and lang ~= "tsx" return lang ~= "javascript"
and lang ~= "typescript" and lang ~= "tsx"
and lang ~= "astro" and lang ~= "typescript"
and lang ~= "css" and lang ~= "astro"
and lang ~= "glsl" and lang ~= "css"
and lang ~= "nix" and lang ~= "glsl"
and lang ~= "vue" and lang ~= "nix"
and lang ~= "pug" and lang ~= "vue"
and lang ~= "prisma" and lang ~= "pug"
end, and lang ~= "prisma"
additional_vim_regex_highlighting = true, end,
}, additional_vim_regex_highlighting = true,
} },
''; }
'';
} }
{ {
plugin = vista-vim; plugin = vista-vim;
config = /* vim */ '' config = # vim
let g:vista_default_executive = 'nvim_lsp' ''
let g:vista_executive_for = { let g:vista_default_executive = 'nvim_lsp'
\ 'rust': 'ctags', let g:vista_executive_for = {
\ } \ 'rust': 'ctags',
\ }
autocmd QuitPre * silent! :Vista! autocmd QuitPre * silent! :Vista!
''; '';
} }
fzf-vim fzf-vim
vim-caddyfile vim-caddyfile

View File

@ -9,10 +9,7 @@ in
settings = { settings = {
url = { url = {
start_pages = [ start_pages = [ "about:blank" ];
"about:blank"
];
default_page = "about:blank"; default_page = "about:blank";
}; };
@ -42,9 +39,30 @@ in
fileselect = { fileselect = {
handler = "external"; handler = "external";
folder.command = [ "kitty" "-e" "yazi" "--cwd-file" "{}" ];
multiple_files.command = [ "kitty" "-e" "yazi" "--chooser-file" "{}" ]; folder.command = [
single_file.command = [ "kitty" "-e" "yazi" "--chooser-file" "{}" ]; "kitty"
"-e"
"yazi"
"--cwd-file"
"{}"
];
multiple_files.command = [
"kitty"
"-e"
"yazi"
"--chooser-file"
"{}"
];
single_file.command = [
"kitty"
"-e"
"yazi"
"--chooser-file"
"{}"
];
}; };
downloads = { downloads = {
@ -55,11 +73,21 @@ in
}; };
qt = { 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"; chromium.low_end_device_mode = "never";
}; };
editor.command = [ "kitty" "-e" "nvim" "{}" ]; editor.command = [
"kitty"
"-e"
"nvim"
"{}"
];
}; };
keyBindings = { keyBindings = {
@ -104,11 +132,12 @@ in
DEFAULT = "https://search.goo.ne.jp/web.jsp?MT={}"; DEFAULT = "https://search.goo.ne.jp/web.jsp?MT={}";
}; };
extraConfig = /* python */ '' extraConfig = # python
from qutebrowser.mainwindow import tabwidget ''
from qutebrowser.mainwindow import tabwidget
tabwidget.TabWidget.MUTE_STRING = "" tabwidget.TabWidget.MUTE_STRING = ""
tabwidget.TabWidget.AUDIBLE_STRING = "[A]" tabwidget.TabWidget.AUDIBLE_STRING = "[A]"
''; '';
}; };
} }

View File

@ -1,4 +1,9 @@
{ config, lib, pkgs, ... }: {
config,
lib,
pkgs,
...
}:
let let
inherit (pkgs) rofi-wayland; inherit (pkgs) rofi-wayland;
@ -64,7 +69,10 @@ in
border-radius = mkLiteral "2px"; border-radius = mkLiteral "2px";
border-color = mkLiteral "${base05}40"; border-color = mkLiteral "${base05}40";
children = map mkLiteral [ "icon-search" "entry" ]; children = map mkLiteral [
"icon-search"
"entry"
];
}; };
prompt = { prompt = {

View File

@ -1,3 +1 @@
{ { services.swaync.enable = true; }
services.swaync.enable = true;
}

View File

@ -1,3 +1 @@
{ { services.swayosd.enable = true; }
services.swayosd.enable = true;
}

View File

@ -1,6 +1,7 @@
{ {
xdg.configFile."xfce4/helpers.rc".text = /* ini */ '' xdg.configFile."xfce4/helpers.rc".text = # ini
TerminalEmulator=kitty ''
TerminalEmulatorDismissed=true TerminalEmulator=kitty
''; TerminalEmulatorDismissed=true
'';
} }

View File

@ -1,3 +1 @@
{ { services.udiskie.enable = true; }
services.udiskie.enable = true;
}

View File

@ -3,7 +3,10 @@
let let
inherit (config.home) homeDirectory; inherit (config.home) homeDirectory;
no = { name = ""; noDisplay = true; }; no = {
name = "";
noDisplay = true;
};
in in
{ {
xdg = { xdg = {

View File

@ -4,9 +4,14 @@
settings = { settings = {
manager = { manager = {
ratio = [ 1 2 4 ];
sort_dir_first = true; sort_dir_first = true;
linemode = "mtime"; linemode = "mtime";
ratio = [
1
2
4
];
}; };
preview = { preview = {