init (cerulean template)
This commit is contained in:
commit
1b7b1e66f0
65 changed files with 5597 additions and 0 deletions
8
homes/modules/apps/firefox.nix
Normal file
8
homes/modules/apps/firefox.nix
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
{...}: {
|
||||
programs.firefox = {
|
||||
enable = true;
|
||||
policies = {
|
||||
DefaultDownloadDirectory = "\${home}/Downloads";
|
||||
};
|
||||
};
|
||||
}
|
||||
254
homes/modules/apps/nixcord.nix
Normal file
254
homes/modules/apps/nixcord.nix
Normal file
|
|
@ -0,0 +1,254 @@
|
|||
{inputs, ...}: {
|
||||
imports = [
|
||||
inputs.nixcord.homeModules.nixcord
|
||||
];
|
||||
|
||||
programs.nixcord = {
|
||||
enable = true;
|
||||
# equibop.enable = true;
|
||||
|
||||
discord = {
|
||||
vencord.enable = false;
|
||||
equicord.enable = true;
|
||||
};
|
||||
|
||||
config = {
|
||||
enabledThemes = [
|
||||
"aurorastheme.css"
|
||||
"base16-colors.css"
|
||||
];
|
||||
plugins = {
|
||||
invisibleChat.enable = true;
|
||||
anonymiseFileNames = {
|
||||
enable = true;
|
||||
anonymiseByDefault = true;
|
||||
method = 0;
|
||||
randomisedLength = 16;
|
||||
};
|
||||
betterSessions = {
|
||||
backgroundCheck = true;
|
||||
checkInterval = 1;
|
||||
};
|
||||
biggerStreamPreview.enable = true;
|
||||
callTimer.enable = true;
|
||||
fixYoutubeEmbeds.enable = true;
|
||||
fixSpotifyEmbeds.enable = true;
|
||||
tidalEmbeds.enable = true;
|
||||
youtubeAdblock.enable = true;
|
||||
followVoiceUser.enable = true;
|
||||
friendsSince.enable = true;
|
||||
ircColors = {
|
||||
enable = true;
|
||||
lightness = 80;
|
||||
memberListColors = true;
|
||||
applyColorOnlyInDms = false;
|
||||
applyColorOnlyToUsersWithoutColor = false;
|
||||
};
|
||||
messageLogger = {
|
||||
enable = true;
|
||||
showEditDiffs = true;
|
||||
separatedDiffs = false;
|
||||
};
|
||||
fakeNitro.enable = true;
|
||||
ghosted.enable = false;
|
||||
noF1.enable = true;
|
||||
noMaskedUrlPaste.enable = true;
|
||||
messageLatency = {
|
||||
enable = false;
|
||||
latency = -1;
|
||||
showMillis = true;
|
||||
};
|
||||
openInApp.enable = true;
|
||||
crashHandler.enable = true;
|
||||
disableCallIdle.enable = true;
|
||||
experiments.enable = true;
|
||||
expressionCloner.enable = true;
|
||||
favoriteGifSearch.enable = true;
|
||||
fixImagesQuality.enable = true;
|
||||
forceOwnerCrown.enable = true;
|
||||
forwardAnywhere.enable = true;
|
||||
spotifyCrack.enable = true;
|
||||
spotifyShareCommands.enable = true;
|
||||
fullUserInChatbox.enable = true;
|
||||
gifPaste.enable = true;
|
||||
ignoreActivities = {
|
||||
enable = true;
|
||||
ignorePlaying = true;
|
||||
ignoreStreaming = true;
|
||||
ignoreListening = true;
|
||||
ignoreWatching = true;
|
||||
ignoreCompeting = true;
|
||||
};
|
||||
imageLink.enable = true;
|
||||
imageZoom.enable = true;
|
||||
memberCount.enable = true;
|
||||
noDevtoolsWarning.enable = true;
|
||||
noUnblockToJump.enable = true;
|
||||
pauseInvitesForever.enable = true;
|
||||
permissionsViewer.enable = true;
|
||||
pictureInPicture = {
|
||||
enable = true;
|
||||
loop = true;
|
||||
};
|
||||
platformIndicators.enable = true;
|
||||
previewMessage.enable = true;
|
||||
relationshipNotifier.enable = true;
|
||||
revealAllSpoilers.enable = true;
|
||||
serverInfo.enable = true;
|
||||
serverListIndicators.enable = true;
|
||||
musicControls = {
|
||||
enable = true;
|
||||
showSpotifyControls = true;
|
||||
showSpotifyLyrics = true;
|
||||
};
|
||||
showHiddenChannels.enable = true;
|
||||
showHiddenThings.enable = true;
|
||||
showTimeoutDuration = {
|
||||
enable = true;
|
||||
displayStyle = "tooltip";
|
||||
};
|
||||
silentTyping = {
|
||||
enable = true;
|
||||
enabledGlobally = true;
|
||||
};
|
||||
startupTimings.enable = true;
|
||||
typingIndicator.enable = true;
|
||||
unlockedAvatarZoom = {
|
||||
enable = true;
|
||||
zoomMultiplier = 4.0;
|
||||
};
|
||||
userMessagesPronouns.enable = true;
|
||||
validUser.enable = true;
|
||||
validReply.enable = true;
|
||||
viewIcons = {
|
||||
enable = true;
|
||||
format = "webp";
|
||||
imgSize = "4096";
|
||||
};
|
||||
voiceChatDoubleClick.enable = true;
|
||||
voiceDownload.enable = true;
|
||||
voiceMessages = {
|
||||
enable = true;
|
||||
noiseSuppression = false;
|
||||
echoCancellation = true;
|
||||
};
|
||||
volumeBooster.enable = true;
|
||||
webKeybinds.enable = true;
|
||||
webScreenShareFixes.enable = true;
|
||||
whoReacted.enable = true;
|
||||
whosWatching.enable = true;
|
||||
quickReply.enable = true;
|
||||
shikiCodeblocks = {
|
||||
enable = true;
|
||||
useDevIcon = "COLOR";
|
||||
theme = "https://raw.githubusercontent.com/shikijs/textmate-grammars-themes/2d87559c7601a928b9f7e0f0dda243d2fb6d4499/packages/tm-themes/themes/kanagawa-wave.json";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
programs.nixcord.config.plugins.PinDMs = {
|
||||
enable = true;
|
||||
canCollapseDmSection = true;
|
||||
# userBasedCategoryList = {
|
||||
# "1202666382760607774" = [
|
||||
# {
|
||||
# id = "i9dflmraztc";
|
||||
# name = "🏳️⚧️ girlfriends!!! :3 🏳️⚧️";
|
||||
# color = 16359423;
|
||||
# collapsed = false;
|
||||
# channels = [
|
||||
# "1436964273162289185"
|
||||
# "1436988320474206311"
|
||||
# "1449837047383855119"
|
||||
# "1436965652861685891"
|
||||
# "1436968495190642722"
|
||||
# "1465424321919975454"
|
||||
# "1468324280445046824"
|
||||
# ];
|
||||
# }
|
||||
# {
|
||||
# id = "p2v1f5y9zbd";
|
||||
# name = "🦋 best frens <3 🦋";
|
||||
# color = 10223511;
|
||||
# collapsed = false;
|
||||
# channels = [
|
||||
# "1436985374286155799"
|
||||
# "1436965657076826222"
|
||||
# "1429921297160212681"
|
||||
# "1394808379381387385"
|
||||
# "1433593753183977545"
|
||||
# "1438254055452446881"
|
||||
# "1436966389549236376"
|
||||
# "1202678007026819134"
|
||||
# "1437151552224624660"
|
||||
# "1441906462094921789"
|
||||
# "1450340272079769712"
|
||||
# "1458123717124165764"
|
||||
# "1436975341129306155"
|
||||
# "1461885176534794427"
|
||||
# "1462155159470866443"
|
||||
# "1468735915076878407"
|
||||
# "1461929299727749145"
|
||||
# "1470963392121536657"
|
||||
# ];
|
||||
# }
|
||||
# {
|
||||
# id = "c0mg5w635j8";
|
||||
# name = "🏳️🌈 close frens x3 🏳️🌈";
|
||||
# color = 10780927;
|
||||
# collapsed = false;
|
||||
# channels = [
|
||||
# "1437077103873888290"
|
||||
# "1436975346338762823"
|
||||
# "1437123353101205590"
|
||||
# "1441516692164575283"
|
||||
# "1419557866502754334"
|
||||
# "1436985041203892315"
|
||||
# "1438071327515742229"
|
||||
# ];
|
||||
# }
|
||||
# {
|
||||
# id = "ghjrq5el3b";
|
||||
# name = "frens :3";
|
||||
# color = 7334399;
|
||||
# collapsed = false;
|
||||
# channels = [
|
||||
# "1437007154132422701"
|
||||
# "1437006448948416526"
|
||||
# "1446781617422209068"
|
||||
# "1444723474835837103"
|
||||
# "1437098569483161721"
|
||||
# "1437237573146771469"
|
||||
# "1436973705421914123"
|
||||
# "1437135359359320125"
|
||||
# "1438010723837022343"
|
||||
# "1440553969461104740"
|
||||
# "1437097082887475201"
|
||||
# "1447222320015085740"
|
||||
# "1462624704027164824"
|
||||
# "1449513783893692589"
|
||||
# "1463737720961634461"
|
||||
# "1463000874392748249"
|
||||
# "1436984534712451105"
|
||||
# "1436983282582683813"
|
||||
# "1437283420312047659"
|
||||
# "1437089201651847315"
|
||||
# "1467307140443148288"
|
||||
# ];
|
||||
# }
|
||||
# {
|
||||
# id = "zbmj00xw7d8";
|
||||
# name = "goop chats";
|
||||
# color = 14876549;
|
||||
# collapsed = false;
|
||||
# channels = [
|
||||
# "1437132769141719040"
|
||||
# "1445549416516681902"
|
||||
# "1458849972815663209"
|
||||
# ];
|
||||
# }
|
||||
# ];
|
||||
# };
|
||||
};
|
||||
}
|
||||
12
homes/modules/apps/obs.nix
Normal file
12
homes/modules/apps/obs.nix
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
{pkgs, ...}: {
|
||||
programs = {
|
||||
obs-studio = {
|
||||
enable = true;
|
||||
plugins = with pkgs.obs-studio-plugins; [
|
||||
wlrobs
|
||||
obs-backgroundremoval
|
||||
obs-pipewire-audio-capture
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
32
homes/modules/apps/spicetify.nix
Normal file
32
homes/modules/apps/spicetify.nix
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
{
|
||||
inputs,
|
||||
upkgs,
|
||||
system,
|
||||
...
|
||||
}: let
|
||||
spicetifyPkgs = inputs.spicetify-nix.legacyPackages.${system};
|
||||
in {
|
||||
imports = [inputs.spicetify-nix.homeManagerModules.default];
|
||||
programs.spicetify = {
|
||||
enable = true;
|
||||
|
||||
enabledExtensions = with spicetifyPkgs.extensions; [
|
||||
adblock
|
||||
shuffle
|
||||
keyboardShortcut
|
||||
{
|
||||
src =
|
||||
(upkgs.fetchFromGitHub {
|
||||
owner = "Spikerko";
|
||||
repo = "spicy-lyrics";
|
||||
rev = "568c83326aa6aba6ded28c95df6fcfb25cab3648";
|
||||
hash = "sha256-lej93EDzGkmyrg5YMdPSqzrxlIfKsfaDBZosTvxoTNw=";
|
||||
})
|
||||
+ /builds;
|
||||
name = "spicy-lyrics.mjs";
|
||||
}
|
||||
];
|
||||
theme = spicetifyPkgs.themes.comfy;
|
||||
colorScheme = "Sakura";
|
||||
};
|
||||
}
|
||||
17
homes/modules/apps/zen-browser.nix
Normal file
17
homes/modules/apps/zen-browser.nix
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
inputs,
|
||||
system,
|
||||
...
|
||||
}: let
|
||||
inherit (inputs) zen-browser;
|
||||
in {
|
||||
imports = [
|
||||
zen-browser.homeModules.twilight
|
||||
];
|
||||
|
||||
programs.zen-browser = {
|
||||
enable = true;
|
||||
package = zen-browser.packages.${system}.twilight;
|
||||
# suppressXdgMigrationWarning = true;
|
||||
};
|
||||
}
|
||||
109
homes/modules/cli/bat.nix
Normal file
109
homes/modules/cli/bat.nix
Normal file
|
|
@ -0,0 +1,109 @@
|
|||
let
|
||||
# Module Meta Configuration
|
||||
setShellAliases = true;
|
||||
supportBash = true;
|
||||
supportZsh = true;
|
||||
supportFish = true;
|
||||
in
|
||||
{
|
||||
osConfig,
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
username,
|
||||
...
|
||||
}: let
|
||||
inherit
|
||||
(builtins)
|
||||
elemAt
|
||||
;
|
||||
|
||||
inherit
|
||||
(lib)
|
||||
flip
|
||||
mkIf
|
||||
optional
|
||||
splitString
|
||||
;
|
||||
|
||||
cfg = config.programs.bat;
|
||||
|
||||
# NOTE: `<derivation>.pname` can be used instead of `<derivation>.meta.mainProgram`
|
||||
# NOTE: but then `pkgs.bash` would return `"bash-interactive"` which is annoying...
|
||||
shellPkg = osConfig.users.users.${username}.shell;
|
||||
shell = shellPkg.meta.mainProgram;
|
||||
|
||||
pager =
|
||||
cfg.config.pager
|
||||
|> splitString " "
|
||||
|> flip elemAt 0;
|
||||
in {
|
||||
programs.bat = {
|
||||
enable = true;
|
||||
config = {
|
||||
# WARNING: pager must be set for this module to function
|
||||
# NOTE: not sure whether to use ov/moor/viddy as my pager?
|
||||
pager = "less -FR";
|
||||
# theme = "Dracula";
|
||||
};
|
||||
};
|
||||
|
||||
home = {
|
||||
shellAliases = mkIf setShellAliases {
|
||||
bat = "prettybat";
|
||||
cat = "prettybat";
|
||||
diff = "batdiff";
|
||||
brg = "batgrep";
|
||||
man = "batman";
|
||||
# watch = "batwatch"; # NOTE: using viddy instead atm
|
||||
};
|
||||
|
||||
sessionVariables = {
|
||||
PAGER = pager;
|
||||
|
||||
# REF: https://github.com/eth-p/bat-extras/blob/master/doc/batpipe.md
|
||||
BATPIPE_ENABLE_COLOR = "true";
|
||||
BATPIPE_INSIDE_LESS = "true";
|
||||
BATPIPE_TERM_WIDTH = "-"; # hyphone -> auto detect
|
||||
};
|
||||
|
||||
packages = with pkgs.bat-extras;
|
||||
[
|
||||
batdiff
|
||||
batgrep
|
||||
batman
|
||||
batpipe
|
||||
batwatch
|
||||
prettybat
|
||||
]
|
||||
++ (with pkgs; [
|
||||
bat
|
||||
entr # required by pkgs.bat-extras.batwatch
|
||||
ripgrep # required by pkgs.bat-extras.batgrep
|
||||
delta # required by pkgs.bat-extras.batdiff
|
||||
])
|
||||
++ optional (pkgs?${pager}) pkgs.${pager};
|
||||
};
|
||||
|
||||
# Configure the user's shell to source batpipe
|
||||
# WARNING: only currently supports bash, zsh, & fish
|
||||
programs = {
|
||||
bash = mkIf (supportBash || shell == "bash") {
|
||||
initExtra = ''
|
||||
eval "$(batpipe)"
|
||||
'';
|
||||
};
|
||||
|
||||
zsh = mkIf (supportZsh || shell == "zsh") {
|
||||
initContent = ''
|
||||
eval "$(batpipe)"
|
||||
'';
|
||||
};
|
||||
|
||||
fish = mkIf (supportFish || shell == "fish") {
|
||||
interactiveShellInit = ''
|
||||
eval (batpipe)
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
79
homes/modules/cli/btop.nix
Normal file
79
homes/modules/cli/btop.nix
Normal file
|
|
@ -0,0 +1,79 @@
|
|||
{config, ...}: {
|
||||
programs.btop = {
|
||||
enable = true;
|
||||
|
||||
settings = {
|
||||
# Theming
|
||||
color_theme = "dracula";
|
||||
theme_background = true;
|
||||
truecolor = true;
|
||||
force_tty = false;
|
||||
vim_keys = false; # allow vim keybindings
|
||||
# Units
|
||||
clock_format = "%I:%M %p, %b %d";
|
||||
temp_scale = "celsius";
|
||||
base_10_sizes = false; # use KB or KiB
|
||||
|
||||
# UI
|
||||
background_update = true;
|
||||
update_ms = 100;
|
||||
rounded_corners = false;
|
||||
graph_symbol = "braille"; # braille/block/tty
|
||||
graph_symbol_cpu = "default";
|
||||
graph_symbol_mem = "default";
|
||||
graph_symbol_net = "default";
|
||||
graph_symbol_proc = "default";
|
||||
|
||||
# Processes Window
|
||||
proc_left = true; # show on left side of window
|
||||
proc_colors = true;
|
||||
proc_gradient = true;
|
||||
proc_per_core = false; # false: % of ALL cores
|
||||
proc_mem_bytes = false; # show mem usage as %
|
||||
proc_sorting = "cpu lazy";
|
||||
proc_filter_kernel = false; # hide kernel child processes
|
||||
proc_tree = false;
|
||||
|
||||
# CPU Window
|
||||
cpu_bottom = false; # display at bottom of window
|
||||
show_uptime = true;
|
||||
show_cpu_freq = true;
|
||||
check_temp = true; # show cpu temp
|
||||
show_coretemp = true; # show temp per core
|
||||
cpu_graph_upper = "total"; # upper graph shows total CPU usage
|
||||
cpu_graph_lower = "user"; # lower graph shows user's CPU usage
|
||||
cpu_invert_lower = true;
|
||||
cpu_single_graph = false; # disable lower graph
|
||||
show_gpu_info = "Off"; # Auto/On/Off
|
||||
gpu_mirror_graph = false; # horizontally mirror gpu graph
|
||||
|
||||
# Memory Window
|
||||
mem_below_net = false; # show below net window
|
||||
mem_graphs = true; # show graphs not meters
|
||||
show_swap = true; # show swap memory usage
|
||||
# Disks Subwindow
|
||||
show_disks = true; # split mem box to show disk info
|
||||
swap_disk = true; # show swap memory as disk
|
||||
show_io_stat = true;
|
||||
io_graph_combined = false; # combine read/write stats
|
||||
io_mode = true; # show io stat as graph
|
||||
use_fstab = true; # read disk list from /etc/fstab
|
||||
only_physical = false; # ignore non-physical disks
|
||||
|
||||
# Network Window
|
||||
net_iface = ""; # default network interface to monitor
|
||||
net_auto = true; # overrides net_download/net_upload (below)
|
||||
net_sync = false; # sync download/upload graph scales
|
||||
net_download = 100; # max download speed graphed
|
||||
net_upload = 100; # max upload speed graphed
|
||||
|
||||
# Battery
|
||||
show_battery = true;
|
||||
selected_battery = "Auto";
|
||||
show_battery_watts = true;
|
||||
|
||||
# Other
|
||||
log_level = "WARNING"; # ERROR/WARNING/INFO/DEBUG
|
||||
};
|
||||
};
|
||||
}
|
||||
26
homes/modules/cli/hyfetch.nix
Normal file
26
homes/modules/cli/hyfetch.nix
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
{pkgs, ...}: {
|
||||
home.packages = with pkgs; [
|
||||
neofetch
|
||||
];
|
||||
|
||||
programs.hyfetch = {
|
||||
enable = true;
|
||||
settings = {
|
||||
backend = "neofetch";
|
||||
args = null;
|
||||
distro = null;
|
||||
|
||||
preset = "transgender";
|
||||
pride_month_disable = false;
|
||||
custom_ascii_path = null;
|
||||
|
||||
mode = "rgb";
|
||||
light_dark = "light";
|
||||
auto_detect_light_dark = true;
|
||||
lightness = 0.65;
|
||||
color_align = {
|
||||
mode = "horizontal";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
55
homes/modules/de/mako.nix
Normal file
55
homes/modules/de/mako.nix
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
{...}: let
|
||||
dracula = rec {
|
||||
background = "#282A36";
|
||||
border = cyan;
|
||||
|
||||
cyan = "#8BE9FD";
|
||||
yellow = "#F1FA8C";
|
||||
red = "#FF5555";
|
||||
};
|
||||
|
||||
theme = dracula;
|
||||
in {
|
||||
# notification daemon for Wayland
|
||||
services.mako = {
|
||||
enable = true;
|
||||
settings = {
|
||||
actions = true;
|
||||
# output = ""; # screen to display on
|
||||
anchor = "top-right";
|
||||
layer = "overlay";
|
||||
sort = "-time";
|
||||
|
||||
height = 100;
|
||||
width = 300;
|
||||
margin = 50;
|
||||
background-color = theme.background;
|
||||
border-color = theme.border;
|
||||
border-radius = 20;
|
||||
border-size = 4;
|
||||
font = "monospace 10";
|
||||
|
||||
markup = true;
|
||||
icons = true;
|
||||
max-icon-size = 64;
|
||||
|
||||
default-timeout = 5000;
|
||||
ignore-timeout = false;
|
||||
|
||||
"actionable=true" = {
|
||||
anchor = "top-right";
|
||||
};
|
||||
|
||||
"urgency=low" = {
|
||||
border-color = theme.border;
|
||||
};
|
||||
"urgency=normal" = {
|
||||
border-color = theme.yellow;
|
||||
};
|
||||
"urgency=high" = {
|
||||
default-timeout = 0;
|
||||
border-color = theme.red;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
19
homes/modules/de/waybar/colors.css
Normal file
19
homes/modules/de/waybar/colors.css
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
@define-color colorbg #26233a;
|
||||
@define-color colorfg #eb6f92;
|
||||
|
||||
@define-color color00 #26233a; /* black (Overlay) */
|
||||
@define-color color01 #eb6f92; /* red (Love) */
|
||||
@define-color color02 #9ccfd8; /* green (Foam) */
|
||||
@define-color color03 #f6c177; /* yellow (Gold) */
|
||||
@define-color color04 #31748f; /* blue (Pine) */
|
||||
@define-color color05 #c4a7e7; /* magenta (Iris) */
|
||||
@define-color color06 #ebbcba; /* cyan (Rose) */
|
||||
@define-color color07 #e0def4; /* white (Text) */
|
||||
@define-color color08 #47435d; /* bright black (lighter Overlay) */
|
||||
@define-color color09 #ff98ba; /* bright red (lighter Love) */
|
||||
@define-color color10 #c5f9ff; /* bright green (lighter Foam) */
|
||||
@define-color color11 #ffeb9e; /* bright yellow (lighter Gold) */
|
||||
@define-color color12 #5b9ab7; /* bright blue (lighter Pine) */
|
||||
@define-color color13 #eed0ff; /* bright magenta (lighter Iris) */
|
||||
@define-color color14 #ffe5e3; /* bright cyan (lighter Rose) */
|
||||
@define-color color15 #fefcff; /* bright white (lighter Text) */
|
||||
101
homes/modules/de/waybar/default.nix
Normal file
101
homes/modules/de/waybar/default.nix
Normal file
|
|
@ -0,0 +1,101 @@
|
|||
{upkgs, ...}: {
|
||||
programs.waybar = {
|
||||
enable = true;
|
||||
settings = {
|
||||
mainBar = {
|
||||
layer = "top";
|
||||
position = "top";
|
||||
height = 30;
|
||||
# modules-left = ["hyprland/workspaces" "wlr/taskbar" "custom/media"];
|
||||
modules-left = ["hyprland/workspaces" "wlr/taskbar"];
|
||||
modules-center = ["clock"];
|
||||
modules-right = ["cpu" "memory" "network" "pulseaudio" "privacy" "tray"];
|
||||
|
||||
# left
|
||||
"hyprland/workspaces" = {
|
||||
format = "{id}";
|
||||
};
|
||||
"ext/workspaces" = {
|
||||
# not enabled yet, hyprland and mango need two different configs ;-;
|
||||
format = "{id}";
|
||||
ignore-hidden = true;
|
||||
on-click = "activate";
|
||||
};
|
||||
"wlr/taskbar" = {
|
||||
format = "{icon}";
|
||||
icon-size = 12;
|
||||
};
|
||||
# "custom/media" = {
|
||||
# exec = "auroramedia";
|
||||
# return-type = "json";
|
||||
# escape = true;
|
||||
# restart-interval = 1;
|
||||
# };
|
||||
|
||||
# center
|
||||
"clock" = {
|
||||
format = "{:%Y %b %a %d %H:%M:%S}";
|
||||
interval = 1;
|
||||
tooltip = false;
|
||||
};
|
||||
|
||||
# right
|
||||
"cpu" = {
|
||||
format = " {usage}%";
|
||||
interval = 1;
|
||||
};
|
||||
"memory" = {
|
||||
format = " {used:0.1f} / {total:0.1f} GiB";
|
||||
interval = 1;
|
||||
};
|
||||
"network" = {
|
||||
format = "{bandwidthUpBytes} {bandwidthDownBytes} {ifname}";
|
||||
format-wifi = " {bandwidthUpBytes} {bandwidthDownBytes} ";
|
||||
format-ethernet = " {bandwidthUpBytes} {bandwidthDownBytes} ";
|
||||
format-disconnected = "no internet ~ rawr! ~ x3"; # empty format hides module
|
||||
interval = 1;
|
||||
max-length = 32;
|
||||
};
|
||||
"pulseaudio" = {
|
||||
format = "{icon} {volume}%";
|
||||
format-muted = " {volume}%";
|
||||
format-icons = {
|
||||
default = [
|
||||
""
|
||||
""
|
||||
""
|
||||
];
|
||||
};
|
||||
"scroll-step" = 5;
|
||||
};
|
||||
"privacy" = {
|
||||
icon-size = 12;
|
||||
icon-spacing = 5;
|
||||
transition-duration = 200;
|
||||
modules = [
|
||||
{
|
||||
type = "screenshare";
|
||||
tooltip = true;
|
||||
tooltip-icon-size = 12;
|
||||
}
|
||||
{
|
||||
type = "audio-in";
|
||||
tooltip = true;
|
||||
tooltip-icon-size = 12;
|
||||
}
|
||||
];
|
||||
};
|
||||
"tray" = {
|
||||
icon-size = 12;
|
||||
spacing = 10;
|
||||
# fixes spotify not showing up when "close button should minimize the Spotify window" is false
|
||||
show-passive-items = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
style =
|
||||
builtins.readFile ./colors.css
|
||||
+ builtins.readFile ./style.css;
|
||||
};
|
||||
}
|
||||
164
homes/modules/de/waybar/style.css
Normal file
164
homes/modules/de/waybar/style.css
Normal file
|
|
@ -0,0 +1,164 @@
|
|||
* {
|
||||
border: none;
|
||||
border-radius: 0;
|
||||
font-family: 'GeistMono Nerd Font';
|
||||
font-size: 15px;
|
||||
font-weight: bold;
|
||||
min-height: 10px;
|
||||
}
|
||||
window#waybar {
|
||||
background: rgba(0, 0, 0, 0);
|
||||
}
|
||||
/*
|
||||
adds a margin around the edge of the taskbar, surrounding the modules,
|
||||
spacing it out from the edge of the screen and windows below
|
||||
*/
|
||||
window#waybar > box {
|
||||
margin: 0px 12px;
|
||||
}
|
||||
|
||||
tooltip {
|
||||
background: @colorbg;
|
||||
color: @colorfg;
|
||||
opacity: 0.9;
|
||||
padding: 4px;
|
||||
border-radius: 12px;
|
||||
border: 1px solid @color01;
|
||||
}
|
||||
tooltip label {
|
||||
background: rgba(0, 0, 0, 0);
|
||||
color: @colorfg;
|
||||
}
|
||||
|
||||
#clock,
|
||||
#memory,
|
||||
#network,
|
||||
#workspaces,
|
||||
#taskbar,
|
||||
#cpu,
|
||||
#pulseaudio,
|
||||
#privacy,
|
||||
#tray,
|
||||
#custom-media {
|
||||
background: @colorbg;
|
||||
color: @colorfg;
|
||||
opacity: 0.9;
|
||||
padding: 4px 16px;
|
||||
border-radius: 32px;
|
||||
border: 1px solid @color01;
|
||||
}
|
||||
|
||||
/*
|
||||
left-side modules
|
||||
*/
|
||||
#workspaces,
|
||||
#taskbar,
|
||||
#custom-media {
|
||||
margin: 4px 4px 4px 0px;
|
||||
}
|
||||
|
||||
/*
|
||||
center modules
|
||||
*/
|
||||
#clock {
|
||||
margin: 4px 0px 4px 0px;
|
||||
}
|
||||
|
||||
/*
|
||||
right-side modules
|
||||
*/
|
||||
#memory,
|
||||
#network,
|
||||
#cpu,
|
||||
#pulseaudio,
|
||||
#tray,
|
||||
#privacy {
|
||||
margin: 4px 0px 4px 4px;
|
||||
}
|
||||
|
||||
#workspaces,
|
||||
#taskbar {
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
#taskbar.empty {
|
||||
opacity: 0;
|
||||
padding: 0px;
|
||||
margin: 0px;
|
||||
border: none;
|
||||
}
|
||||
#tray.empty {
|
||||
opacity: 0;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
border: none;
|
||||
}
|
||||
|
||||
/*
|
||||
connects the workspace and taskbar together :3
|
||||
*/
|
||||
/*
|
||||
#workspaces {
|
||||
margin: 4px 0px 4px 12px;
|
||||
padding: 0px 8px 0px 0px;
|
||||
border-radius: 100px 0px 0px 100px;
|
||||
border-width: 1px 0px 1px 1px;
|
||||
}
|
||||
#taskbar {
|
||||
margin: 4px 0px 4px 0px;
|
||||
padding: 0px 0px 0px 8px;
|
||||
border-radius: 0px 100px 100px 0px;
|
||||
}
|
||||
*/
|
||||
|
||||
#cpu {
|
||||
margin: 4px 0 4px 0;
|
||||
border-radius: 32px 0px 0px 32px;
|
||||
}
|
||||
#memory {
|
||||
margin: 4px 0 4px 0;
|
||||
border-radius: 0px;
|
||||
border-width: 1px 0px 1px 0px;
|
||||
}
|
||||
#network {
|
||||
margin: 4px 0 4px 0;
|
||||
border-radius: 0px 32px 32px 0px;
|
||||
}
|
||||
|
||||
#workspaces button {
|
||||
padding: 2px 4px;
|
||||
border-radius: 32px;
|
||||
color: @colorfg;
|
||||
}
|
||||
#workspaces button:hover {
|
||||
background: @colorfg;
|
||||
color: @colorbg;
|
||||
opacity: 0.8;
|
||||
}
|
||||
#workspaces button.active {
|
||||
background: @colorfg;
|
||||
color: @colorbg;
|
||||
}
|
||||
|
||||
#taskbar button {
|
||||
padding: 2px 4px;
|
||||
border-radius: 32px;
|
||||
color: @colorfg;
|
||||
}
|
||||
#taskbar button:hover {
|
||||
background: @colorfg;
|
||||
color: @colorbg;
|
||||
opacity: 0.8;
|
||||
}
|
||||
#taskbar button.active {
|
||||
background: @colorfg;
|
||||
color: @colorbg;
|
||||
}
|
||||
/*
|
||||
icons in each button on the taskbar to correct
|
||||
for them not being properly centred sometimes :3
|
||||
*/
|
||||
#taskbar button box image {
|
||||
padding-left: 2px;
|
||||
}
|
||||
|
||||
164
homes/modules/editor/helix.nix
Executable file
164
homes/modules/editor/helix.nix
Executable file
|
|
@ -0,0 +1,164 @@
|
|||
{pkgs, ...}: let
|
||||
lsps = {
|
||||
bash-language-server = {
|
||||
pkg = pkgs.bash-language-server;
|
||||
cmd = "bash-language-server";
|
||||
};
|
||||
|
||||
# TODO: once upgraded past Nix-24.07 this line won't be necessary (I think)
|
||||
# helix will support nixd by default
|
||||
# SOURCE: https://github.com/nix-community/nixd/blob/main/nixd/docs/editor-setup.md#Helix
|
||||
nixd = {
|
||||
pkg = pkgs.nixd;
|
||||
cmd = "nixd";
|
||||
};
|
||||
|
||||
ty = {
|
||||
pkg = pkgs.ty; # DEBUG: upkgs.ty;
|
||||
cmd = "ty";
|
||||
};
|
||||
};
|
||||
in {
|
||||
home.packages =
|
||||
lsps
|
||||
|> builtins.attrValues
|
||||
|> map (lsp: lsp.pkg);
|
||||
|
||||
# REF: https://docs.helix-editor.com/editor.html
|
||||
programs.helix = {
|
||||
enable = true;
|
||||
settings = {
|
||||
theme = "dracula";
|
||||
|
||||
editor = {
|
||||
line-number = "absolute";
|
||||
popup-border = "all";
|
||||
scroll-lines = 3;
|
||||
color-modes = true; # colour the mode indicator depending on mode
|
||||
shell = ["bash" "-c"];
|
||||
|
||||
auto-format = true;
|
||||
auto-completion = true; # enable popup for autocomplete
|
||||
completion-timeout = 250; # time before completions display
|
||||
preview-completion-insert = true;
|
||||
completion-trigger-len = 2; # min word length to trigger completions
|
||||
completion-replace = true; # completions replace entire word
|
||||
|
||||
indent-heuristic = "tree-sitter"; # how indentation is computed
|
||||
middle-click-paste = true;
|
||||
insert-final-newline = true; # append newline to file on write
|
||||
|
||||
gutters = [
|
||||
"diagnostics"
|
||||
"spacer"
|
||||
"line-numbers"
|
||||
"spacer"
|
||||
"diff"
|
||||
];
|
||||
|
||||
whitespace = {
|
||||
render = {
|
||||
space = "none"; # "all"
|
||||
tab = "none"; #"all"
|
||||
nbsp = "none";
|
||||
nnbsp = "none";
|
||||
newline = "none";
|
||||
};
|
||||
characters = {
|
||||
space = "·";
|
||||
nbsp = "⍽";
|
||||
nnbsp = "␣";
|
||||
tab = "→";
|
||||
newline = "⤶";
|
||||
tabpad = "·"; # Tabs will look like "→···" (depending on tab width)
|
||||
};
|
||||
};
|
||||
|
||||
indent-guides = {
|
||||
render = true;
|
||||
character = "▏"; # "|"
|
||||
skip-levels = 1;
|
||||
};
|
||||
|
||||
lsp = {
|
||||
enable = true;
|
||||
auto-signature-help = true; # hints for function parameters
|
||||
display-inlay-hints = true; # inline hints
|
||||
snippets = true;
|
||||
};
|
||||
|
||||
cursor-shape = {
|
||||
normal = "block";
|
||||
insert = "bar";
|
||||
select = "block";
|
||||
};
|
||||
|
||||
file-picker = {
|
||||
hidden = true; # show hidden files
|
||||
follow-symlinks = true;
|
||||
deduplicate-links = true;
|
||||
git-ignore = true; # dont read .gitignore files
|
||||
ignore = true; # use .ignore for helix instead of .gitignore
|
||||
};
|
||||
|
||||
statusline = {
|
||||
left = [
|
||||
"mode"
|
||||
"spacer"
|
||||
"version-control"
|
||||
"spinner"
|
||||
];
|
||||
center = [
|
||||
"file-name"
|
||||
"read-only-indicator"
|
||||
"file-modification-indicator"
|
||||
];
|
||||
right = [
|
||||
"position"
|
||||
"total-line-numbers"
|
||||
"file-encoding"
|
||||
"file-line-ending"
|
||||
"file-type"
|
||||
];
|
||||
separator = "|";
|
||||
mode.normal = "NORMAL";
|
||||
mode.insert = "INSERT";
|
||||
mode.select = "SELECT";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
languages = {
|
||||
language = [
|
||||
{
|
||||
name = "nix";
|
||||
indent = {
|
||||
tab-width = 2;
|
||||
unit = " ";
|
||||
};
|
||||
block-comment-tokens = {
|
||||
start = "/*";
|
||||
end = "*/";
|
||||
};
|
||||
auto-format = true;
|
||||
formatter.command = "${pkgs.alejandra}/bin/alejandra";
|
||||
language-servers = ["nixd"];
|
||||
}
|
||||
{
|
||||
name = "python";
|
||||
indent = {
|
||||
tab-width = 4;
|
||||
unit = " ";
|
||||
};
|
||||
auto-format = true;
|
||||
rulers = [80];
|
||||
language-servers = ["ty"];
|
||||
}
|
||||
];
|
||||
|
||||
language-server =
|
||||
lsps
|
||||
|> builtins.mapAttrs (_: lsp: {command = "${lsp.pkg}/bin/${lsp.cmd}";});
|
||||
};
|
||||
};
|
||||
}
|
||||
236
homes/modules/editor/neovim/default.nix
Normal file
236
homes/modules/editor/neovim/default.nix
Normal file
|
|
@ -0,0 +1,236 @@
|
|||
# TODO: look into changing to this:
|
||||
# https://github.com/BirdeeHub/nix-wrapper-modules
|
||||
{
|
||||
inputs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit
|
||||
(inputs.nixcats)
|
||||
utils
|
||||
;
|
||||
in {
|
||||
imports = [
|
||||
inputs.nixcats.homeModule
|
||||
];
|
||||
|
||||
nixCats = {
|
||||
enable = true;
|
||||
nixpkgs_version = inputs.nixpkgs-unstable;
|
||||
addOverlays =
|
||||
[
|
||||
(utils.standardPluginOverlay inputs)
|
||||
]
|
||||
++ lib.optional (builtins.pathExists ./overlays.nix) ./overlays.nix;
|
||||
|
||||
# see the packageDefinitions below.
|
||||
# This says which of those to install.
|
||||
packageNames = ["cryvim"];
|
||||
|
||||
luaPath = ./.;
|
||||
|
||||
# NOTE: the .replace vs .merge options are for modules based on existing configurations,
|
||||
# NOTE: they refer to how multiple categoryDefinitions get merged together by the module.
|
||||
# NOTE: for useage of this section, refer to :h nixCats.flake.outputs.categories
|
||||
categoryDefinitions.replace = {
|
||||
pkgs,
|
||||
settings,
|
||||
categories,
|
||||
extra,
|
||||
name,
|
||||
mkNvimPlugin,
|
||||
...
|
||||
} @ packageDef: {
|
||||
lspsAndRuntimeDeps = with pkgs; {
|
||||
general = [
|
||||
ripgrep
|
||||
fd
|
||||
];
|
||||
treesitter = [
|
||||
tree-sitter
|
||||
];
|
||||
lang = {
|
||||
lua = [
|
||||
lua-language-server
|
||||
stylua
|
||||
];
|
||||
nix = [
|
||||
nil
|
||||
nix-doc # TODO: i forgot what this is for
|
||||
nixfmt
|
||||
];
|
||||
rust = [
|
||||
rust-analyzer
|
||||
rustfmt
|
||||
];
|
||||
zig = [
|
||||
zls
|
||||
];
|
||||
elixir = [
|
||||
elixir-ls
|
||||
];
|
||||
gleam = [
|
||||
gleam
|
||||
];
|
||||
haskell = [
|
||||
haskell-language-server
|
||||
ormolu
|
||||
];
|
||||
java = [
|
||||
jdt-language-server
|
||||
javaPackages.compiler.openjdk17
|
||||
javaPackages.compiler.openjdk21
|
||||
];
|
||||
protobuf = [
|
||||
protols
|
||||
buf
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
startupPlugins = with pkgs.vimPlugins; {
|
||||
general = [
|
||||
lze
|
||||
plenary-nvim
|
||||
nvim-notify
|
||||
nvim-web-devicons
|
||||
base16-nvim
|
||||
mini-nvim
|
||||
];
|
||||
treesitter = [
|
||||
nvim-treesitter-textobjects
|
||||
nvim-treesitter.withAllGrammars
|
||||
];
|
||||
};
|
||||
|
||||
optionalPlugins = with pkgs.vimPlugins; {
|
||||
general = [
|
||||
];
|
||||
ui = [
|
||||
dressing-nvim
|
||||
];
|
||||
qol = [
|
||||
undotree
|
||||
mini-hipatterns
|
||||
];
|
||||
telescope = [
|
||||
telescope-nvim
|
||||
telescope-fzf-native-nvim
|
||||
telescope-ui-select-nvim
|
||||
];
|
||||
fyler = [
|
||||
fyler-nvim
|
||||
];
|
||||
lsp = [
|
||||
nvim-lspconfig
|
||||
];
|
||||
completion = [
|
||||
blink-cmp
|
||||
nvim-cmp
|
||||
luasnip
|
||||
friendly-snippets
|
||||
cmp_luasnip
|
||||
cmp-buffer
|
||||
cmp-path
|
||||
cmp-nvim-lua
|
||||
cmp-nvim-lsp
|
||||
cmp-cmdline
|
||||
cmp-nvim-lsp-signature-help
|
||||
cmp-cmdline-history
|
||||
lspkind-nvim
|
||||
];
|
||||
format = [
|
||||
conform-nvim
|
||||
];
|
||||
comment = [
|
||||
comment-nvim
|
||||
];
|
||||
lang = {
|
||||
java = [
|
||||
nvim-jdtls
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
# shared libraries to be added to nvim runtime's LD_LIBRARY_PATH
|
||||
sharedLibraries = {
|
||||
general = with pkgs; [
|
||||
# libgit2
|
||||
];
|
||||
};
|
||||
|
||||
environmentVariables = {
|
||||
lang = {
|
||||
rust.lsp = {
|
||||
# it literally won't see the rust-analyzer provided to it
|
||||
RUST_ANALYZER_CMD = "${pkgs.rust-analyzer}/bin/rust-analyzer";
|
||||
};
|
||||
elixir.lsp = {
|
||||
ELIXIR_LS_CMD = "${pkgs.elixir-ls}/scripts/language_server.sh";
|
||||
};
|
||||
java.lsp = {
|
||||
JAVA_HOME = "${pkgs.javaPackages.compiler.openjdk17}";
|
||||
OPENJDK_17 = "${pkgs.javaPackages.compiler.openjdk17}";
|
||||
OPENJDK_21 = "${pkgs.javaPackages.compiler.openjdk21}";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
extraWrapperArgs = {};
|
||||
# lists of the functions you would have passed to
|
||||
# python.withPackages or lua.withPackages
|
||||
|
||||
# get the path to this python environment
|
||||
# in your lua config via
|
||||
# vim.g.python3_host_prog
|
||||
# or run from nvim terminal via :!<packagename>-python3
|
||||
extraPython3Packages = {};
|
||||
# populates $LUA_PATH and $LUA_CPATH
|
||||
extraLuaPackages = {};
|
||||
};
|
||||
|
||||
# REF: :help nixCats.flake.outputs.packageDefinitions
|
||||
packageDefinitions.replace = {
|
||||
# these are the names of your packages
|
||||
# you can include as many as you wish.
|
||||
cryvim = {pkgs, ...}: {
|
||||
# they contain a settings set defined above
|
||||
# REF: :help nixCats.flake.outputs.settings
|
||||
settings = {
|
||||
wrapRc = true;
|
||||
aliases = [
|
||||
"ce"
|
||||
];
|
||||
};
|
||||
|
||||
# and a set of categories that you want
|
||||
# (and other information to pass to lua)
|
||||
categories = {
|
||||
general = true;
|
||||
|
||||
ui = true;
|
||||
qol = true;
|
||||
telescope = true;
|
||||
fyler = true;
|
||||
lsp = true;
|
||||
completion = true;
|
||||
treesitter = true;
|
||||
format = true;
|
||||
comment = true;
|
||||
|
||||
lang = {
|
||||
lua = true;
|
||||
nix = true;
|
||||
rust = true;
|
||||
zig = true;
|
||||
elixir = true;
|
||||
gleam = true;
|
||||
haskell = true;
|
||||
java = true;
|
||||
protobuf = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
9
homes/modules/editor/neovim/init.lua
Normal file
9
homes/modules/editor/neovim/init.lua
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
vim.g.mapleader = " "
|
||||
|
||||
vim.opt.termguicolors = true -- use terminal colors
|
||||
vim.opt.relativenumber = true
|
||||
vim.opt.wrap = false
|
||||
vim.opt.colorcolumn = "80"
|
||||
|
||||
require("plugins")
|
||||
require("lsp")
|
||||
66
homes/modules/editor/neovim/lua/lsp/capabilities.lua
Normal file
66
homes/modules/editor/neovim/lua/lsp/capabilities.lua
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
local M = {}
|
||||
|
||||
function M.on_attach(_, bufnr)
|
||||
-- we create a function that lets us more easily define mappings specific
|
||||
-- for LSP related items. It sets the mode, buffer and description for us each time.
|
||||
|
||||
local nmap = function(keys, func, desc)
|
||||
if desc then
|
||||
desc = "LSP: " .. desc
|
||||
end
|
||||
|
||||
vim.keymap.set("n", keys, func, { buffer = bufnr, desc = desc })
|
||||
end
|
||||
|
||||
nmap("<leader>rn", vim.lsp.buf.rename, "[R]e[n]ame")
|
||||
nmap("<leader>ca", vim.lsp.buf.code_action, "[C]ode [A]ction")
|
||||
|
||||
nmap("gd", vim.lsp.buf.definition, "[G]oto [D]efinition")
|
||||
|
||||
-- NOTE: why are these functions that call the telescope builtin?
|
||||
-- because otherwise they would load telescope eagerly when this is defined.
|
||||
-- due to us using the on_require handler to make sure it is available.
|
||||
if nixCats("general.telescope") then
|
||||
nmap("gr", function()
|
||||
require("telescope.builtin").lsp_references()
|
||||
end, "[G]oto [R]eferences")
|
||||
nmap("gI", function()
|
||||
require("telescope.builtin").lsp_implementations()
|
||||
end, "[G]oto [I]mplementation")
|
||||
nmap("<leader>ds", function()
|
||||
require("telescope.builtin").lsp_document_symbols()
|
||||
end, "[D]ocument [S]ymbols")
|
||||
nmap("<leader>ws", function()
|
||||
require("telescope.builtin").lsp_dynamic_workspace_symbols()
|
||||
end, "[W]orkspace [S]ymbols")
|
||||
nmap("<leader>dd", "<cmd>Telescope diagnostics bufnr=0<CR>", "[D]ocument [D]iagnostics")
|
||||
nmap("<leader>wd", "<cmd>Telescope diagnostics<CR>", "[W]orkspace [D]iagnostics")
|
||||
end -- TODO: someone who knows the builtin versions of these to do instead help me out please.
|
||||
|
||||
nmap("<leader>D", vim.lsp.buf.type_definition, "Type [D]efinition")
|
||||
nmap("<leader>e", vim.diagnostic.open_float, "Show [E]rror")
|
||||
|
||||
-- See `:help K` for why this keymap
|
||||
nmap("K", vim.lsp.buf.hover, "Hover Documentation")
|
||||
nmap("<C-k>", vim.lsp.buf.signature_help, "Signature Documentation")
|
||||
|
||||
-- Lesser used LSP functionality
|
||||
nmap("gD", vim.lsp.buf.declaration, "[G]oto [D]eclaration")
|
||||
nmap("<leader>wa", vim.lsp.buf.add_workspace_folder, "[W]orkspace [A]dd Folder")
|
||||
nmap("<leader>wr", vim.lsp.buf.remove_workspace_folder, "[W]orkspace [R]emove Folder")
|
||||
nmap("<leader>wl", function()
|
||||
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
|
||||
end, "[W]orkspace [L]ist Folders")
|
||||
|
||||
-- Create a command `:Format` local to the LSP buffer
|
||||
vim.api.nvim_buf_create_user_command(bufnr, "Format", function(_)
|
||||
vim.lsp.buf.format()
|
||||
end, { desc = "Format current buffer with LSP" })
|
||||
end
|
||||
|
||||
function M.get(server_name)
|
||||
local capabilities = require("blink.cmp").get_lsp_capabilities()
|
||||
|
||||
return capabilities
|
||||
end
|
||||
return M
|
||||
103
homes/modules/editor/neovim/lua/lsp/completion.lua
Normal file
103
homes/modules/editor/neovim/lua/lsp/completion.lua
Normal file
|
|
@ -0,0 +1,103 @@
|
|||
return {
|
||||
{
|
||||
"friendly-snippets",
|
||||
dep_of = { "blink.cmp" },
|
||||
},
|
||||
{
|
||||
"blink.cmp",
|
||||
event = { "InsertEnter", "CmdlineEnter" },
|
||||
on_require = "blink",
|
||||
load = function(name)
|
||||
vim.cmd.packadd(name)
|
||||
end,
|
||||
after = function(plugin)
|
||||
local blink = require("blink.cmp")
|
||||
|
||||
blink.setup({
|
||||
keymap = {
|
||||
["<C-space>"] = { "show", "show_documentation", "hide_documentation" },
|
||||
["<C-e>"] = { "hide", "fallback" },
|
||||
["<C-y>"] = { "select_and_accept", "fallback" },
|
||||
|
||||
["<C-k>"] = { "select_prev", "fallback_to_mappings" },
|
||||
["<C-j>"] = { "select_next", "fallback_to_mappings" },
|
||||
["<Up>"] = { "select_prev", "fallback" },
|
||||
["<Down>"] = { "select_next", "fallback" },
|
||||
|
||||
["<C-b>"] = { "scroll_documentation_up", "fallback" },
|
||||
["<C-f>"] = { "scroll_documentation_down", "fallback" },
|
||||
|
||||
["<Tab>"] = { "snippet_forward", "fallback" },
|
||||
["<S-Tab>"] = { "snippet_backward", "fallback" },
|
||||
|
||||
["<C-S-k>"] = { "show_signature", "hide_signature", "fallback" },
|
||||
},
|
||||
|
||||
appearance = {
|
||||
nerd_font_variant = "mono",
|
||||
},
|
||||
|
||||
sources = {
|
||||
default = { "lsp", "path", "snippets", "buffer" },
|
||||
providers = {
|
||||
lsp = {
|
||||
name = "LSP",
|
||||
module = "blink.cmp.sources.lsp",
|
||||
enabled = true,
|
||||
},
|
||||
path = {
|
||||
name = "Path",
|
||||
module = "blink.cmp.sources.path",
|
||||
enabled = true,
|
||||
},
|
||||
snippets = {
|
||||
name = "Snippets",
|
||||
module = "blink.cmp.sources.snippets",
|
||||
enabled = true,
|
||||
},
|
||||
buffer = {
|
||||
name = "Buffer",
|
||||
module = "blink.cmp.sources.buffer",
|
||||
enabled = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
completion = {
|
||||
accept = {
|
||||
auto_brackets = {
|
||||
enabled = true,
|
||||
},
|
||||
},
|
||||
|
||||
menu = {
|
||||
border = "rounded",
|
||||
max_height = 12,
|
||||
scrolloff = 2,
|
||||
|
||||
draw = {
|
||||
columns = {
|
||||
{ "kind_icon", gap = 1 },
|
||||
{ "label", "label_description", gap = 1 },
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
documentation = {
|
||||
auto_show = false,
|
||||
window = {
|
||||
border = "rounded",
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
signature = {
|
||||
enabled = true,
|
||||
window = {
|
||||
border = "rounded",
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
}
|
||||
20
homes/modules/editor/neovim/lua/lsp/indentation.lua
Normal file
20
homes/modules/editor/neovim/lua/lsp/indentation.lua
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
vim.api.nvim_create_autocmd("FileType", {
|
||||
pattern = { "lua", "nix", "gleam" },
|
||||
callback = function()
|
||||
vim.opt_local.shiftwidth = 2
|
||||
vim.opt_local.tabstop = 2
|
||||
vim.opt_local.expandtab = true
|
||||
end,
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd("User", {
|
||||
pattern = "TelescopePreviewerLoaded",
|
||||
callback = function(args)
|
||||
local ft = args.data.filetype
|
||||
if vim.tbl_contains({ "lua", "nix", "gleam", "rust" }, ft) then
|
||||
vim.bo.shiftwidth = 2
|
||||
vim.bo.tabstop = 2
|
||||
vim.bo.expandtab = true
|
||||
end
|
||||
end,
|
||||
})
|
||||
6
homes/modules/editor/neovim/lua/lsp/init.lua
Normal file
6
homes/modules/editor/neovim/lua/lsp/init.lua
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
require("lze").load({
|
||||
{ import = "lsp.completion" },
|
||||
})
|
||||
|
||||
require("lsp.indentation")
|
||||
require("lsp.lsp")
|
||||
134
homes/modules/editor/neovim/lua/lsp/lsp.lua
Normal file
134
homes/modules/editor/neovim/lua/lsp/lsp.lua
Normal file
|
|
@ -0,0 +1,134 @@
|
|||
local servers = {}
|
||||
|
||||
servers.lua_ls = {
|
||||
settings = {
|
||||
Lua = {
|
||||
formatters = {
|
||||
ignoreComments = false,
|
||||
},
|
||||
signatureHelp = { enable = true },
|
||||
diagnostics = {
|
||||
globals = { "nixCats", "vim" },
|
||||
-- disable = { 'missing-fields' },
|
||||
},
|
||||
workspace = {
|
||||
-- make the server aware of the neovim runtime files
|
||||
library = vim.api.nvim_get_runtime_file("", true),
|
||||
checkThirdParty = false,
|
||||
},
|
||||
},
|
||||
telemetry = { enabled = false },
|
||||
},
|
||||
}
|
||||
|
||||
servers.nil_ls = {
|
||||
settings = {},
|
||||
}
|
||||
|
||||
local rust_analyzer_cmd = os.getenv("RUST_ANALYZER_CMD")
|
||||
servers.rust_analyzer = {
|
||||
cmd = { rust_analyzer_cmd },
|
||||
settings = {
|
||||
server = {
|
||||
-- For debugging rust-analyzer, to see log location do :LspInfo in neovim
|
||||
-- extraEnv = { {["RA_LOG"]="project_model=debug"} },
|
||||
},
|
||||
cargo = {
|
||||
allFeatures = false,
|
||||
allTargets = false,
|
||||
buildScripts = { enable = true },
|
||||
target = "x86_64-unknown-linux-gnu",
|
||||
},
|
||||
diagnostics = {
|
||||
enable = true,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
servers.zls = {
|
||||
settings = {},
|
||||
}
|
||||
|
||||
local elixir_ls_cmd = os.getenv("ELIXIR_LS_CMD")
|
||||
servers.elixirls = {
|
||||
cmd = { elixir_ls_cmd },
|
||||
settings = {},
|
||||
}
|
||||
|
||||
servers.gleam = {
|
||||
settings = {},
|
||||
}
|
||||
|
||||
servers.hls = {
|
||||
settings = {},
|
||||
}
|
||||
|
||||
local java_home = os.getenv("JAVA_HOME")
|
||||
servers.jdtls = {
|
||||
settings = {
|
||||
java = {
|
||||
contentProvider = { preferred = "fernflower" },
|
||||
configuration = {
|
||||
runtimes = {
|
||||
{
|
||||
name = "OpenJDK 17",
|
||||
path = os.getenv("OPENJDK_17"),
|
||||
},
|
||||
{
|
||||
name = "OpenJDK 21",
|
||||
path = os.getenv("OPENJDK_21"),
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
servers.protols = {
|
||||
settings = {},
|
||||
}
|
||||
|
||||
-- Taken from nixCats example:
|
||||
-- If you were to comment out this autocommand
|
||||
-- and instead pass the on attach function directly to
|
||||
-- nvim-lspconfig, it would do the same thing.
|
||||
-- come to think of it, it might be better because then lspconfig doesnt have to be called before lsp attach?
|
||||
-- but you would still end up triggering on a FileType event anyway, so, it makes little difference.
|
||||
vim.api.nvim_create_autocmd("LspAttach", {
|
||||
group = vim.api.nvim_create_augroup("nixCats-lsp-attach", { clear = true }),
|
||||
callback = function(event)
|
||||
require("lsp.capabilities").on_attach(vim.lsp.get_client_by_id(event.data.client_id), event.buf)
|
||||
end,
|
||||
})
|
||||
|
||||
require("lze").load({
|
||||
{
|
||||
"nvim-lspconfig",
|
||||
event = "FileType",
|
||||
after = function(plugin)
|
||||
-- Just register configs, don't enable yet
|
||||
for server_name, cfg in pairs(servers) do
|
||||
vim.lsp.config(server_name, {
|
||||
capabilities = require("lsp.capabilities").get(server_name),
|
||||
settings = (cfg or {}).settings,
|
||||
filetypes = (cfg or {}).filetypes,
|
||||
cmd = (cfg or {}).cmd,
|
||||
root_pattern = (cfg or {}).root_pattern,
|
||||
})
|
||||
end
|
||||
|
||||
-- Enable on-demand per filetype
|
||||
for server_name, cfg in pairs(servers) do
|
||||
local filetypes = cfg.filetypes or vim.lsp.config[server_name].filetypes
|
||||
if filetypes then
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
pattern = filetypes,
|
||||
callback = function()
|
||||
vim.lsp.enable(server_name)
|
||||
end,
|
||||
})
|
||||
end
|
||||
end
|
||||
end,
|
||||
},
|
||||
})
|
||||
23
homes/modules/editor/neovim/lua/plugins/comment.lua
Normal file
23
homes/modules/editor/neovim/lua/plugins/comment.lua
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
return {
|
||||
{
|
||||
"comment.nvim",
|
||||
event = { "BufReadPost", "BufNewFile" },
|
||||
after = function(plugin)
|
||||
require("Comment").setup({
|
||||
toggler = {
|
||||
line = "<leader>cc",
|
||||
block = "<leader>bc",
|
||||
},
|
||||
opleader = {
|
||||
line = "<leader>c",
|
||||
block = "<leader>b",
|
||||
},
|
||||
extra = {
|
||||
above = "<leader>c<S-o>",
|
||||
below = "<leader>co",
|
||||
eol = "<leader>cA",
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
}
|
||||
5
homes/modules/editor/neovim/lua/plugins/dressing.lua
Normal file
5
homes/modules/editor/neovim/lua/plugins/dressing.lua
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
return {
|
||||
{
|
||||
"dressing.nvim",
|
||||
},
|
||||
}
|
||||
34
homes/modules/editor/neovim/lua/plugins/format.lua
Normal file
34
homes/modules/editor/neovim/lua/plugins/format.lua
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
-- docs -> https://github.com/stevearc/conform.nvim
|
||||
return {
|
||||
{
|
||||
"conform.nvim",
|
||||
enabled = nixCats("format") or false,
|
||||
keys = {
|
||||
{ "<leader>p", desc = "Format File (pretty :3)" },
|
||||
},
|
||||
after = function(plugin)
|
||||
local conform = require("conform")
|
||||
|
||||
conform.setup({
|
||||
formatters_by_ft = {
|
||||
lua = nixCats("lang.lua") and { "stylua" } or nil,
|
||||
nix = nixCats("lang.nix") and { "nixfmt" } or nil,
|
||||
rust = nixCats("lang.rust") and { "rustfmt", lsp_format = "fallback" } or nil,
|
||||
haskell = nixCats("lang.haskell") and { "ormolu" } or nil,
|
||||
proto = nixCats("lang.protobuf") and { "buf" } or nil,
|
||||
},
|
||||
format_on_save = {
|
||||
timeout_ms = 500,
|
||||
},
|
||||
})
|
||||
|
||||
vim.keymap.set({ "n", "v" }, "<leader>p", function()
|
||||
conform.format({
|
||||
lsp_fallback = false,
|
||||
async = false,
|
||||
timeout_ms = 1000,
|
||||
})
|
||||
end, { desc = "Format File (pretty :3)" })
|
||||
end,
|
||||
},
|
||||
}
|
||||
22
homes/modules/editor/neovim/lua/plugins/fyler.lua
Normal file
22
homes/modules/editor/neovim/lua/plugins/fyler.lua
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
return {
|
||||
{
|
||||
"fyler.nvim",
|
||||
cmd = { "Fyler" },
|
||||
keys = {
|
||||
{
|
||||
"<leader>tf",
|
||||
function()
|
||||
return require("fyler").toggle({ kind = "split_right" })
|
||||
end,
|
||||
mode = { "n" },
|
||||
desc = "Open [F]yler",
|
||||
},
|
||||
},
|
||||
load = function(name)
|
||||
vim.cmd.packadd(name)
|
||||
end,
|
||||
after = function(plugin)
|
||||
local fyler = require("fyler").setup()
|
||||
end,
|
||||
},
|
||||
}
|
||||
9
homes/modules/editor/neovim/lua/plugins/init.lua
Normal file
9
homes/modules/editor/neovim/lua/plugins/init.lua
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
require("lze").load({
|
||||
{ import = "plugins.dressing" },
|
||||
{ import = "plugins.telescope" },
|
||||
{ import = "plugins.treesitter" },
|
||||
{ import = "plugins.fyler" },
|
||||
{ import = "plugins.mini-hipatterns" },
|
||||
{ import = "plugins.format" },
|
||||
{ import = "plugins.comment" },
|
||||
})
|
||||
76
homes/modules/editor/neovim/lua/plugins/mini-hipatterns.lua
Normal file
76
homes/modules/editor/neovim/lua/plugins/mini-hipatterns.lua
Normal file
|
|
@ -0,0 +1,76 @@
|
|||
return {
|
||||
{
|
||||
"mini.hipatterns",
|
||||
after = function(plugin)
|
||||
local hipatterns = require("mini.hipatterns")
|
||||
|
||||
-- Returns hex color group for matching short hex color.
|
||||
--
|
||||
---@param match string
|
||||
---@return string
|
||||
local hex_color_short = function(_, match)
|
||||
local style = "fg" -- 'fg' or 'bg', for extmark_opts_inline use 'fg'
|
||||
local r, g, b = match:sub(2, 2), match:sub(3, 3), match:sub(4, 4)
|
||||
local hex = string.format("#%s%s%s%s%s%s", r, r, g, g, b, b)
|
||||
return hipatterns.compute_hex_color_group(hex, style)
|
||||
end
|
||||
|
||||
-- Returns hex color group for matching alpha hex color.
|
||||
--
|
||||
---@param match string
|
||||
---@return string
|
||||
local hex_color_alpha = function(_, match)
|
||||
local style = "fg" -- 'fg' or 'bg', for extmark_opts_inline use 'fg'
|
||||
local r, g, b = match:sub(2, 3), match:sub(4, 5), match:sub(6, 7)
|
||||
local hex = string.format("#%s%s%s", r, g, b)
|
||||
return hipatterns.compute_hex_color_group(hex, style)
|
||||
end
|
||||
|
||||
-- Returns extmark opts for highlights with virtual inline text.
|
||||
--
|
||||
---@param data table Includes `hl_group`, `full_match` and more.
|
||||
---@return table
|
||||
local extmark_opts_inline = function(_, _, data)
|
||||
return {
|
||||
virt_text = { { "", data.hl_group } },
|
||||
virt_text_pos = "inline",
|
||||
right_gravity = false,
|
||||
}
|
||||
end
|
||||
|
||||
-- Returns extmark opts for highlights with virtual inline text.
|
||||
--
|
||||
---@param data table Includes `hl_group`, `full_match` and more.
|
||||
---@return table
|
||||
local extmark_opts_inline_alpha = function(_, _, data)
|
||||
return {
|
||||
virt_text = { { "", data.hl_group } },
|
||||
virt_text_pos = "inline",
|
||||
right_gravity = false,
|
||||
}
|
||||
end
|
||||
|
||||
hipatterns.setup({
|
||||
highlighters = {
|
||||
-- #rrggbb
|
||||
hex_color = hipatterns.gen_highlighter.hex_color({
|
||||
style = "inline",
|
||||
inline_text = "",
|
||||
}),
|
||||
-- #rgb
|
||||
hex_color_short = {
|
||||
pattern = "#%x%x%x%f[%X]",
|
||||
group = hex_color_short,
|
||||
extmark_opts = extmark_opts_inline,
|
||||
},
|
||||
-- #rrggbbaa
|
||||
hex_color_alpha = {
|
||||
pattern = "#%x%x%x%x%x%x%x%x%f[%X]",
|
||||
group = hex_color_alpha,
|
||||
extmark_opts = extmark_opts_inline_alpha,
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
}
|
||||
78
homes/modules/editor/neovim/lua/plugins/telescope.lua
Normal file
78
homes/modules/editor/neovim/lua/plugins/telescope.lua
Normal file
|
|
@ -0,0 +1,78 @@
|
|||
return {
|
||||
{
|
||||
"telescope.nvim",
|
||||
cmd = { "Telescope" },
|
||||
keys = {
|
||||
{
|
||||
"<leader>f",
|
||||
function()
|
||||
return require("telescope.builtin").find_files()
|
||||
end,
|
||||
mode = { "n" },
|
||||
desc = "Telescope search [F]iles",
|
||||
},
|
||||
{
|
||||
"<leader>tr",
|
||||
function()
|
||||
return require("telescope.builtin").oldfiles()
|
||||
end,
|
||||
mode = { "n" },
|
||||
desc = "[T]elescope search [R]ecent files",
|
||||
},
|
||||
{
|
||||
"<leader>ts",
|
||||
function()
|
||||
return require("telescope.builtin").live_grep()
|
||||
end,
|
||||
mode = { "n" },
|
||||
desc = "[T]elescope [S]earch cwd with grep",
|
||||
},
|
||||
{
|
||||
"<leader>tw",
|
||||
function()
|
||||
return require("telescope.builtin").grep_string()
|
||||
end,
|
||||
mode = { "n" },
|
||||
desc = "[T]elescope search current [W]ord",
|
||||
},
|
||||
{
|
||||
"<leader>tk",
|
||||
function()
|
||||
return require("telescope.builtin").keymaps()
|
||||
end,
|
||||
mode = { "n" },
|
||||
desc = "[T]elescope search [K]eymaps",
|
||||
},
|
||||
{
|
||||
"<leader>tb",
|
||||
function()
|
||||
return require("telescope.builtin").buffers()
|
||||
end,
|
||||
mode = { "n" },
|
||||
desc = "[T]elescope search [B]uffers",
|
||||
},
|
||||
},
|
||||
load = function(name)
|
||||
vim.cmd.packadd(name)
|
||||
vim.cmd.packadd("telescope-fzf-native.nvim")
|
||||
end,
|
||||
after = function(plugin)
|
||||
local telescope = require("telescope")
|
||||
local actions = require("telescope.actions")
|
||||
|
||||
telescope.setup({
|
||||
defaults = {
|
||||
mappings = {
|
||||
i = {
|
||||
["<C-k>"] = actions.move_selection_previous, -- move to prev result
|
||||
["<C-j>"] = actions.move_selection_next, -- move to next result
|
||||
["<C-q>"] = actions.send_selected_to_qflist + actions.open_qflist,
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
pcall(telescope.load_extension, "fzf")
|
||||
end,
|
||||
},
|
||||
}
|
||||
95
homes/modules/editor/neovim/lua/plugins/treesitter.lua
Normal file
95
homes/modules/editor/neovim/lua/plugins/treesitter.lua
Normal file
|
|
@ -0,0 +1,95 @@
|
|||
-- to help me write this after nvim-treesitter updated, i used:
|
||||
-- https://github.com/BirdeeHub/nixCats-nvim/blob/3c9bc4d7123e1b48d92f25ba505b889af541e897/templates/example/lua/myLuaConf/plugins/treesitter.lua
|
||||
|
||||
return {
|
||||
{
|
||||
"nvim-treesitter",
|
||||
lazy = false,
|
||||
after = function(plugin)
|
||||
--@param buf integer
|
||||
--@param language string
|
||||
local function treesitter_try_attach(buf, language)
|
||||
--check if parser exists and load it
|
||||
if not vim.treesitter.language.add(language) then
|
||||
return
|
||||
end
|
||||
|
||||
-- enables syntax highlight and other treesitter features
|
||||
vim.treesitter.start(buf, language)
|
||||
|
||||
-- enables treesitter based folds
|
||||
vim.wo.foldexpr = "v:lua.vim.treesitter.foldexpr()"
|
||||
|
||||
-- enables treesiter based indentation
|
||||
vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()"
|
||||
end
|
||||
|
||||
local available_parsers = require("nvim-treesitter").get_available()
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
callback = function(args)
|
||||
local buf, filetype = args.buf, args.match
|
||||
local language = vim.treesitter.language.get_lang(filetype)
|
||||
if not language then
|
||||
return
|
||||
end
|
||||
|
||||
local installed_parsers = require("nvim-treesitter").get_installed("parsers")
|
||||
|
||||
if vim.tbl_contains(installed_parsers, language) then
|
||||
-- enable the parser if it is installed
|
||||
treesitter_try_attach(buf, language)
|
||||
elseif vim.tbl_contains(available_parsers, language) then
|
||||
-- if a parser is available in `nvim-treesitter` enable it after ensuring it is installed
|
||||
require("nvim-treesitter").install(language):await(function()
|
||||
treesitter_try_attach(buf, language)
|
||||
end)
|
||||
else
|
||||
-- try to enable treesitter features in case the parser exists but is not available from `nvim-treesitter`
|
||||
treesitter_try_attach(buf, language)
|
||||
end
|
||||
end,
|
||||
})
|
||||
end,
|
||||
},
|
||||
{
|
||||
"nvim-treesitter-textobjects",
|
||||
lazy = false,
|
||||
before = function(plugin)
|
||||
vim.g.no_plugin_maps = true
|
||||
end,
|
||||
after = function(plugin)
|
||||
require("nvim-treesitter-textobjects").setup({
|
||||
select = {
|
||||
lookahead = true,
|
||||
selection_modes = {
|
||||
["@parameter.outer"] = "v", -- charwise
|
||||
["@function.outer"] = "V", -- linewise
|
||||
},
|
||||
include_surrounding_whitespace = false,
|
||||
},
|
||||
})
|
||||
|
||||
-- keymaps
|
||||
vim.keymap.set({ "x", "o" }, "am", function()
|
||||
require("nvim-treesitter-textobjects.select").select_textobject("@function.outer", "textobjects")
|
||||
end)
|
||||
vim.keymap.set({ "x", "o" }, "im", function()
|
||||
require("nvim-treesitter-textobjects.select").select_textobject("@function.inner", "textobjects")
|
||||
end)
|
||||
vim.keymap.set({ "x", "o" }, "ac", function()
|
||||
require("nvim-treesitter-textobjects.select").select_textobject("@class.outer", "textobjects")
|
||||
end)
|
||||
vim.keymap.set({ "x", "o" }, "ic", function()
|
||||
require("nvim-treesitter-textobjects.select").select_textobject("@class.inner", "textobjects")
|
||||
end)
|
||||
-- You can also use captures from other query groups like `locals.scm`
|
||||
vim.keymap.set({ "x", "o" }, "as", function()
|
||||
require("nvim-treesitter-textobjects.select").select_textobject("@local.scope", "locals")
|
||||
end)
|
||||
|
||||
-- NOTE: for more textobjects options, see the following link.
|
||||
-- This template is using the new `main` branch of the repo.
|
||||
-- https://github.com/nvim-treesitter/nvim-treesitter-textobjects/tree/main
|
||||
end,
|
||||
},
|
||||
}
|
||||
30
homes/modules/editor/vscodium.nix
Normal file
30
homes/modules/editor/vscodium.nix
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
{pkgs, ...}: {
|
||||
# REF: https://home-manager-options.extranix.com/?query=vscode&release=release-25.05
|
||||
programs.vscode = {
|
||||
enable = true;
|
||||
package = pkgs.vscodium;
|
||||
|
||||
mutableExtensionsDir = true;
|
||||
|
||||
profiles.default = {
|
||||
enableUpdateCheck = true;
|
||||
enableExtensionUpdateCheck = true;
|
||||
# extension format: USER.PACKAGENAME
|
||||
extensions = with pkgs.vscode-extensions; [
|
||||
dracula-theme.theme-dracula
|
||||
];
|
||||
|
||||
userSettings = {
|
||||
"workbench.colorTheme" = "Dracula Theme";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
home.file.".vscode/argv.json".text = builtins.toJSON {
|
||||
password-store = "gnome-libsecret";
|
||||
|
||||
disable-hardware-acceleration = false;
|
||||
disable-color-correct-rendering = false;
|
||||
enable-crash-reporter = false;
|
||||
};
|
||||
}
|
||||
16
homes/modules/services/ssh-agent.nix
Normal file
16
homes/modules/services/ssh-agent.nix
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
{osConfig, ...}: {
|
||||
assertions = [
|
||||
{
|
||||
assertion = !osConfig.services.gnupg.agent.enable;
|
||||
message = ''
|
||||
It is not recommended to enable both `homeConfig.services.ssh-agent.enable` and `osConfig.services.gnupg.agent.enable`!
|
||||
'';
|
||||
}
|
||||
];
|
||||
|
||||
# enable OpenSSH private key agent
|
||||
services.ssh-agent.enable = true;
|
||||
|
||||
# WARNING: the ssh-agent won't set this for itself...
|
||||
systemd.user.sessionVariables.SSH_AUTH_SOCK = "$XDG_RUNTIME_DIR/ssh-agent";
|
||||
}
|
||||
29
homes/modules/shell/elvish.nix
Normal file
29
homes/modules/shell/elvish.nix
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
cfg = config.programs.elvish;
|
||||
in {
|
||||
options.programs.elvish = {
|
||||
enable = lib.mkEnableOption "elvish";
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
home = {
|
||||
packages = with pkgs; [elvish];
|
||||
|
||||
file.".elvish/nix.elv".source = let
|
||||
elvish-modules = pkgs.fetchFromGitHub {
|
||||
owner = "zzamboni";
|
||||
repo = "elvish-modules";
|
||||
rev = "9005c970346ab06214b3cd3ed3e70f04f3c632ba";
|
||||
hash = "sha256-/Dwtl12QzPvMoMMGoj+v3dwX2ZwFT8t/bohVy1zDE0c=";
|
||||
};
|
||||
in
|
||||
builtins.toPath "${elvish-modules}/nix.elv";
|
||||
# /${builtins.toPath elvish-modules.outPath}/nix.elv;
|
||||
};
|
||||
};
|
||||
}
|
||||
58
homes/modules/shell/fish.nix
Executable file
58
homes/modules/shell/fish.nix
Executable file
|
|
@ -0,0 +1,58 @@
|
|||
{pkgs, ...}: {
|
||||
programs.fish = {
|
||||
enable = true;
|
||||
generateCompletions = true;
|
||||
|
||||
interactiveShellInit = let
|
||||
greetings =
|
||||
[
|
||||
# Official _cry64 quotes
|
||||
"Do butterflies cry when they're sad?"
|
||||
"I hope they do"
|
||||
"I think Alice is lost..."
|
||||
"I once again retreat to the sanctuary of my virtual realm"
|
||||
|
||||
# Unknown
|
||||
"Welcome weary traveler to my shop"
|
||||
|
||||
# Legend of Zelda
|
||||
"It's dangerous to go alone! Take this."
|
||||
|
||||
# ULTRAKILL
|
||||
"Something wicked this way comes"
|
||||
"May your L's be many... and your bitches few"
|
||||
|
||||
# Terraria
|
||||
"What a horrible night to have a curse."
|
||||
"The ancient spirits of light and dark have been released."
|
||||
|
||||
# Calamity
|
||||
"The god of the stars rejects your offering. The ritual can only be performed at night."
|
||||
"You should have just died..."
|
||||
"Supreme Witch, Calamitas has killed every player!"
|
||||
|
||||
# Key Fairy
|
||||
"A broken heart beats in fractals"
|
||||
|
||||
# Signalis
|
||||
"Remember our promise"
|
||||
]
|
||||
|> map (x: "\"${x}\"")
|
||||
|> builtins.concatStringsSep " ";
|
||||
in ''
|
||||
function rand_greet
|
||||
set greetings ${greetings}
|
||||
echo -n $greetings[(random 1 (count $greetings))]
|
||||
end
|
||||
|
||||
set -g fish_greeting (rand_greet)
|
||||
'';
|
||||
|
||||
plugins = [
|
||||
{
|
||||
name = "grc";
|
||||
src = pkgs.fishPlugins.grc.src;
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
17
homes/modules/shell/zsh.nix
Normal file
17
homes/modules/shell/zsh.nix
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
{...}: {
|
||||
programs.zsh = {
|
||||
enable = true;
|
||||
enableCompletion = true;
|
||||
autosuggestion.enable = true;
|
||||
syntaxHighlighting.enable = true;
|
||||
|
||||
history = {
|
||||
size = 10000;
|
||||
ignoreAllDups = true;
|
||||
path = "$HOME/.zsh_history";
|
||||
ignorePatterns = [
|
||||
"rm *"
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
324
homes/modules/term/foot.nix
Normal file
324
homes/modules/term/foot.nix
Normal file
|
|
@ -0,0 +1,324 @@
|
|||
{pkgs, ...}: {
|
||||
programs.foot = {
|
||||
enable = true;
|
||||
package = pkgs.foot;
|
||||
|
||||
server.enable = true;
|
||||
|
||||
settings = let
|
||||
none = "\"\"";
|
||||
in {
|
||||
main = {
|
||||
term = "foot"; # set $TERM
|
||||
login-shell = "no";
|
||||
title = "foot";
|
||||
locked-title = "no";
|
||||
|
||||
font = "JetBrainsMonoNL Nerd Font:size=12";
|
||||
# font-bold = "";
|
||||
# font-italice = "";
|
||||
# font-bold-italice = "";
|
||||
# font-size-adjustment = 0.5;
|
||||
# line-height = ...;
|
||||
# letter-spacing = 0;
|
||||
# horizontal-letter-offset = 0;
|
||||
# vertical-letter-offset = 0;
|
||||
# underline-offset = ...;
|
||||
# underline-thickness = ...;
|
||||
# strikeout-thickness = ...;
|
||||
box-drawings-uses-font-glyphs = "no";
|
||||
dpi-aware = "no";
|
||||
gamma-correct-blending = "no";
|
||||
|
||||
initial-color-theme = "1";
|
||||
# initial-window-size-pixels = "700x500"; # pixel COLSxROWS
|
||||
initial-window-size-chars = "90x26"; # char COLSxROWS
|
||||
initial-window-mode = "windowed";
|
||||
pad = "32x32 center-when-maximized-and-fullscreen";
|
||||
resize-by-cells = "yes";
|
||||
resize-keep-grid = "yes";
|
||||
resize-delay-ms = "100";
|
||||
|
||||
bold-text-in-bright = "no";
|
||||
word-delimiters = ",│`|:\"'()[]{}<>";
|
||||
selection-target = "primary";
|
||||
# workers = ...; # number of logical CPUs
|
||||
};
|
||||
|
||||
# environment = {
|
||||
# name = "value";
|
||||
# }
|
||||
|
||||
security = {
|
||||
osc52 = "enabled";
|
||||
};
|
||||
|
||||
bell = {
|
||||
system = "no";
|
||||
urgent = "no";
|
||||
notify = "no";
|
||||
visual = "no";
|
||||
# command = ...;
|
||||
# command-focused = "no";
|
||||
};
|
||||
|
||||
desktop-notifications = {
|
||||
command = "notify-send --wait --app-name \${app-id} --icon \${app-id} --category \${category} --urgency \${urgency} --expire-time \${expire-time} --hint STRING:image-path:\${icon} --hint BOOLEAN:suppress-sound:\${muted} --hint STRING:sound-name:\${sound-name} --replace-id \${replace-id} \${action-argument} --print-id -- \${title} \${body}";
|
||||
command-action-argument = "--action \${action-name=\${action-label}}";
|
||||
close = none;
|
||||
inhibit-when-focused = "no";
|
||||
};
|
||||
|
||||
scrollback = {
|
||||
lines = 1000;
|
||||
multiplier = 1.0;
|
||||
indicator-position = "relative";
|
||||
indicator-format = none;
|
||||
};
|
||||
|
||||
url = {
|
||||
launch = "xdg-open \${url}";
|
||||
label-letters = "sadfjklewcmpgh";
|
||||
osc8-underline = "url-mode";
|
||||
regex = "(((https?://|mailto:|ftp://|file:|ssh:|ssh://|git://|tel:|magnet:|ipfs://|ipns://|gemini://|gopher://|news:)|www\\.)([0-9a-zA-Z:/?#@!$&*+,;=.~_%^\\-]+|\\([]\\[\"0-9a-zA-Z:/?#@!$&'*+,;=.~_%^\\-]*\\)|\\[[\\(\\)\"0-9a-zA-Z:/?#@!$&'*+,;=.~_%^\\-]*\\]|\"[]\\[\\(\\)0-9a-zA-Z:/?#@!$&'*+,;=.~_%^\\-]*\"|'[]\\[\\(\\)0-9a-zA-Z:/?#@!$&*+,;=.~_%^\\-]*')+([0-9a-zA-Z/#@$&*+=~_%^\\-]|\\([]\\[\"0-9a-zA-Z:/?#@!$&'*+,;=.~_%^\\-]*\\)|\\[[\\(\\)\"0-9a-zA-Z:/?#@!$&'*+,;=.~_%^\\-]*\\]|\"[]\\[\\(\\)0-9a-zA-Z:/?#@!$&'*+,;=.~_%^\\-]*\"|'[]\\[\\(\\)0-9a-zA-Z:/?#@!$&*+,;=.~_%^\\-]*'))";
|
||||
};
|
||||
|
||||
# "regex:your-fancy-name" = {
|
||||
# regex = ...;
|
||||
# launch = "[path to script/application] \${match}"
|
||||
# };
|
||||
#
|
||||
# key-bindings = {
|
||||
# regex-launch = "[your-fancy-name] Control+Shift+q";
|
||||
# regex-copy = "[your-fancy-name] Control+Alt+shift+q";
|
||||
# };
|
||||
|
||||
cursor = {
|
||||
style = "block";
|
||||
blink = "no";
|
||||
# blink-rate = 500;
|
||||
beam-thickness = 1.0;
|
||||
# underline-thickness = ...;
|
||||
};
|
||||
|
||||
mouse = {
|
||||
hide-when-typing = "yes";
|
||||
alternate-scroll-mode = "yes";
|
||||
};
|
||||
|
||||
touch = {
|
||||
long-press-delay = 400;
|
||||
};
|
||||
|
||||
# Theme: Dracula
|
||||
# REF: https://github.com/dracula/foot
|
||||
colors = {
|
||||
alpha = 1.0;
|
||||
alpha-mode = "default"; # default/matching/all
|
||||
|
||||
background = "282a36";
|
||||
foreground = "f8f8f2";
|
||||
|
||||
## Normal/regular colors (color palette 0-7)
|
||||
regular0 = "21222c"; # black
|
||||
regular1 = "ff5555"; # red
|
||||
regular2 = "50fa7b"; # green
|
||||
regular3 = "f1fa8c"; # yellow
|
||||
regular4 = "bd93f9"; # blue
|
||||
regular5 = "ff79c6"; # magenta
|
||||
regular6 = "8be9fd"; # cyan
|
||||
regular7 = "f8f8f2"; # white
|
||||
|
||||
## Bright colors (color palette 8-15)
|
||||
bright0 = "6272a4"; # bright black
|
||||
bright1 = "ff6e6e"; # bright red
|
||||
bright2 = "69ff94"; # bright green
|
||||
bright3 = "ffffa5"; # bright yellow
|
||||
bright4 = "d6acff"; # bright blue
|
||||
bright5 = "ff92df"; # bright magenta
|
||||
bright6 = "a4ffff"; # bright cyan
|
||||
bright7 = "ffffff"; # bright white
|
||||
|
||||
## Misc colors
|
||||
selection-foreground = "ffffff";
|
||||
selection-background = "44475a";
|
||||
# jump-labels=<regular0> <regular3> # black-on-yellow
|
||||
# scrollback-indicator=<regular0> <bright4> # black-on-bright-blue
|
||||
# search-box-no-match=<regular0> <regular1> # black-on-red
|
||||
# search-box-match=<regular0> <regular3> # black-on-yellow
|
||||
urls = "8be9fd";
|
||||
|
||||
flash = "7f7f00";
|
||||
flash-alpha = 0.5;
|
||||
};
|
||||
|
||||
# Alternative colour palette (see `man 5 foot.ini`)
|
||||
colors2 = {
|
||||
alpha = 1.0;
|
||||
alpha-mode = "default";
|
||||
|
||||
background = "191724";
|
||||
foreground = "e0def4";
|
||||
|
||||
regular0 = "26233a"; # black (Overlay)
|
||||
regular1 = "eb6f92"; # red (Love)
|
||||
regular2 = "9ccfd8"; # green (Foam)
|
||||
regular3 = "f6c177"; # yellow (Gold)
|
||||
regular4 = "31748f"; # blue (Pine)
|
||||
regular5 = "c4a7e7"; # magenta (Iris)
|
||||
regular6 = "ebbcba"; # cyan (Rose)
|
||||
regular7 = "e0def4"; # white (Text)
|
||||
|
||||
bright0 = "47435d"; # bright black (lighter Overlay)
|
||||
bright1 = "ff98ba"; # bright red (lighter Love)
|
||||
bright2 = "c5f9ff"; # bright green (lighter Foam)
|
||||
bright3 = "ffeb9e"; # bright yellow (lighter Gold)
|
||||
bright4 = "5b9ab7"; # bright blue (lighter Pine)
|
||||
bright5 = "eed0ff"; # bright magenta (lighter Iris)
|
||||
bright6 = "ffe5e3"; # bright cyan (lighter Rose)
|
||||
bright7 = "fefcff"; # bright white (lighter Text)
|
||||
|
||||
selection-foreground = "ffffff";
|
||||
selection-background = "393553";
|
||||
|
||||
urls = "ebbcba"; # Rose
|
||||
|
||||
flash = "f6c177"; # yellow (Gold)
|
||||
flash-alpha = 0.5;
|
||||
|
||||
cursor = "191724 e0def4";
|
||||
};
|
||||
|
||||
# csd = {
|
||||
# preferred = "server";
|
||||
# size = 26;
|
||||
# font = ...;
|
||||
# color = ...; # foreground color
|
||||
# hide-when-maximized = "no";
|
||||
# border-width = 0;
|
||||
# border-color = ...;
|
||||
# button-width = 26;
|
||||
# button-color = ...; # background color
|
||||
# button-minimize-color = ...;
|
||||
# button-maximize-color = ...;
|
||||
# button-close-color = ...;
|
||||
# };
|
||||
|
||||
key-bindings = {
|
||||
scrollback-up-page = "Shift+Page_Up Shift+KP_Page_Up";
|
||||
# scrollback-up-half-page = "none";
|
||||
# scrollback-up-line = "none";
|
||||
scrollback-down-page = "Shift+Page_Down Shift+KP_Page_Down";
|
||||
# scrollback-down-half-page = "none";
|
||||
# scrollback-down-line = "none";
|
||||
# scrollback-home = "none";
|
||||
# scrollback-end = "none";
|
||||
|
||||
clipboard-copy = "Control+Shift+c XF86Copy";
|
||||
clipboard-paste = "Control+Shift+v XF86Paste";
|
||||
primary-paste = "Shift+Insert";
|
||||
search-start = "Control+Shift+r";
|
||||
|
||||
font-increase = "Control+plus Control+equal Control+KP_Add";
|
||||
font-decrease = "Control+minus Control+KP_Subtract";
|
||||
font-reset = "Control+0 Control+KP_0";
|
||||
|
||||
spawn-terminal = "Control+Shift+n";
|
||||
# minimize = "none";
|
||||
# maximize = "none";
|
||||
# fullscreen = "none";
|
||||
|
||||
pipe-visible = "[sh -c \"xurls | fuzzel | xargs -r firefox\"] none";
|
||||
pipe-scrollback = "[sh -c \"xurls | fuzzel | xargs -r firefox\"] none";
|
||||
pipe-selected = "[xargs -r firefox] none";
|
||||
pipe-command-output = "[wl-copy] none";
|
||||
|
||||
show-urls-launch = "Control+Shift+o";
|
||||
# show-urls-copy = "none";
|
||||
# show-urls-persistent = "none";
|
||||
|
||||
prompt-prev = "Control+Shift+z";
|
||||
prompt-next = "Control+Shift+x";
|
||||
|
||||
unicode-input = "Control+Shift+u";
|
||||
# color-theme-switch-1 = "none";
|
||||
# color-theme-switch-2 = "none";
|
||||
color-theme-toggle = "Control+Alt+p";
|
||||
|
||||
# noop = "none";
|
||||
# quit = "none";
|
||||
};
|
||||
|
||||
search-bindings = {
|
||||
cancel = "Control+g Control+c Escape";
|
||||
commit = "Return KP_Enter";
|
||||
|
||||
find-prev = "Control+r";
|
||||
find-next = "Control+s";
|
||||
|
||||
cursor-left = "Left Control+b";
|
||||
cursor-left-word = "Control+Left Mod1+b";
|
||||
cursor-right = "Right Control+f";
|
||||
cursor-right-word = "Control+Right Mod1+f";
|
||||
cursor-home = "Home Control+a";
|
||||
cursor-end = "End Control+e";
|
||||
|
||||
delete-prev = "BackSpace";
|
||||
delete-prev-word = "Mod1+BackSpace Control+BackSpace";
|
||||
delete-next = "Delete";
|
||||
delete-next-word = "Mod1+d Control+Delete";
|
||||
delete-to-start = "Control+u";
|
||||
delete-to-end = "Control+k";
|
||||
|
||||
extend-char = "Shift+Right";
|
||||
extend-to-word-boundary = "Control+w Control+Shift+Right";
|
||||
extend-to-next-whitespace = "Control+Shift+w";
|
||||
extend-line-down = "Shift+Down";
|
||||
extend-backward-char = "Shift+Left";
|
||||
extend-backward-to-word-boundary = "Control+Shift+Left";
|
||||
# extend-backward-to-next-whitespace = "none";
|
||||
extend-line-up = "Shift+Up";
|
||||
|
||||
clipboard-paste = "Control+v Control+Shift+v Control+y XF86Paste";
|
||||
primary-paste = "Shift+Insert";
|
||||
|
||||
# unicode-input = "none";
|
||||
|
||||
scrollback-up-page = "Shift+Page_Up Shift+KP_Page_Up";
|
||||
# scrollback-up-half-page = "none";
|
||||
# scrollback-up-line = "none";
|
||||
scrollback-down-page = "Shift+Page_Down Shift+KP_Page_Down";
|
||||
# scrollback-down-half-page = "none";
|
||||
# scrollback-down-line = "none";
|
||||
# scrollback-home = "none";
|
||||
# scrollback-end = "none";
|
||||
};
|
||||
|
||||
url-bindings = {
|
||||
cancel = "Control+g Control+c Control+d Escape";
|
||||
toggle-url-visible = "t";
|
||||
};
|
||||
|
||||
text-bindings = {
|
||||
"\\x03" = "Mod4+c"; # map Super+c -> Control+c
|
||||
};
|
||||
|
||||
mouse-bindings = {
|
||||
scrollback-up-mouse = "BTN_WHEEL_BACK";
|
||||
scrollback-down-mouse = "BTN_WHEEL_FORWARD";
|
||||
font-increase = "Control+BTN_WHEEL_BACK";
|
||||
font-decrease = "Control+BTN_WHEEL_FORWARD";
|
||||
selection-override-modifiers = "Shift";
|
||||
primary-paste = "BTN_MIDDLE";
|
||||
select-begin = "BTN_LEFT";
|
||||
select-begin-block = "Control+BTN_LEFT";
|
||||
select-extend = "BTN_RIGHT";
|
||||
select-extend-character-wise = "Control+BTN_RIGHT";
|
||||
select-word = "BTN_LEFT-2";
|
||||
select-word-whitespace = "Control+BTN_LEFT-2";
|
||||
select-quote = "BTN_LEFT-3";
|
||||
select-row = "BTN_LEFT-4";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
358
homes/modules/wm/hyprland/default.nix
Executable file
358
homes/modules/wm/hyprland/default.nix
Executable file
|
|
@ -0,0 +1,358 @@
|
|||
# NOTE: hyprland must be enabled in BOTH your host config (for running hyprland)
|
||||
# NOTE: and your home-manager config (for managing hyprland's config files)
|
||||
{pkgs, ...}: {
|
||||
home.packages = with pkgs; [
|
||||
playerctl
|
||||
];
|
||||
|
||||
wayland.windowManager.hyprland = {
|
||||
enable = true;
|
||||
package = null;
|
||||
portalPackage = null;
|
||||
|
||||
xwayland.enable = true;
|
||||
|
||||
# systemd= {
|
||||
# enable = true;
|
||||
# # enable autostart of applications
|
||||
# # REF: `man 8 systemd-xdg-autostart-generator`
|
||||
# enableXdgAutostart = true;
|
||||
# };
|
||||
|
||||
settings = {
|
||||
"$MOD" = "SUPER";
|
||||
|
||||
# applications
|
||||
"$editor" = "hx";
|
||||
"$terminal" = "foot";
|
||||
"$menu" = "fuzzel";
|
||||
"$colorpicker" = "hyprpicker | head -c 7 | wl-copy";
|
||||
"$screenshot_region" = "hyprshot -m region --clipboard-only";
|
||||
"$screenshot_window" = "hyprshot -m window --clipboard-only";
|
||||
"$cursorLock" = "~/scripts/bin/hyprland-cursor-lock";
|
||||
|
||||
# startup programs
|
||||
exec-once = [
|
||||
# TODO: make these independent of hyprland, add these to the
|
||||
"mako &"
|
||||
"awww-daemon &"
|
||||
"waybar &"
|
||||
|
||||
# "wl-paste --type text --watch cliphist store"
|
||||
# "wl-paste --type image --watch cliphist store"
|
||||
# "wl-clip-persist --clipboard regular"
|
||||
# "playerctld daemon"
|
||||
];
|
||||
|
||||
# monitor configuration
|
||||
monitor = [
|
||||
"eDP-1, highres@highrr, 0x0, 1.0"
|
||||
];
|
||||
|
||||
# .__. .___ __..___. . . .___ .___. ._. __ __.
|
||||
# [__] [__ (__ | |__| [__ | | / ` (__
|
||||
# | | [___ .__) | | | [___ | _|_ \__. .__)
|
||||
general = {
|
||||
gaps_in = 12; # margin between windows
|
||||
gaps_out = 25; # margin from windows to monitor edge
|
||||
gaps_workspaces = 0; # margin between workspaces (stacks with gaps_out)
|
||||
# float_gaps = 0; # gaps_out but for floating windows
|
||||
|
||||
border_size = 4;
|
||||
|
||||
"col.active_border" = "rgba(33ccffee) rgba(00ff99ee) 45deg";
|
||||
"col.inactive_border" = "rgba(00000000)";
|
||||
|
||||
# Enable resizing windows by clicking and dragging the border
|
||||
resize_on_border = true;
|
||||
|
||||
# REF: https://wiki.hyprland.org/Configuring/Tearing/
|
||||
allow_tearing = false;
|
||||
|
||||
layout = "dwindle";
|
||||
|
||||
snap = {
|
||||
enabled = false;
|
||||
window_gap = 10;
|
||||
monitor_gap = 10;
|
||||
border_overlap = false;
|
||||
# respect_gaps = false;
|
||||
};
|
||||
};
|
||||
|
||||
decoration = {
|
||||
rounding = 20;
|
||||
rounding_power = 4.0; # Lp norm
|
||||
border_part_of_window = true; # consider border as part of its window
|
||||
# screen_shader = ...; # path to custom GLSL fragment shader
|
||||
|
||||
# window Transparency
|
||||
active_opacity = 1.0;
|
||||
inactive_opacity = 0.95;
|
||||
fullscreen_opacity = 1.0; # fullscreened windows
|
||||
# inactive Window Dimming
|
||||
dim_inactive = false;
|
||||
dim_strength = 0.5;
|
||||
dim_special = 0.2;
|
||||
dim_around = 0.4;
|
||||
|
||||
blur = {
|
||||
enabled = true;
|
||||
new_optimizations = true;
|
||||
xray = false; # floating windows xray through tiling windows
|
||||
ignore_opacity = true;
|
||||
|
||||
# blur Parameters
|
||||
size = 8;
|
||||
passes = 1;
|
||||
noise = 0.0117; # default
|
||||
contrast = 0.8916; # default
|
||||
brightness = 0.8172; # default
|
||||
vibrancy = 0.1696; # default
|
||||
vibrancy_darkness = 0.0; # default
|
||||
|
||||
# blurring For Specific Window Types
|
||||
special = false; # blur special windows
|
||||
popups = false; # blur popups
|
||||
popups_ignorealpha = 0.2;
|
||||
input_methods = false;
|
||||
input_methods_ignorealpha = 0.2;
|
||||
};
|
||||
|
||||
shadow = {
|
||||
enabled = true;
|
||||
ignore_window = true; # only render at edges (not behind)
|
||||
|
||||
range = 3;
|
||||
render_power = 1; # falloff rate
|
||||
sharp = false; # aka infinite shadow.render_power
|
||||
offset = "0 0"; # vec2
|
||||
scale = 1.0;
|
||||
|
||||
color = "rgba(00000000)";
|
||||
color_inactive = "rgba(000000ff)"; # defaults to shadow.color if unset
|
||||
};
|
||||
};
|
||||
|
||||
# REF: https://cubic-bezier.com
|
||||
bezier = [
|
||||
"easeOutQuint,0.23,1,0.32,1"
|
||||
"easeInOutCubic,0.65,0.05,0.36,1"
|
||||
"linear,0,0,1,1"
|
||||
"almostLinear,0.5,0.5,0.75,1.0"
|
||||
"quick,0.15,0,0.1,1"
|
||||
];
|
||||
|
||||
# REF: https://wiki.hyprland.org/Configuring/Animations
|
||||
# Animation Declaration Format:
|
||||
# "animation = NAME, ENABLE, SPEED, BEZIER [,STYLE]"
|
||||
# NOTE: SPEED is in ds (where 1ds = 100ms)
|
||||
animations = [
|
||||
"global, 1, 10, default"
|
||||
"border, 1, 5.39, easeOutQuint"
|
||||
|
||||
"windowsIn, 1, 4, linear, slide bottom"
|
||||
"windowsOut, 1, 10, linear, popin"
|
||||
|
||||
"fadeIn, 1, 1.73, almostLinear"
|
||||
"fadeOut, 1, 1.46, almostLinear"
|
||||
"fade, 1, 3.03, quick"
|
||||
|
||||
"layers, 1, 3.81, easeOutQuint"
|
||||
"layersIn, 1, 4, easeOutQuint, fade"
|
||||
"layersOut, 1, 1.5, linear, fade"
|
||||
|
||||
"fadeLayersIn, 1, 1.79, almostLinear"
|
||||
"fadeLayersOut, 1, 1.39, almostLinear"
|
||||
|
||||
"workspaces, 1, 1.94, almostLinear, fade"
|
||||
"workspacesIn, 1, 1.21, almostLinear, fade"
|
||||
"workspacesOut, 1, 1.94, almostLinear, fade"
|
||||
];
|
||||
|
||||
# REF: https://wiki.hyprland.org/Configuring/Dwindle-Layout
|
||||
dwindle = {
|
||||
# master switch for pseudotiling. enabling is bound to MOD + P in the keybinds section below
|
||||
pseudotile = true;
|
||||
preserve_split = true; # You probably want this
|
||||
};
|
||||
|
||||
# REF: https://wiki.hyprland.org/Configuring/Master-Layout
|
||||
master = {
|
||||
new_status = "master";
|
||||
};
|
||||
|
||||
misc = {
|
||||
#force_default_wallpaper = -1; # Set to 0 or 1 to disable the anime mascot wallpapers
|
||||
disable_hyprland_logo = true;
|
||||
disable_splash_rendering = true;
|
||||
|
||||
enable_anr_dialog = false;
|
||||
font_family = "Geist Mono";
|
||||
};
|
||||
|
||||
input = {
|
||||
# kb_layout = "us";
|
||||
# kb_variant =
|
||||
# kb_model =
|
||||
# kb_options =
|
||||
# kb_rules =
|
||||
|
||||
follow_mouse = 1;
|
||||
|
||||
sensitivity = 0; # -1.0 - 1.0, 0 means no modification
|
||||
accel_profile = "flat";
|
||||
force_no_accel = false; # not recommended to turn on
|
||||
|
||||
repeat_rate = 50;
|
||||
repeat_delay = 300;
|
||||
|
||||
touchpad = {
|
||||
natural_scroll = true;
|
||||
};
|
||||
};
|
||||
|
||||
cursor.no_hardware_cursors = true;
|
||||
|
||||
# standard keypress bindings
|
||||
bind = [
|
||||
# terminal commands
|
||||
"$MOD, RETURN, exec, $terminal"
|
||||
|
||||
# btop
|
||||
"$MOD, P, exec, bash -c \"{ hyprctl clients | rg '^\w*title: btop' &>/dev/null; } && hyprctl dispatch closewindow title:btop || $terminal -T btop btop & disown\""
|
||||
|
||||
"$MOD, R, exec, $menu"
|
||||
|
||||
# lock mouse to window (mostly, for gaming)
|
||||
"$MOD, F1, exec, pkill hyprland-cursor || $cursorLock"
|
||||
"$MOD, F2, exec, $colorpicker"
|
||||
|
||||
# screenshots
|
||||
"$MOD, S, exec, $screenshot_region"
|
||||
"$MOD SHIFT, S, exec, $screenshot_window"
|
||||
|
||||
"$MOD, F, fullscreen"
|
||||
"$MOD SHIFT, F, fullscreenstate, 0 3" # fakefullscreen
|
||||
"$MOD, C, killactive"
|
||||
"$MOD SHIFT, Delete, exit"
|
||||
|
||||
# switch window
|
||||
"$MOD, left, movefocus, l"
|
||||
"$MOD, right, movefocus, r"
|
||||
"$MOD, up, movefocus, u"
|
||||
"$MOD, down, movefocus, d"
|
||||
"$MOD, H, movefocus, l"
|
||||
"$MOD, J, movefocus, d"
|
||||
"$MOD, K, movefocus, u"
|
||||
"$MOD, L, movefocus, r"
|
||||
|
||||
# switch workspaces
|
||||
"$MOD, 1, workspace, 1"
|
||||
"$MOD, 2, workspace, 2"
|
||||
"$MOD, 3, workspace, 3"
|
||||
"$MOD, 4, workspace, 4"
|
||||
"$MOD, 5, workspace, 5"
|
||||
"$MOD, 6, workspace, 6"
|
||||
"$MOD, 7, workspace, 7"
|
||||
"$MOD, 8, workspace, 8"
|
||||
"$MOD, 9, workspace, 9"
|
||||
"$MOD, 0, workspace, 10"
|
||||
"$MOD SHIFT, left, workspace, e-1"
|
||||
"$MOD SHIFT, right, workspace, e+1"
|
||||
|
||||
# move window to workspace
|
||||
"$MOD SHIFT, 1, movetoworkspace, 1"
|
||||
"$MOD SHIFT, 2, movetoworkspace, 2"
|
||||
"$MOD SHIFT, 3, movetoworkspace, 3"
|
||||
"$MOD SHIFT, 4, movetoworkspace, 4"
|
||||
"$MOD SHIFT, 5, movetoworkspace, 5"
|
||||
"$MOD SHIFT, 6, movetoworkspace, 6"
|
||||
"$MOD SHIFT, 7, movetoworkspace, 7"
|
||||
"$MOD SHIFT, 8, movetoworkspace, 8"
|
||||
"$MOD SHIFT, 9, movetoworkspace, 9"
|
||||
"$MOD SHIFT, 0, movetoworkspace, 10"
|
||||
|
||||
# move workspace to monitor
|
||||
"$MOD TAB, 1, movecurrentworkspacetomonitor, DP-2"
|
||||
"$MOD TAB, 2, movecurrentworkspacetomonitor, HDMA-A-1"
|
||||
];
|
||||
|
||||
# bindings for mouse
|
||||
bindm = [
|
||||
"$MOD, mouse:272, movewindow"
|
||||
"$MOD, mouse:273, resizewindow"
|
||||
];
|
||||
|
||||
# bindings that work even while screen is locked
|
||||
bindl = [
|
||||
# WARNING: requires `pkgs.playerctl`
|
||||
", XF86AudioNext, exec, playerctl next"
|
||||
", XF86AudioPause, exec, playerctl play-pause"
|
||||
", XF86AudioPlay, exec, playerctl play-pause"
|
||||
", XF86AudioPrev, exec, playerctl previous"
|
||||
];
|
||||
|
||||
# bindings that work even while screen is locked
|
||||
# and also repeat when the key is held
|
||||
bindel = [
|
||||
",XF86AudioRaiseVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+"
|
||||
",XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"
|
||||
",XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"
|
||||
",XF86AudioMicMute, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle"
|
||||
",XF86MonBrightnessUp, exec, brightnessctl s 10%+"
|
||||
",XF86MonBrightnessDown, exec, brightnessctl s 10%-"
|
||||
];
|
||||
|
||||
windowrule = [
|
||||
# btop process manager
|
||||
{
|
||||
name = "terminal-manager";
|
||||
"match:class" = "^(foot)$";
|
||||
"match:title" = "^(btop)$";
|
||||
float = true;
|
||||
center = true;
|
||||
size = "(monitor_w*0.65) (monitor_h*0.65)";
|
||||
}
|
||||
|
||||
# ignore maximize requests from apps
|
||||
{
|
||||
name = "suppress-maximize";
|
||||
suppress_event = "maximize";
|
||||
"match:class" = ".*";
|
||||
}
|
||||
|
||||
# fix some dragging issues with XWayland
|
||||
{
|
||||
name = "no-focus";
|
||||
no_focus = "on";
|
||||
"match:class" = "^$";
|
||||
"match:title" = "^$";
|
||||
"match:xwayland" = true;
|
||||
"match:float" = true;
|
||||
"match:fullscreen" = false;
|
||||
"match:pin" = false;
|
||||
}
|
||||
|
||||
# TODO: style fakefullscreen windows to clearly indicate their difference
|
||||
# {
|
||||
# name = "fake-fullscreen";
|
||||
# }
|
||||
];
|
||||
|
||||
# █▀▀ █▄░█ █░█ █░█ ▄▀█ █▀█
|
||||
# ██▄ █░▀█ ▀▄▀ ▀▄▀ █▀█ █▀▄
|
||||
env = [
|
||||
"XCURSOR_THEME,Bibata-Modern-Ice"
|
||||
"XCURSOR_SIZE,16"
|
||||
"HYPRCURSOR_THEME,Bibata-Modern-Ice"
|
||||
"HYPRCURSOR_SIZE,16"
|
||||
|
||||
"QT_QPA_PLATFORM,wayland"
|
||||
"QT_QPA_PLATFORMTHEME,xdgdesktopportal" # makes portals work correctly
|
||||
"XDG_MENU_PREFIX,arch-"
|
||||
"XDG_CURRENT_DESKTOP,Hyprland"
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
29
homes/modules/wm/hyprland/hypridle.nix
Executable file
29
homes/modules/wm/hyprland/hypridle.nix
Executable file
|
|
@ -0,0 +1,29 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
services.hypridle = {
|
||||
enable = true;
|
||||
settings = {
|
||||
general = {
|
||||
ignore_dbus_inhibit = false;
|
||||
lock_cmd = "pidof hyprlock || ${pkgs.hyprlock}/bin/hyprlock";
|
||||
before_sleep_cmd = "loginctl lock-session";
|
||||
after_sleep_cmd = "hyprctl dispatch dpms on";
|
||||
};
|
||||
|
||||
listener = [
|
||||
{
|
||||
timeout = 600;
|
||||
on-timeout = "pidof hyprlock || ${pkgs.hyprlock}/bin/hyprlock";
|
||||
}
|
||||
|
||||
{
|
||||
timeout = 660;
|
||||
on-timeout = "systemctl suspend";
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
115
homes/modules/wm/hyprland/hyprlock.nix
Executable file
115
homes/modules/wm/hyprland/hyprlock.nix
Executable file
|
|
@ -0,0 +1,115 @@
|
|||
{...}: {
|
||||
programs.hyprlock = {
|
||||
enable = true;
|
||||
settings = {
|
||||
background = {
|
||||
monitor = "";
|
||||
# TODO: ooni pls change this to something of your own
|
||||
# path = "$HOME/downloads/wallpaper/kill-my-firstborn/astronaut-pink-blue.png";
|
||||
# color = $color1
|
||||
|
||||
# all these options are taken from hyprland, see https://wiki.hyprland.org/Configuring/Variables/#blur for explanations
|
||||
blur_size = 4;
|
||||
blur_passes = 3; # 0 disables blurring
|
||||
noise = 0.0117;
|
||||
contrast = 1.3000; # Vibrant!!!
|
||||
brightness = 0.8000;
|
||||
vibrancy = 0.2100;
|
||||
vibrancy_darkness = 0.0;
|
||||
};
|
||||
label = [
|
||||
{
|
||||
# Hours
|
||||
monitor = "";
|
||||
text = ''cmd[update:1000] echo "<b><big> $(date +"%H") </big></b>"'';
|
||||
color = "rgb(255, 255, 255, 1)";
|
||||
font_size = 112;
|
||||
font_family = "Geist Mono 10";
|
||||
shadow_passes = 3;
|
||||
shadow_size = 4;
|
||||
|
||||
position = "0, 240";
|
||||
halign = "center";
|
||||
valign = "center";
|
||||
}
|
||||
|
||||
{
|
||||
# Minutes
|
||||
monitor = "";
|
||||
text = ''cmd[update:1000] echo "<b><big> $(date +"%M") </big></b>"'';
|
||||
color = "rgb(255, 255, 255, 1)";
|
||||
font_size = 112;
|
||||
font_family = "Geist Mono 10";
|
||||
shadow_passes = 3;
|
||||
shadow_size = 4;
|
||||
|
||||
position = "0, 120";
|
||||
halign = "center";
|
||||
valign = "center";
|
||||
}
|
||||
|
||||
# Today
|
||||
{
|
||||
monitor = "";
|
||||
text = ''cmd[update:18000000] echo "<b><big> "$(date +'%A')" </big></b>"'';
|
||||
color = "rgb(255, 255, 255, 1)";
|
||||
font_size = 22;
|
||||
font_family = "JetBrainsMono Nerd Font 10";
|
||||
|
||||
position = "0, 30";
|
||||
halign = "center";
|
||||
valign = "center";
|
||||
}
|
||||
|
||||
# Week
|
||||
{
|
||||
monitor = "";
|
||||
text = ''cmd[update:18000000] echo "<b> "$(date +'%d %b')" </b>"'';
|
||||
color = "rgb(255, 255, 255, 1)";
|
||||
font_size = 18;
|
||||
font_family = "JetBrainsMono Nerd Font 10";
|
||||
|
||||
position = "0, 6";
|
||||
halign = "center";
|
||||
valign = "center";
|
||||
}
|
||||
|
||||
{
|
||||
# Degrees
|
||||
monitor = "";
|
||||
# get temperature in Brisbane
|
||||
text = ''cmd[update:18000000] echo "<b>Feels like $(curl -s 'wttr.in/bne?format=%t' | tr -d '+')</b>"'';
|
||||
color = "rgb(255, 255, 255, 1)";
|
||||
font_size = 18;
|
||||
font_family = "Geist Mono 10";
|
||||
|
||||
position = "0, 40";
|
||||
halign = "center";
|
||||
valign = "bottom";
|
||||
}
|
||||
];
|
||||
|
||||
input-field = {
|
||||
monitor = "";
|
||||
size = "300, 50";
|
||||
outline_thickness = 3;
|
||||
|
||||
dots_size = 0.26; # Scale of input-field height, 0.2 - 0.8
|
||||
dots_spacing = 0.64; # Scale of dots' absolute size, 0.0 - 1.0
|
||||
dots_center = true;
|
||||
dots_rouding = -1;
|
||||
|
||||
rounding = 22;
|
||||
outer_color = "rgb(0, 0, 0, 0)";
|
||||
inner_color = "rgb(100, 114, 125, 0.1)";
|
||||
font_color = "rgb(200, 200, 200)";
|
||||
fade_on_empty = true;
|
||||
placeholder_text = "<i>Password...</i>"; # Text rendered in the input box when it's empty.
|
||||
|
||||
position = "0, 120";
|
||||
halign = "center";
|
||||
valign = "bottom";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue