Initial commit

This commit is contained in:
2025-11-28 01:41:57 +01:00
commit 0be86c7284
113 changed files with 8498 additions and 0 deletions

View File

@@ -0,0 +1,12 @@
# Alacritty is a fast, cross-platform, OpenGL terminal emulator.
{
programs.alacritty = {
enable = true;
settings = {
window.padding = {
x = 10;
y = 10;
};
};
};
}

View File

@@ -0,0 +1,11 @@
{ pkgs, ... }:
{
programs.rbw = {
enable = true;
settings = {
base_url = "https://vault.jelles.net";
email = "mail@jelles.net";
pinentry = pkgs.pinentry-gnome3;
};
};
}

View File

@@ -0,0 +1,7 @@
{
programs.direnv = {
enable = true;
enableZshIntegration = true;
nix-direnv.enable = true;
};
}

View File

@@ -0,0 +1,7 @@
# Discord is a popular chat application.
{ inputs, ... }:
{
programs.discord = {
enable = true;
};
}

View File

@@ -0,0 +1,2 @@
# Import all fetch scripts
{imports = [./neofetch ./nerdfetch];}

View File

@@ -0,0 +1,148 @@
# Legacy
{pkgs, ...}: {
home.packages = with pkgs; [neofetch];
xdg.configFile."neofetch/ascii.txt".text = ''
''${c6}
'';
xdg.configFile."neofetch/config.conf".text = ''
# From: https://github.com/Chick2D/neofetch-themes/
# Made by https://github.com/Dan1jel
print_info() {
prin "\n"
info "\n \n OS" distro
info "\n \n Host" model
info "\n \n Kernel" kernel
info "\n \n Uptime" uptime
info "\n \n Packages" packages
info "\n \n Shell" shell
info "\n \n Resolution" resolution
info "\n \n DE" de
info "\n \n WM" wm
info "\n \n WM Theme" wm_theme
info "\n \n Theme" theme
info "\n \n Icons" icons
info "\n \n Terminal" term
info "\n \n Terminal Font" term_font
info "\n \n CPU" cpu
info "\n \n GPU" gpu
info "\n \n Memory" memory
info "\n \n Disk" disk
info "\n \n Battery" battery
info "\n \n Font" font
info "\n \n Song" song
[[ "$player" ]] && prin "\n \n Music Player" "$player"
info "\n \n Local IP" local_ip
prin "\n"
# prin "\n \n ''${cl0}''${cl1}''${cl2}''${cl3}''${cl4}''${cl5}''${cl6}''${cl7}"
prin "\n \n \n \n \n \n ''${cl0} \n \n ''${cl1} \n \n ''${cl2} \n \n ''${cl3} \n \n ''${cl4} \n \n ''${cl5} \n \n ''${cl6} \n \n ''${cl7}"
}
reset="\033[0m"
gray="\033[1;90m"
red="\033[1;31m"
green="\033[1;32m"
yellow="\033[1;33m"
blue="\033[1;34m"
magenta="\033[1;35m"
cyan="\033[1;36m"
white="\033[1;37m"
cl0="''${gray}"
cl1="''${red}"
cl2="''${green}"
cl3="''${yellow}"
cl4="''${blue}"
cl5="''${magenta}"
cl6="''${cyan}"
cl7="''${white}"
title_fqdn="off"
kernel_shorthand="on"
distro_shorthand="off"
os_arch="off"
uptime_shorthand="on"
memory_percent="off"
memory_unit="mib"
package_managers="on"
shell_path="off"
shell_version="on"
speed_type="bios_limit"
speed_shorthand="off"
cpu_brand="on"
cpu_speed="on"
cpu_cores="logical"
cpu_temp="off"
gpu_brand="on"
gpu_type="all"
refresh_rate="off"
gtk_shorthand="off"
gtk2="on"
gtk3="on"
de_version="on"
disk_show=('/storage/emulated' '/' '/server')
disk_subtitle="none"
disk_percent="on"
music_player="auto"
song_format="%artist% - %album% - %title%"
song_shorthand="off"
mpc_args=()
bold="on"
underline_enabled="on"
underline_char="-"
separator=":"
block_range=(0 15)
color_blocks="on"
block_width=3
block_height=1
col_offset="auto"
bar_char_elapsed="-"
bar_char_total="="
bar_border="on"
bar_length=15
bar_color_elapsed="distro"
bar_color_total="distro"
cpu_display="off"
memory_display="off"
battery_display="off"
disk_display="off"
image_backend="ascii"
image_source="$HOME/.config/neofetch/ascii.txt"
ascii_distro="auto"
ascii_colors=(distro)
ascii_bold="on"
image_loop="off"
thumbnail_dir="''${XDG_CACHE_HOME:-''${HOME}/.cache}/thumbnails/neofetch"
crop_mode="normal"
crop_offset="center"
image_size="auto"
gap=2
yoffset=0
xoffset=0
background_color=
stdout="off"
'';
}

View File

@@ -0,0 +1,367 @@
# Nerdfetch, a simple system info script written in bash
# Source: https://github.com/ThatOneCalculator/NerdFetch
{pkgs, ...}: let
nerdfetch = pkgs.writeShellScriptBin "nerdfetch" ''
ostype="$(uname)"
version=8.1.1
font=nerd
distrotype=none
osi=""
ki=""
ri="󰍛"
pi="󰏔"
ui="󰅶"
ci=""
case $1 in
"-p")
font=phosphor
osi=""
ki=""
ri=""
pi=""
ui=""
ci=""
;;
"-c")
font=cozette
ki=""
ri=""
pi=""
ui=""
ci=""
;;
"-e")
font=emoji
osi="🐧"
ki="💓"
ri="🐐"
pi="📦"
ui=""
ci="🎨"
;;
"-v")
echo "NerdFetch $version"
exit
;;
"-h")
echo "Flags:
-c: Cozette font
-p: Phosphor font
-e: Emoji font
-v: Version"
exit
;;
esac
if command -v getprop 1>/dev/null; then
distrotype=android
fi
kernel="$(echo $(uname -r) | cut -d'-' -f1-1)"
case $ostype in
*"Linux"*)
if [ $distrotype = android ]; then
host="$(hostname)"
USER="$(whoami)"
os="Android $(getprop ro.build.version.release)"
case $font in
phosphor) osi="" ;;
emoji) osi="🤖" ;;
*) osi="󰀲" ;;
esac
else
host="$(cat /proc/sys/kernel/hostname)"
. /etc/os-release
if [ -f /bedrock/etc/bedrock-release ]; then
os="$(brl version)"
else
os="''${PRETTY_NAME}"
if [ $font = nerd ]; then
case $(echo $ID | sed 's/ .*//') in
debian) osi="" ;;
arch) osi="󰣇" ;;
endeavouros) osi="" ;;
fedora) osi="" ;;
gentoo) osi="" ;;
rhel) osi="" ;;
slackware) osi="" ;;
void) osi="" ;;
alpine) osi="" ;;
nixos) osi="󱄅" ;;
artix) osi="" ;;
exherbo) osi="󰆚" ;;
mageia) osi="" ;;
manjaro) osi="" ;;
opensuse) osi="" ;;
solus) osi="" ;;
ubuntu) osi="" ;;
mint) osi="󰣭" ;;
trisquel) osi="" ;;
puppy) osi="" ;;
coreos) osi="" ;;
mx) osi="" ;;
vanilla) osi="" ;;
pop_os) osi="" ;;
raspbian) osi="" ;;
deepin) osi="" ;;
almalinux) osi="" ;;
garuda) osi="" ;;
centos) osi="" ;;
rocky) osi="" ;;
esac
elif [ $font = cozette ]; then
case $(echo $ID | sed 's/ .*//') in
debian) osi="" ;;
arch) osi="" ;;
fedora) osi="" ;;
gentoo) osi="" ;;
slackware) osi="" ;;
void) osi="" ;;
alpine) osi="" ;;
nixos) osi="" ;;
mageia) osi="" ;;
manjaro) osi="" ;;
opensuse) osi="" ;;
ubuntu) osi="" ;;
mint) osi="" ;;
coreos) osi="" ;;
centos) osi="" ;;
esac
fi
fi
fi
shell=$(basename "$SHELL")
;;
*"Darwin"*)
host="$(hostname -f | sed -e 's/^[^.]*\.//')"
mac_product="$(/usr/libexec/PlistBuddy -c "Print:ProductName" /System/Library/CoreServices/SystemVersion.plist)"
mac_version="$(/usr/libexec/PlistBuddy -c "Print:ProductVersion" /System/Library/CoreServices/SystemVersion.plist)"
os="''${mac_product} ''${mac_version}"
case $font in
nerd) osi="" ;;
phosphor) osi="" ;;
cozette) osi="" ;;
emoji) osi="🍎" ;;
esac
;;
*"FreeBSD"*)
host="$(hostname)"
distrotype=bsd
os="FreeBSD $(freebsd-version | sed 's/-.*//')"
case $font in
nerd) osi="" ;;
phosphor) osi="" ;;
cozette) osi="" ;;
emoji) osi="😈" ;;
esac
;;
*"OpenBSD"*)
host="$(hostname)"
distrotype=bsd
os="OpenBSD $(uname -r)"
case $font in
nerd) osi="" ;;
phosphor) osi="" ;;
cozette) osi="" ;;
emoji) osi="🐡" ;;
esac
;;
*"NetBSD"*)
host="$(hostname)"
distrotype=netbsd
os="NetBSD $(uname -r)"
case $font in
nerd) osi="󰉀" ;;
phosphor) osi="" ;;
cozette) osi="" ;;
emoji) osi="🚩" ;;
esac
;;
*)
os="Unix-like"
host="host"
;;
esac
## PACKAGE MANAGER AND PACKAGES DETECTION
MANAGER=$(which nix-env pkg flatpak yum zypper dnf rpm dpkg-query brew port pacman xbps-query emerge cave apk kiss pmm /usr/sbin/slackpkg bulge birb yay paru pacstall cpm pmm eopkg getprop 2>/dev/null)
manager=$(basename "$MANAGER")
if [ $distrotype = netbsd ]; then
manager="pkg_info-netbsd"
fi
case $manager in
cpm) packages="$(cpm C)" ;;
flatpak) packages="$(flatpak list --app | wc -l)" ;;
brew) packages="$(printf '%s\n' "$(brew --cellar)/"* | wc -l)" ;;
port) packages="$(port installed | wc -l)" ;;
dpkg-query) packages="$(dpkg-query -f '${"binary:Package"}\n' -W | wc -l)" ;;
rpm) packages="$(rpm -qa --last | wc -l)" ;;
yum) packages="$(yum list installed | wc -l)" ;;
dnf) packages="$(dnf list installed | wc -l)" ;;
zypper) packages="$(zypper se | wc -l)" ;;
pacman) packages="$(pacman -Q | wc -l)" ;;
yay) packages="$(yay -Q | wc -l)" ;;
paru) packages="$(paru -Q | wc -l)" ;;
pacstall) packages="$(pacstall -L | wc -l)" ;;
kiss) packages="$(kiss list | wc -l)" ;;
emerge) packages="$(qlist -I | wc -l)" ;;
pkg) packages="$(pkg info | wc -l | tr -d ' ')" ;;
cave) packages="$(cave show installed-slots | wc -l)" ;;
xbps-query) packages="$(xbps-query -l | wc -l)" ;;
nix-env) packages="$(nix-store -q --requisites /run/current-system/sw | wc -l)" ;;
apk) packages="$(apk list --installed | wc -l)" ;;
pmm) packages="$(/bedrock/libexec/pmm pacman pmm -Q 2>/dev/null | wc -l)" ;;
eopkg) packages="$(eopkg li | wc -l)" ;;
/usr/sbin/slackpkg) packages="$(ls /var/log/packages | wc -l)" ;;
bulge) packages="$(bulge list | wc -l)" ;;
birb) packages="$(birb --list-installed | wc -l)" ;;
pkg_info)
packages="$(pkg_info -A | wc -l)"
manager="pkg"
;;
pkg_info-netbsd)
packages="$(pkg_info -a | wc -l)"
manager="pkg"
;;
*)
if [ $distrotype = android ]; then
packages="$(dpkg-query -f '${"binary:Package"}\n' -W | wc -l)"
manager="dpkg"
else
packages="$(ls /usr/bin | wc -l)"
manager="bin"
fi
;;
esac
packages="''${packages#"''${packages%%[![:space:]]*}"}"
manager=$(echo $manager | sed "s/-query//; s/\/usr\/.*\///")
## UPTIME DETECTION
if [ $distrotype = android ]; then
uptime="$(echo $(uptime -p) | cut -c 4-)"
elif [ $distrotype = bsd ] || [ $distrotype = netbsd ]; then
uptime="$(uptime | sed -e 's/.* up //; s/, [0-9]* user.*//')"
else
case $ostype in
*"Linux"*)
IFS=. read -r s _ </proc/uptime
;;
*)
s=$(sysctl -n kern.boottime)
s=''${s#*=}
s=''${s%,*}
s=$(($(date +%s) - s))
;;
esac
d="$((s / 60 / 60 / 24))"
h="$((s / 60 / 60 % 24))"
m="$((s / 60 % 60))"
# Plurals
[ "$d" -gt 1 ] && dp=s
[ "$h" -gt 1 ] && hp=s
[ "$m" -gt 1 ] && mp=s
[ "$s" -gt 1 ] && sp=s
# Hide empty fields.
[ "$d" = 0 ] && d=
[ "$h" = 0 ] && h=
[ "$m" = 0 ] && m=
[ "$m" != "" ] && s=
# Make the output of uptime smaller.
[ "$d" ] && uptime="$d day$dp, "
[ "$h" ] && uptime="$uptime$h hour$hp, "
[ "$m" ] && uptime="$uptime$m min$mp"
[ "$s" ] && uptime="$uptime$s sec$sp"
uptime=''${uptime%, }
fi
## RAM DETECTION
case $ostype in
*"Linux"*)
while IFS=':k ' read -r key val _; do
case $key in
MemTotal)
mem_used=$((mem_used + val))
mem_full=$val
;;
Shmem) mem_used=$((mem_used + val)) ;;
MemFree | Buffers | Cached | SReclaimable) mem_used=$((mem_used - val)) ;;
esac
done </proc/meminfo
mem_used=$((mem_used / 1024))
mem_full=$((mem_full / 1024))
;;
*"Darwin"*)
mem_full=$(($(sysctl -n hw.memsize) / 1024 / 1024))
while IFS=:. read -r key val; do
case $key in
*' wired'* | *' active'* | *' occupied'*)
mem_used=$((mem_used + ${"val:-0"}))
;;
esac
done <-EOF
$(vm_stat)
EOF
mem_used=$((mem_used * 4 / 1024))
;;
*"BSD"*)
mem_full=$(($(sysctl -n hw.physmem) / 1024 / 1024))
if [ $distrotype = netbsd ]; then
mem_free=$(($(vmstat | awk 'NR==3 {print $4}') / 1024))
else
mem_free=$(($(sysctl -n vm.stats.vm.v_free_count) * $(sysctl -n vm.stats.vm.v_page_size) / 1024 / 1024))
fi
mem_used=$((mem_full - mem_free))
;;
*)
mem_full=1
mem_used=0
;;
esac
memstat="''${mem_used}/''${mem_full} MiB"
if which expr >/dev/null 2>&1; then
mempercent="($(expr $(expr ''${mem_used} \* 100 / ''${mem_full}))%)"
fi
## DEFINE COLORS
bold=''
black=''
red=''
green=''
yellow=''
blue=''
magenta=''
cyan=''
white=''
grey=''
reset=''
## USER VARIABLES -- YOU CAN CHANGE THESE
lc="$reset$bold$magenta" # labels
nc="$reset$bold$magenta" # labels
hn="$reset$bold$magenta" # labels
ic="$reset$white" # info
c0="$reset$grey" # first color
c1="$reset$white" # second color
c2="$reset$yellow" # third color
## OUTPUT
echo """
''${c0} ___ ''${nc}''${USER}''${grey}@''${reset}''${hn}''${host}''${reset}
''${c0} (''${c1}.. ''${c0}\ ''${lc}''${osi} ''${ic}''${os}''${reset}
''${c0} (''${c2}<> ''${c0}| ''${lc}''${ki} ''${ic}''${kernel}''${reset}
''${c0} /''${c1}/ \\ ''${c0}\\ ''${lc}''${ri} ''${ic}''${RAM}''${memstat} ''${mempercent}
''${c0} ( ''${c1}| | ''${c0}/| ''${lc}''${pi} ''${ic}''${packages} (''${manager})''${reset}
''${c2} _''${c0}/\\ ''${c1}__)''${c0}/''${c2}_''${c0}) ''${lc}''${ui} ''${ic}''${uptime}''${reset}
''${c2} \/''${c0}-____''${c2}\/''${reset} ''${lc}''${ci} ''${red}''${green}''${yellow}''${blue}''${magenta}''${cyan}''${reset}
"""
'';
in {home.packages = [nerdfetch];}

View File

@@ -0,0 +1,23 @@
{
programs.ghostty = {
enable = true;
installVimSyntax = true;
enableZshIntegration = true;
settings = {
font-feature = "-calt, -liga, -dlig";
window-padding-x = 10;
window-padding-y = 10;
keybind = [
"ctrl+j=goto_split:left"
"ctrl+i=goto_split:up"
"ctrl+k=goto_split:down"
"ctrl+l=goto_split:right"
"shift+ctrl+j=new_split:left"
"shift+ctrl+i=new_split:up"
"shift+ctrl+k=new_split:down"
"shift+ctrl+l=new_split:right"
"shift+ctrl+tab=new_tab"
];
};
};
}

View File

@@ -0,0 +1,55 @@
# Git configuration
{config, ...}: let
username = config.var.git.username;
email = config.var.git.email;
in {
programs.git = {
enable = true;
ignores = [
".cache/"
".DS_Store"
".idea/"
"*.swp"
"*.elc"
"auto-save-list"
".direnv/"
"node_modules"
"result"
"result-*"
];
settings = {
user.name = username;
user.email = email;
init.defaultBranch = "main";
pull.rebase = "false";
push.autoSetupRemote = true;
color.ui = "1";
alias = {
essa = "push --force";
co = "checkout";
fuck = "commit --amend -m";
c = "commit -m";
ca = "commit -am";
forgor = "commit --amend --no-edit";
graph = "log --all --decorate --graph --oneline";
oops = "checkout --";
l = "log";
r = "rebase";
s = "status --short";
ss = "status";
d = "diff";
ps = "!git push origin $(git rev-parse --abbrev-ref HEAD)";
pl = "!git pull origin $(git rev-parse --abbrev-ref HEAD)";
af = "!git add $(git ls-files -m -o --exclude-standard | sk -m)";
st = "status";
br = "branch";
df = "!git hist | peco | awk '{print $2}' | xargs -I {} git diff {}^ {}";
hist = ''
log --pretty=format:"%Cgreen%h %Creset%cd %Cblue[%cn] %Creset%s%C(yellow)%d%C(reset)" --graph --date=relative --decorate --all'';
llog = ''
log --graph --name-status --pretty=format:"%C(red)%h %C(reset)(%cd) %C(green)%an %Creset%s %C(yellow)%d%Creset" --date=relative'';
edit-unmerged = "!f() { git ls-files --unmerged | cut -f2 | sort -u ; }; hx `f`";
};
};
};
}

View File

@@ -0,0 +1,12 @@
# This file is used to sign git commits using an SSH key.
{
# Obviously, change this to your own SSH key.
home.file.".ssh/allowed_signers".text = "* ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIINhWby7lUUXQNKbRu9/UOrGjWDf3fvoAwGHomWv/+lL";
programs.git.settings = {
commit.gpgsign = true;
gpg.ssh.allowedSignersFile = "~/.ssh/allowed_signers";
gpg.format = "ssh";
user.signingkey = "~/.ssh/key.pub";
};
}

View File

@@ -0,0 +1,20 @@
{
config,
pkgs,
...
}: {
programs.gpg = {
enable = true;
homedir = "${config.xdg.dataHome}/gnupg";
};
services.gpg-agent = {
enable = true;
enableSshSupport = true;
enableZshIntegration = true;
pinentry = {
package = pkgs.pinentry-gnome3;
};
sshKeys = ["CD848796822630B280FC6DFA55F24A20040F22B5"];
};
}

View File

@@ -0,0 +1,89 @@
# Kitty is a fast, featureful, GPU based terminal emulator
{
programs.kitty = {
enable = true;
keybindings = {
"ctrl+shift+tab" = "new_tab_with_cwd";
"ctrl+shift+enter" = "new_window_with_cwd";
"ctrl+j" = ''kitten pass_keys.py bottom ctrl+j'';
"ctrl+k" = ''kitten pass_keys.py top ctrl+k'';
"ctrl+h" = ''kitten pass_keys.py left ctrl+h'';
"ctrl+l" = ''kitten pass_keys.py right ctrl+l'';
};
settings = {
scrollback_lines = 10000;
initial_window_width = 1200;
initial_window_height = 600;
update_check_interval = 0;
enable_audio_bell = false;
confirm_os_window_close = "0";
remember_window_size = "no";
disable_ligatures = "always";
url_style = "curly";
copy_on_select = "clipboard";
cursor_shape = "Underline";
cursor_underline_thickness = 3;
window_padding_width = 10;
open_url_with = "default";
allow_remote_control = "yes";
listen_on = "unix:/tmp/mykitty";
};
};
xdg.configFile = {
"kitty/pass_keys.py".text = ''
import re
from kittens.tui.handler import result_handler
from kitty.key_encoding import KeyEvent, parse_shortcut
def is_window_vim(window, vim_id):
fp = window.child.foreground_processes
return any(re.search(vim_id, p['cmdline'][0] if len(p['cmdline']) else "", re.I) for p in fp)
def encode_key_mapping(window, key_mapping):
mods, key = parse_shortcut(key_mapping)
event = KeyEvent(
mods=mods,
key=key,
shift=bool(mods & 1),
alt=bool(mods & 2),
ctrl=bool(mods & 4),
super=bool(mods & 8),
hyper=bool(mods & 16),
meta=bool(mods & 32),
).as_window_system_event()
return window.encoded_key(event)
def main():
pass
@result_handler(no_ui=True)
def handle_result(args, result, target_window_id, boss):
direction = args[1]
key_mapping = args[2]
vim_id = args[3] if len(args) > 3 else "n?vim"
window = boss.window_id_map.get(target_window_id)
if window is None:
return
if is_window_vim(window, vim_id):
for keymap in key_mapping.split(">"):
encoded = encode_key_mapping(window, keymap)
window.write_to_child(encoded)
else:
boss.active_tab.neighboring_window(direction)
'';
"kitty/neighboring_window.py".text = ''
def main():
pass
def handle_result(args, result, target_window_id, boss):
return boss.active_tab.current_layout.name
handle_result.no_ui = True
'';
};
}

View File

@@ -0,0 +1,35 @@
# Lazygit is a simple terminal UI for git commands.
{
config,
lib,
...
}: let
accent = "#${config.lib.stylix.colors.base0D}";
muted = "#${config.lib.stylix.colors.base03}";
in {
programs.lazygit = {
enable = true;
settings = lib.mkForce {
disableStartupPopups = true;
notARepository = "skip";
promptToReturnFromSubprocess = false;
update.method = "never";
git = {
commit.signOff = true;
overrideGpg = true;
parseEmoji = true;
};
gui = {
theme = {
activeBorderColor = [accent "bold"];
inactiveBorderColor = [muted];
};
showListFooter = false;
showRandomTip = false;
showCommandLog = false;
showBottomLine = false;
nerdFontsVersion = "3";
};
};
};
}

View File

@@ -0,0 +1,2 @@
indent_type = "Spaces"
indent_width = 2

View File

@@ -0,0 +1,155 @@
{ inputs, config, ... }:
let
inherit (inputs.nixCats) utils;
luaPath = ./.;
categoryDefinitions =
{ pkgs, ... }:
{
# to define and use a new category, simply add a new list to a set here,
# and later, you will include categoryname = true; in the set you
# provide when you build the package using this builder function.
# see :help nixCats.flake.outputs.packageDefinitions for info on that section.
# lspsAndRuntimeDeps:
# this section is for dependencies that should be available
# at RUN TIME for plugins. Will be available to PATH within neovim terminal
# this includes LSPs
lspsAndRuntimeDeps = {
general = with pkgs; [
universal-ctags
stdenv.cc.cc
ripgrep
fd
stylua
lua-language-server
nixd
nix-doc
nixfmt
dafny
typescript
typescript-language-server
rust-analyzer
rustfmt
markdownlint-cli2
basedpyright
black
isort
];
};
startupPlugins = {
general = with pkgs.vimPlugins; [
lz-n
plenary-nvim
catppuccin-nvim
];
};
optionalPlugins = {
general = with pkgs.vimPlugins; [
nvim-treesitter.withAllGrammars
nvim-treesitter-textobjects
nvim-treesitter-context
trouble-nvim
guess-indent-nvim
gitsigns-nvim
which-key-nvim
telescope-nvim
telescope-fzf-native-nvim
telescope-ui-select-nvim
conform-nvim
blink-cmp
luasnip
friendly-snippets
todo-comments-nvim
mini-nvim
nvim-lspconfig
lazydev-nvim
nvim-autopairs
indent-blankline-nvim
nvim-lint
render-markdown-nvim
colorful-menu-nvim
];
};
sharedLibraries = {
general = with pkgs; [ ];
};
environmentVariables = { };
extraWrapperArgs = { };
python3.libraries = {
test = (_: [ ]);
};
extraLuaPackages = {
general = [ (_: [ ]) ];
};
extraCats = { };
};
packageDefinitions = {
nixCats =
{ pkgs, ... }:
{
settings = {
suffix-path = true;
suffix-LD = true;
aliases = [
"nvim"
"vim"
"vi"
];
wrapRc = true;
configDirName = "nixCats";
hosts.python3.enable = true;
hosts.node.enable = true;
};
categories = {
general = true;
};
extra = {
nixdExtras = {
nixpkgs = ''import ${pkgs.path} {}'';
nixos_options = ''(builtins.getFlake "path:///home/kiri/.config/nixos").nixosConfigurations.${toString config.var.hostname}.options'';
home_manager_options = ''(builtins.getFlake "path:///home/kiri/.config/nixos").nixosConfigurations.${toString config.var.hostname}.options.home-manager.users.type.getSubOptions []'';
};
};
};
};
defaultPackageName = "nixCats";
in
{
imports = [
(utils.mkHomeModules {
inherit
defaultPackageName
luaPath
categoryDefinitions
packageDefinitions
;
inherit (inputs) nixpkgs;
dependencyOverlays = [ (utils.standardPluginOverlay inputs) ];
})
];
nixCats.enable = true;
}

View File

@@ -0,0 +1,5 @@
require("options")
require("plugins.ui")
require("plugins.editor")
require("plugins.coding")
require("plugins.lsp")

View File

@@ -0,0 +1,133 @@
-- Set <space> as the leader key
-- See `:help mapleader`
-- NOTE: Must happen before plugins are loaded (otherwise wrong leader will be used)
vim.g.mapleader = " "
vim.g.maplocalleader = " "
-- [[ Setting options ]]
-- See `:help vim.o`
-- NOTE: You can change these options as you wish!
-- For more options, you can see `:help option-list`
-- Make line numbers default
vim.o.number = true
-- You can also add relative line numbers, to help with jumping.
-- Experiment for yourself to see if you like it!
-- vim.o.relativenumber = true
-- Enable mouse mode, can be useful for resizing splits for example!
vim.o.mouse = "a"
-- Don't show the mode, since it's already in the status line
vim.o.showmode = false
vim.opt.shortmess:append("Wc")
-- Sync clipboard between OS and Neovim.
-- Schedule the setting after `UiEnter` because it can increase startup-time.
-- Remove this option if you want your OS clipboard to remain independent.
-- See `:help 'clipboard'`
vim.schedule(function()
vim.o.clipboard = "unnamedplus"
end)
-- Enable break indent
vim.o.breakindent = true
-- Save undo history
vim.o.undofile = true
-- Case-insensitive searching UNLESS \C or one or more capital letters in the search term
vim.o.ignorecase = true
vim.o.smartcase = true
-- Keep signcolumn on by default
vim.o.signcolumn = "yes"
-- Decrease update time
vim.o.updatetime = 250
-- Decrease mapped sequence wait time
vim.o.timeoutlen = 300
-- Configure how new splits should be opened
vim.o.splitright = true
vim.o.splitbelow = true
-- Sets how neovim will display certain whitespace characters in the editor.
-- See `:help 'list'`
-- and `:help 'listchars'`
--
-- Notice listchars is set using `vim.opt` instead of `vim.o`.
-- It is very similar to `vim.o` but offers an interface for conveniently interacting with tables.
-- See `:help lua-options`
-- and `:help lua-options-guide`
vim.o.list = true
vim.opt.listchars = { tab = "» ", trail = "·", nbsp = "" }
-- Preview substitutions live, as you type!
vim.o.inccommand = "split"
-- Show which line your cursor is on
vim.o.cursorline = true
-- Minimal number of screen lines to keep above and below the cursor.
vim.o.scrolloff = 10
-- if performing an operation that would fail due to unsaved changes in the buffer (like `:q`),
-- instead raise a dialog asking if you wish to save the current file(s)
-- See `:help 'confirm'`
vim.o.confirm = true
-- [[ Basic Keymaps ]]
-- See `:help vim.keymap.set()`
-- Clear highlights on search when pressing <Esc> in normal mode
-- See `:help hlsearch`
vim.keymap.set("n", "<Esc>", "<cmd>nohlsearch<CR>")
-- Diagnostic keymaps
vim.keymap.set("n", "<leader>q", vim.diagnostic.setloclist, { desc = "Open diagnostic [Q]uickfix list" })
-- Exit terminal mode in the builtin terminal with a shortcut that is a bit easier
-- for people to discover. Otherwise, you normally need to press <C-\><C-n>, which
-- is not what someone will guess without a bit more experience.
--
-- NOTE: This won't work in all terminal emulators/tmux/etc. Try your own mapping
-- or just use <C-\><C-n> to exit terminal mode
vim.keymap.set("t", "<Esc><Esc>", "<C-\\><C-n>", { desc = "Exit terminal mode" })
-- TIP: Disable arrow keys in normal mode
-- vim.keymap.set('n', '<left>', '<cmd>echo "Use h to move!!"<CR>')
-- vim.keymap.set('n', '<right>', '<cmd>echo "Use l to move!!"<CR>')
-- vim.keymap.set('n', '<up>', '<cmd>echo "Use k to move!!"<CR>')
-- vim.keymap.set('n', '<down>', '<cmd>echo "Use j to move!!"<CR>')
-- Keybinds to make split navigation easier.
-- Use CTRL+<hjkl> to switch between windows
--
-- See `:help wincmd` for a list of all window commands
vim.keymap.set("n", "<C-h>", "<C-w><C-h>", { desc = "Move focus to the left window" })
vim.keymap.set("n", "<C-l>", "<C-w><C-l>", { desc = "Move focus to the right window" })
vim.keymap.set("n", "<C-j>", "<C-w><C-j>", { desc = "Move focus to the lower window" })
vim.keymap.set("n", "<C-k>", "<C-w><C-k>", { desc = "Move focus to the upper window" })
-- NOTE: Some terminals have colliding keymaps or are not able to send distinct keycodes
-- vim.keymap.set("n", "<C-S-h>", "<C-w>H", { desc = "Move window to the left" })
-- vim.keymap.set("n", "<C-S-l>", "<C-w>L", { desc = "Move window to the right" })
-- vim.keymap.set("n", "<C-S-j>", "<C-w>J", { desc = "Move window to the lower" })
-- vim.keymap.set("n", "<C-S-k>", "<C-w>K", { desc = "Move window to the upper" })
-- [[ Basic Autocommands ]]
-- See `:help lua-guide-autocommands`
-- Highlight when yanking (copying) text
-- Try it with `yap` in normal mode
-- See `:help vim.hl.on_yank()`
vim.api.nvim_create_autocmd("TextYankPost", {
desc = "Highlight when yanking (copying) text",
group = vim.api.nvim_create_augroup("kickstart-highlight-yank", { clear = true }),
callback = function()
vim.hl.on_yank()
end,
})

View File

@@ -0,0 +1,263 @@
require("lz.n").load({
-- {
-- "nvim-treesitter-context",
-- event = "BufReadPost",
-- after = function()
-- require("treesitter-context").setup({
-- enable = true,
-- max_lines = 3, -- How many lines the window should span
-- })
-- end,
-- },
{
"nvim-lint",
event = { "BufReadPre", "BufNewFile" },
after = function()
local lint = require("lint")
lint.linters_by_ft = {
markdown = { "markdownlint-cli2" },
}
-- Create autocommand which carries out the actual linting
-- on the specified events.
local lint_augroup = vim.api.nvim_create_augroup("lint", { clear = true })
vim.api.nvim_create_autocmd({ "BufEnter", "BufWritePost", "InsertLeave" }, {
group = lint_augroup,
callback = function()
-- Only run the linter in buffers that you can modify in order to
-- avoid superfluous noise, notably within the handy LSP pop-ups that
-- describe the hovered symbol using Markdown.
if vim.bo.modifiable then
lint.try_lint()
end
end,
})
end,
},
{
"nvim-autopairs",
event = "InsertEnter",
after = function()
require("nvim-autopairs").setup({
check_ts = true,
})
end,
},
{
"nvim-treesitter",
dep_of = "render-markdown.nvim",
-- cmd = { "" },
event = "DeferredUIEnter",
-- ft = "",
-- keys = "",
-- colorscheme = "",
load = function(name)
vim.cmd.packadd(name)
vim.cmd.packadd("nvim-treesitter-textobjects")
end,
after = function()
-- [[ Configure Treesitter ]]
-- See `:help nvim-treesitter`
require("nvim-treesitter.configs").setup({
highlight = { enable = true },
indent = { enable = true },
incremental_selection = {
enable = true,
keymaps = {
init_selection = "<c-space>",
node_incremental = "<c-space>",
scope_incremental = "<c-s>",
node_decremental = "<M-space>",
},
},
textobjects = {
select = {
enable = true,
lookahead = true, -- Automatically jump forward to textobj, similar to targets.vim
keymaps = {
-- You can use the capture groups defined in textobjects.scm
["aa"] = "@parameter.outer",
["ia"] = "@parameter.inner",
["af"] = "@function.outer",
["if"] = "@function.inner",
["ac"] = "@class.outer",
["ic"] = "@class.inner",
},
},
move = {
enable = true,
set_jumps = true, -- whether to set jumps in the jumplist
goto_next_start = {
["]m"] = "@function.outer",
["]]"] = "@class.outer",
},
goto_next_end = {
["]M"] = "@function.outer",
["]["] = "@class.outer",
},
goto_previous_start = {
["[m"] = "@function.outer",
["[["] = "@class.outer",
},
goto_previous_end = {
["[M"] = "@function.outer",
["[]"] = "@class.outer",
},
},
swap = {
enable = true,
swap_next = {
["<leader>a"] = "@parameter.inner",
},
swap_previous = {
["<leader>A"] = "@parameter.inner",
},
},
},
})
end,
},
{
"conform.nvim",
event = "BufWritePre",
cmd = "ConformInfo",
keys = {
{
"<leader>f",
function()
require("conform").format({ async = true, lsp_format = "fallback" })
end,
mode = "",
desc = "[F]ormat buffer",
},
},
after = function()
require("conform").setup({
notify_on_error = true,
format_on_save = function(bufnr)
-- Disable "format_on_save lsp_fallback" for languages that don't
-- have a well standardized coding style. You can add additional
-- languages here or re-enable it for the disabled ones.
local disable_filetypes = { c = true, cpp = true }
if disable_filetypes[vim.bo[bufnr].filetype] then
return nil
else
return {
timeout_ms = 500,
lsp_format = "fallback",
}
end
end,
formatters_by_ft = {
lua = { "stylua" },
-- Conform can also run multiple formatters sequentially
python = { "isort", "black" },
--
-- You can use 'stop_after_first' to run the first available formatter from the list
-- javascript = { "prettierd", "prettier", stop_after_first = true },
},
})
end,
},
{
"friendly-snippets",
},
{
"luasnip",
before = function()
require("lz.n").trigger_load("friendly-snippets")
end,
after = function()
require("luasnip.loaders.from_vscode").lazy_load()
end,
},
{
"blink.cmp",
before = function()
-- Trigger lazydev so it's ready for blink source
require("lz.n").trigger_load({ "lazydev.nvim", "luasnip" })
end,
event = "VimEnter",
after = function()
require("blink.cmp").setup({
keymap = {
preset = "default",
-- [Up/Down]
["<C-j>"] = { "select_next", "fallback" },
["<C-k>"] = { "select_prev", "fallback" }, -- Overrides Signature Help
-- [Insert Suggestion]
["<C-l>"] = { "select_and_accept", "fallback" },
-- [Remap Signature Help]
-- Since we took <C-k>, let's move signature help to <C-g> (optional)
["<C-g>"] = { "show_signature", "hide_signature", "fallback" },
},
appearance = {
nerd_font_variant = "mono",
},
completion = {
-- By default, you may press `<c-space>` to show the documentation.
-- Optionally, set `auto_show = true` to show the documentation after a delay.
documentation = {
auto_show = true,
auto_show_delay_ms = 500,
window = {
border = "rounded",
},
},
menu = {
border = "rounded",
draw = {
columns = { { "kind_icon" }, { "label", gap = 1 } },
components = {
label = {
text = function(ctx)
return require("colorful-menu").blink_components_text(ctx)
end,
highlight = function(ctx)
return require("colorful-menu").blink_components_highlight(ctx)
end,
},
},
},
},
},
cmdline = {
completion = {
menu = {
auto_show = true,
},
},
keymap = { preset = "inherit" },
},
sources = {
default = {
"lsp",
"path",
"snippets",
"lazydev",
},
providers = {
lazydev = { module = "lazydev.integrations.blink", score_offset = 100 },
},
},
snippets = { preset = "luasnip" },
fuzzy = { implementation = "prefer_rust_with_warning" },
-- Shows a signature help window while you type arguments for a function
signature = {
window = { border = "rounded" },
enabled = true,
},
})
end,
},
})

View File

@@ -0,0 +1,170 @@
require("lz.n").load({
{
"guess-indent.nvim",
event = "BufReadPre",
after = function()
require("guess-indent").setup({})
end,
},
{
"gitsigns.nvim",
event = { "BufReadPre", "BufNewFile" },
after = function()
require("gitsigns").setup({
signs = {
add = { text = "" },
change = { text = "" },
delete = { text = "" },
topdelete = { text = "" },
changedelete = { text = "" },
},
on_attach = function(bufnr)
local gitsigns = require("gitsigns")
local function map(mode, l, r, opts)
opts = opts or {}
opts.buffer = bufnr
vim.keymap.set(mode, l, r, opts)
end
-- Navigation
map("n", "]c", function()
if vim.wo.diff then
vim.cmd.normal({ "]c", bang = true })
else
gitsigns.nav_hunk("next")
end
end, { desc = "Jump to next git [c]hange" })
map("n", "[c", function()
if vim.wo.diff then
vim.cmd.normal({ "[c", bang = true })
else
gitsigns.nav_hunk("prev")
end
end, { desc = "Jump to previous git [c]hange" })
-- Actions
-- visual mode
map("v", "<leader>hs", function()
gitsigns.stage_hunk({ vim.fn.line("."), vim.fn.line("v") })
end, { desc = "git [s]tage hunk" })
map("v", "<leader>hr", function()
gitsigns.reset_hunk({ vim.fn.line("."), vim.fn.line("v") })
end, { desc = "git [r]eset hunk" })
-- normal mode
map("n", "<leader>hs", gitsigns.stage_hunk, { desc = "git [s]tage hunk" })
map("n", "<leader>hr", gitsigns.reset_hunk, { desc = "git [r]eset hunk" })
map("n", "<leader>hS", gitsigns.stage_buffer, { desc = "git [S]tage buffer" })
map("n", "<leader>hu", gitsigns.stage_hunk, { desc = "git [u]ndo stage hunk" })
map("n", "<leader>hR", gitsigns.reset_buffer, { desc = "git [R]eset buffer" })
map("n", "<leader>hp", gitsigns.preview_hunk, { desc = "git [p]review hunk" })
map("n", "<leader>hb", gitsigns.blame_line, { desc = "git [b]lame line" })
map("n", "<leader>hd", gitsigns.diffthis, { desc = "git [d]iff against index" })
map("n", "<leader>hD", function()
gitsigns.diffthis("@")
end, { desc = "git [D]iff against last commit" })
-- Toggles
map("n", "<leader>tb", gitsigns.toggle_current_line_blame, { desc = "[T]oggle git show [b]lame line" })
map("n", "<leader>tD", gitsigns.preview_hunk_inline, { desc = "[T]oggle git show [D]eleted" })
end,
})
end,
},
{
"telescope.nvim",
event = "VimEnter",
after = function()
local actions = require("telescope.actions")
require("telescope").setup({
defaults = {
path_display = { "truncate" },
layout_strategy = "horizontal",
layout_config = {
prompt_position = "top",
},
sorting_strategy = "ascending",
mappings = {
i = {
["<C-k>"] = actions.move_selection_previous, -- Move up with Ctrl-k
["<C-j>"] = actions.move_selection_next, -- Move down with Ctrl-j
["<C-q>"] = actions.send_selected_to_qflist + actions.open_qflist, -- Send to quickfix
},
},
},
extensions = {
["ui-select"] = {
require("telescope.themes").get_dropdown(),
},
},
})
-- Enable Telescope extensions if they are installed
pcall(require("telescope").load_extension, "fzf")
pcall(require("telescope").load_extension, "ui-select")
-- See `:help telescope.builtin`
local builtin = require("telescope.builtin")
vim.keymap.set("n", "<leader>sh", builtin.help_tags, { desc = "[S]earch [H]elp" })
vim.keymap.set("n", "<leader>sk", builtin.keymaps, { desc = "[S]earch [K]eymaps" })
vim.keymap.set("n", "<leader>sf", builtin.find_files, { desc = "[S]earch [F]iles" })
vim.keymap.set("n", "<leader>ss", builtin.builtin, { desc = "[S]earch [S]elect Telescope" })
vim.keymap.set("n", "<leader>sw", builtin.grep_string, { desc = "[S]earch current [W]ord" })
vim.keymap.set("n", "<leader>sg", builtin.live_grep, { desc = "[S]earch by [G]rep" })
vim.keymap.set("n", "<leader>sd", builtin.diagnostics, { desc = "[S]earch [D]iagnostics" })
vim.keymap.set("n", "<leader>sr", builtin.resume, { desc = "[S]earch [R]esume" })
vim.keymap.set("n", "<leader>s.", builtin.oldfiles, { desc = '[S]earch Recent Files ("." for repeat)' })
vim.keymap.set("n", "<leader><leader>", builtin.buffers, { desc = "[ ] Find existing buffers" })
-- Slightly advanced example of overriding default behavior and theme
vim.keymap.set("n", "<leader>/", function()
-- You can pass additional configuration to Telescope to change the theme, layout, etc.
builtin.current_buffer_fuzzy_find(require("telescope.themes").get_dropdown({
winblend = 10,
previewer = false,
}))
end, { desc = "[/] Fuzzily search in current buffer" })
-- It's also possible to pass additional configuration options.
-- See `:help telescope.builtin.live_grep()` for information about particular keys
vim.keymap.set("n", "<leader>s/", function()
builtin.live_grep({
grep_open_files = true,
prompt_title = "Live Grep in Open Files",
})
end, { desc = "[S]earch [/] in Open Files" })
-- Shortcut for searching your Neovim configuration files
vim.keymap.set("n", "<leader>sn", function()
builtin.find_files({ cwd = vim.fn.stdpath("config") })
end, { desc = "[S]earch [N]eovim files" })
end,
},
{
"trouble.nvim",
cmd = "Trouble",
keys = {
{ "<leader>xx", "<cmd>Trouble diagnostics toggle<cr>", desc = "Diagnostics (Trouble)" },
{ "<leader>xX", "<cmd>Trouble diagnostics toggle filter.buf=0<cr>", desc = "Buffer Diagnostics (Trouble)" },
},
after = function()
require("trouble").setup({
focus = true,
})
end,
},
{
"todo-comments.nvim",
event = { "BufReadPre", "BufNewFile" },
keys = {
{ "<leader>st", "<cmd>TodoTelescope<cr>", desc = "[S]earch [T]odos" },
{ "<leader>xt", "<cmd>TodoTrouble<cr>", desc = "Todo (Trouble)" },
},
after = function()
require("todo-comments").setup({
signs = false,
})
end,
},
})

View File

@@ -0,0 +1,166 @@
require("lz.n").load({
{
{
-- lazydev makes your lsp way better in your config without needing extra lsp configuration.
"lazydev.nvim",
cmd = "LazyDev",
ft = "lua",
after = function()
require("lazydev").setup({
library = {
{ words = { "nixCats" }, path = (nixCats.nixCatsPath or "") .. "/lua" },
},
})
end,
},
{
"nvim-lspconfig",
event = { "BufReadPre", "BufNewFile" },
after = function()
vim.api.nvim_create_autocmd("LspAttach", {
group = vim.api.nvim_create_augroup("kickstart-lsp-attach", { clear = true }),
callback = function(args)
-- Get the client and buffer from the event arguments [cite: 119]
local client = vim.lsp.get_client_by_id(args.data.client_id)
local bufnr = args.buf
local map = function(keys, func, desc, mode)
mode = mode or "n"
vim.keymap.set(mode, keys, func, { buffer = bufnr, desc = "LSP: " .. desc })
end
-- Mappings (Standard LSP functions from lsp-defaults) [cite: 20-23]
map("grn", vim.lsp.buf.rename, "[R]e[n]ame")
map("gra", vim.lsp.buf.code_action, "[G]oto Code [A]ction", { "n", "x" })
map("grD", vim.lsp.buf.declaration, "[G]oto [D]eclaration")
-- Telescope Mappings
map("grr", require("telescope.builtin").lsp_references, "[G]oto [R]eferences")
map("gri", require("telescope.builtin").lsp_implementations, "[G]oto [I]mplementation")
map("grd", require("telescope.builtin").lsp_definitions, "[G]oto [D]efinition")
map("gO", require("telescope.builtin").lsp_document_symbols, "Open Document Symbols")
map("gW", require("telescope.builtin").lsp_dynamic_workspace_symbols, "Open Workspace Symbols")
map("grt", require("telescope.builtin").lsp_type_definitions, "[G]oto [T]ype Definition")
-- Highlight references (Document Highlight)
if client and client:supports_method("textDocument/documentHighlight", bufnr) then
local highlight_augroup = vim.api.nvim_create_augroup("kickstart-lsp-highlight", { clear = false })
vim.api.nvim_create_autocmd({ "CursorHold", "CursorHoldI" }, {
buffer = bufnr,
group = highlight_augroup,
callback = vim.lsp.buf.document_highlight,
})
vim.api.nvim_create_autocmd({ "CursorMoved", "CursorMovedI" }, {
buffer = bufnr,
group = highlight_augroup,
callback = vim.lsp.buf.clear_references,
})
vim.api.nvim_create_autocmd("LspDetach", {
group = vim.api.nvim_create_augroup("kickstart-lsp-detach", { clear = true }),
callback = function(event)
vim.lsp.buf.clear_references()
vim.api.nvim_clear_autocmds({ group = "kickstart-lsp-highlight", buffer = event.buf })
end,
})
end
-- Inlay Hints
if client and client:supports_method("textDocument/inlayHint", bufnr) then
map("<leader>th", function()
vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled({ bufnr = bufnr }))
end, "[T]oggle Inlay [H]ints")
end
end,
})
-- 1. Setup Diagnostics (Visuals)
vim.diagnostic.config({
severity_sort = true,
float = { border = "rounded", source = "if_many" },
underline = { severity = vim.diagnostic.severity.ERROR },
signs = {
text = {
[vim.diagnostic.severity.ERROR] = "",
[vim.diagnostic.severity.WARN] = "",
[vim.diagnostic.severity.INFO] = "",
[vim.diagnostic.severity.HINT] = "󰠠 ",
},
},
virtual_text = {
source = "if_many",
spacing = 4,
prefix = "",
format = function(diagnostic)
local diagnostic_message = {
[vim.diagnostic.severity.ERROR] = diagnostic.message,
[vim.diagnostic.severity.WARN] = diagnostic.message,
[vim.diagnostic.severity.INFO] = diagnostic.message,
[vim.diagnostic.severity.HINT] = diagnostic.message,
}
return diagnostic_message[diagnostic.severity]
end,
},
})
vim.lsp.config("lua_ls", {
settings = {
Lua = {
runtime = { version = "LuaJIT" },
signatureHelp = { enabled = true },
diagnostics = { globals = { "nixCats", "vim" } },
telemetry = { enabled = false },
completion = { callSnippet = "Replace" },
},
},
})
vim.lsp.enable("lua_ls")
-- Nix
vim.lsp.config("nixd", {
settings = {
nixd = {
nixpkgs = { expr = nixCats.extra("nixdExtras.nixpkgs") },
options = {
nixos = { expr = nixCats.extra("nixdExtras.nixos_options") },
["home-manager"] = { expr = nixCats.extra("nixdExtras.home_manager_options") },
},
formatting = { command = { "nixfmt" } },
},
},
})
vim.lsp.enable("nixd")
-- Dafny
vim.lsp.enable("dafny")
-- TypeScript/JS
vim.lsp.enable("ts_ls")
-- Rust
vim.lsp.enable("rust_analyzer")
-- Python
vim.lsp.config("basedpyright", {
settings = {
basedpyright = {
analysis = {
autoSearchPaths = true,
useLibraryCodeForTypes = true,
diagnosticMode = "openFilesOnly",
typeCheckingMode = "standard",
inlayHints = {
variableTypes = true,
callArgumentNames = true,
functionReturnTypes = true,
},
},
},
},
})
vim.lsp.enable("basedpyright")
end,
},
},
})

View File

@@ -0,0 +1,158 @@
require("lz.n").load({
{
"catppuccin-nvim",
event = "VimEnter",
after = function()
require("catppuccin").setup({
flavour = "mocha",
term_colors = true,
dim_inactive = {
enabled = true,
shade = "dark",
percentage = 0.15,
},
integrations = {
gitsigns = true,
telescope = true,
treesitter = true,
treesitter_context = true,
markdown = true,
which_key = true,
blink_cmp = {
style = "bordered",
},
},
native_lsp = {
enabled = true,
virtual_text = {
errors = { "italic" },
hints = { "italic" },
warnings = { "italic" },
information = { "italic" },
},
underlines = {
errors = { "underline" },
hints = { "underline" },
warnings = { "underline" },
information = { "underline" },
},
inlay_hints = {
background = true,
},
},
})
vim.cmd.colorscheme("catppuccin")
end,
},
{
"colorful-menu.nvim",
after = function()
require("colorful-menu").setup({})
end,
},
{
"indent-blankline.nvim",
event = "User FileOpened",
after = function()
require("ibl").setup({
indent = { char = "|" },
scope = {
enabled = false,
show_start = false,
show_end = false,
},
})
end,
},
{
"render-markdown.nvim",
before = function()
require("lz.n").trigger_load({ "nvim-treesitter", "mini.nvim" })
end,
after = function()
require("render-markdown").setup({})
end,
},
{
"which-key.nvim",
event = "VimEnter",
before = function()
require("lz.n").trigger_load("nvim-web-devicons")
end,
after = function()
require("which-key").setup({
preset = "modern",
delay = 200,
win = {
border = "rounded",
},
icons = {
-- set icon mappings to true if you have a Nerd Font
mappings = true,
-- If you are using a Nerd Font: set icons.keys to an empty table which will use the
-- default which-key.nvim defined Nerd Font icons, otherwise define a string table
keys = {},
},
-- Document existing key chains
spec = {
{ "<leader>s", group = "[S]earch" },
{ "<leader>t", group = "[T]oggle" },
{ "<leader>h", group = "Git [H]unk", mode = { "n", "v" } },
},
})
end,
},
{
"mini.nvim",
after = function()
-- Better Around/Inside textobjects
require("mini.ai").setup({ n_lines = 500 })
-- Add/delete/replace surroundings (brackets, quotes, etc.)
require("mini.surround").setup()
-- Simple and easy statusline.
local statusline = require("mini.statusline")
statusline.setup({ use_icons = true })
statusline.section_location = function()
return "%2l:%-2v"
end
local files = require("mini.files")
files.setup()
vim.keymap.set("n", "<leader>e", function()
if not files.close() then
files.open(vim.api.nvim_buf_get_name(0))
end
end, { desc = "File [E]xplorer" })
local icons = require("mini.icons")
icons.setup()
icons.mock_nvim_web_devicons()
local hipatterns = require("mini.hipatterns")
hipatterns.setup({
highlighters = {
-- Highlight hex color strings (#rrggbb) using that color
hex_color = hipatterns.gen_highlighter.hex_color(),
},
})
local indentscope = require("mini.indentscope")
indentscope.setup({
symbol = "",
-- draw = { animation = indentscope.gen_animation.linear({}) },
})
vim.api.nvim_create_autocmd("FileType", {
pattern = { "help", "alpha", "dashboard", "neo-tree", "Trouble", "lazy", "mason" },
callback = function()
vim.b.miniindentscope_disable = true
end,
})
end,
},
})

View File

@@ -0,0 +1,27 @@
# NVF is a Neovim configuration that provides a minimal setup with essential plugins and configurations.
{
inputs,
pkgs,
...
}:
{
imports = [
inputs.nvf.homeManagerModules.default
./options.nix
./languages.nix
./picker.nix
./snacks.nix
./keymaps.nix
./utils.nix
./mini.nix
];
programs.nvf = {
enable = true;
settings.vim = {
startPlugins = [
pkgs.vimPlugins.vim-kitty-navigator
];
};
};
}

View File

@@ -0,0 +1,173 @@
{
programs.nvf.settings.vim = {
globals.mapleader = " ";
binds = {
whichKey = {
enable = true;
# TODO: registers
register = {};
};
};
keymaps = [
# General Mappings
{
key = "s";
mode = "n";
silent = true;
action = "<cmd>lua require('flash').jump()<cr>";
desc = "Flash";
}
{
key = "K";
mode = "n";
silent = true;
action = "<cmd>lua vim.lsp.buf.hover()<cr>";
desc = "LSP Hover";
}
{
key = "<C-tab>";
mode = "n";
silent = true;
action = "<cmd>bnext<cr>";
desc = "Next Buffer";
}
# Kitty navigator
{
key = "<C-h>";
mode = "n";
silent = true;
action = "<cmd>KittyNavigateLeft<cr>";
}
{
key = "<C-j>";
mode = "n";
silent = true;
action = "<cmd>KittyNavigateDown<cr>";
}
{
key = "<C-k>";
mode = "n";
silent = true;
action = "<cmd>KittyNavigateUp<cr>";
}
{
key = "<C-l>";
mode = "n";
silent = true;
action = "<cmd>KittyNavigateRight<cr>";
}
# Disable Arrow Keys in Normal Mode
{
key = "<Up>";
mode = "n";
silent = true;
action = "<Nop>";
desc = "Disable Up Arrow";
}
{
key = "<Down>";
mode = "n";
silent = true;
action = "<Nop>";
desc = "Disable Down Arrow";
}
{
key = "<Left>";
mode = "n";
silent = true;
action = "<Nop>";
desc = "Disable Left Arrow";
}
{
key = "<Right>";
mode = "n";
silent = true;
action = "<Nop>";
desc = "Disable Right Arrow";
}
# UI
{
key = "<leader>uw";
mode = "n";
silent = true;
action = "<cmd>set wrap!<cr>";
desc = "Toggle word wrapping";
}
{
key = "<leader>ul";
mode = "n";
silent = true;
action = "<cmd>set linebreak!<cr>";
desc = "Toggle linebreak";
}
{
key = "<leader>us";
mode = "n";
silent = true;
action = "<cmd>set spell!<cr>";
desc = "Toggle spellLazyGitcheck";
}
{
key = "<leader>uc";
mode = "n";
silent = true;
action = "<cmd>set cursorline!<cr>";
desc = "Toggle cursorline";
}
{
key = "<leader>un";
mode = "n";
silent = true;
action = "<cmd>set number!<cr>";
desc = "Toggle line numbers";
}
{
key = "<leader>ur";
mode = "n";
silent = true;
action = "<cmd>set relativenumber!<cr>";
desc = "Toggle relative line numbers";
}
{
key = "<leader>ut";
mode = "n";
silent = true;
action = "<cmd>set showtabline=2<cr>";
desc = "Show tabline";
}
{
key = "<leader>uT";
mode = "n";
silent = true;
action = "<cmd>set showtabline=0<cr>";
desc = "Hide tabline";
}
# Windows
{
key = "<leader>ws";
mode = "n";
silent = true;
action = "<cmd>split<cr>";
desc = "Split";
}
{
key = "<leader>wv";
mode = "n";
silent = true;
action = "<cmd>vsplit<cr>";
desc = "VSplit";
}
{
key = "<leader>wd";
mode = "n";
silent = true;
action = "<cmd>close<cr>";
desc = "Close";
}
];
};
}

View File

@@ -0,0 +1,119 @@
{
lib,
pkgs,
...
}: {
programs.nvf.settings.vim = {
diagnostics = {
enable = true;
config = {
signs = {
text = {
"vim.diagnostic.severity.Error" = " ";
"vim.diagnostic.severity.Warn" = " ";
"vim.diagnostic.severity.Hint" = " ";
"vim.diagnostic.severity.Info" = " ";
};
};
underline = true;
update_in_insert = true;
virtual_text = {
format =
lib.generators.mkLuaInline
/*
lua
*/
''
function(diagnostic)
return string.format("%s", diagnostic.message)
--return string.format("%s (%s)", diagnostic.message, diagnostic.source)
end
'';
};
};
nvim-lint = {
enable = true;
};
};
syntaxHighlighting = true;
treesitter = {
enable = true;
autotagHtml = true;
context.enable = true;
highlight.enable = true;
grammars = with pkgs.vimPlugins.nvim-treesitter.builtGrammars; [
typescript # in language settings only tsx gets enabled, not typescript
];
};
lsp = {
enable = true;
trouble.enable = true;
lspSignature.enable = true;
lspconfig.enable = true;
formatOnSave = true;
inlayHints.enable = true;
null-ls.enable = true;
servers.nixd.settings.nil.nix.autoArchive = true;
otter-nvim = {
enable = true;
setupOpts = {
buffers.set_filetype = true;
lsp = {
diagnostic_update_event = [
"BufWritePost"
"InsertLeave"
];
};
};
};
lspkind.enable = true;
lspsaga = {
enable = true;
setupOpts = {
ui = {
code_action = "";
};
lightbulb = {
sign = false;
virtual_text = true;
};
breadcrumbs.enable = false;
};
};
};
languages = {
enableDAP = true;
enableExtraDiagnostics = true;
enableFormat = true;
enableTreesitter = true;
astro.enable = true;
go.enable = true;
markdown = {
enable = true;
format.type = "prettierd";
extensions = {
markview-nvim = {
enable = true;
};
};
extraDiagnostics.enable = true;
};
ts = {
enable = true;
extensions.ts-error-translator.enable = true;
};
css.enable = true;
svelte.enable = true;
html.enable = true;
bash.enable = true;
nix.enable = true;
tailwind.enable = true;
};
formatter = {
conform-nvim = {
enable = true;
};
};
};
}

View File

@@ -0,0 +1,13 @@
{
programs.nvf.settings.vim.mini = {
starter.enable = true;
comment.enable = true;
# cursorword.enable = true;
icons.enable = true;
indentscope.enable = true;
notify.enable = true;
pairs.enable = true;
diff.enable = true;
git.enable = true;
};
}

View File

@@ -0,0 +1,41 @@
{ lib, ... }:
{
programs.nvf.settings.vim = {
viAlias = false;
vimAlias = true;
withNodeJs = true;
# syntaxHighlighting = true;
options = {
autoindent = true;
smartindent = true;
shiftwidth = 2;
foldlevel = 99;
foldcolumn = "auto:1";
mousescroll = "ver:1,hor:1";
mousemoveevent = true;
fillchars = "eob:,fold: ,foldopen:,foldsep:,foldclose:";
signcolumn = "yes";
tabstop = 2;
softtabstop = 2;
wrap = false;
};
globals = {
navic_silence = true; # navic tries to attach multiple LSPs and fails
suda_smart_edit = 1; # use super user write automatically
neovide_scale_factor = 0.7;
neovide_cursor_animation_length = 0.1;
neovide_cursor_short_animation_length = 0;
};
clipboard = {
enable = true;
registers = "unnamedplus";
providers.wl-copy.enable = true;
};
theme = {
enable = true;
name = lib.mkForce "catppuccin";
style = lib.mkForce "mocha";
transparent = lib.mkForce true;
};
};
}

View File

@@ -0,0 +1,257 @@
{
programs.nvf.settings.vim = {
utility = {
oil-nvim.enable = true;
snacks-nvim = {
setupOpts = {
picker.enabled = true;
explorer.enabled = true;
};
};
};
keymaps = [
# Top Pickers & Explorer
{
key = "<leader> ";
mode = "n";
silent = true;
action = "<cmd>lua Snacks.picker.smart()<cr>";
desc = "Smart Find Files";
}
{
key = "<leader>,";
mode = "n";
silent = true;
action = "<cmd>lua Snacks.picker.buffers()<cr>";
desc = "Buffers";
}
{
key = "<leader>/";
mode = "n";
silent = true;
action = "<cmd>lua Snacks.picker.grep()<cr>";
desc = "Grep";
}
{
key = "<leader>:";
mode = "n";
silent = true;
action = "<cmd>lua Snacks.picker.command_history()<cr>";
desc = "Command History";
}
{
key = "<leader>e";
mode = "n";
silent = true;
action = "<cmd>lua Snacks.explorer()<cr>";
desc = "File Explorer";
}
{
key = "-";
mode = "n";
silent = true;
action = "<cmd>Oil<cr>";
desc = "Oil";
}
# Find
{
key = "<leader>fb";
mode = "n";
silent = true;
action = "<cmd>lua Snacks.picker.buffers()<cr>";
desc = "Buffers";
}
{
key = "<leader>fc";
mode = "n";
silent = true;
action = ''
<cmd>lua Snacks.picker.files({ cwd = vim.fn.stdpath("config") })<cr>'';
desc = "Find Config File";
}
{
key = "<leader>ff";
mode = "n";
silent = true;
action = "<cmd>lua Snacks.picker.files()<cr>";
desc = "Find Files";
}
{
key = "<leader>fg";
mode = "n";
silent = true;
action = "<cmd>lua Snacks.picker.git_files()<cr>";
desc = "Find Git Files";
}
{
key = "<leader>fp";
mode = "n";
silent = true;
action = "<cmd>lua Snacks.picker.projects()<cr>";
desc = "Projects";
}
{
key = "<leader>fr";
mode = "n";
silent = true;
action = "<cmd>lua Snacks.picker.recent()<cr>";
desc = "Recent";
}
{
key = "<leader>fn";
mode = "n";
silent = true;
action = "<cmd>lua Snacks.picker.notifications()<cr>";
desc = "Notification History";
}
{
key = "<leader>fe";
mode = "n";
silent = true;
action = "<cmd>lua Snacks.picker.icons()<cr>";
desc = "Emoji";
}
# Git
{
key = "<leader>gb";
mode = "n";
silent = true;
action = "<cmd>lua Snacks.picker.git_branches()<cr>";
desc = "Git Branches";
}
{
key = "<leader>gL";
mode = "n";
silent = true;
action = "<cmd>lua Snacks.picker.git_log()<cr>";
desc = "Git Log Line";
}
{
key = "<leader>gs";
mode = "n";
silent = true;
action = "<cmd>lua Snacks.picker.git_status()<cr>";
desc = "Git Status";
}
{
key = "<leader>gS";
mode = "n";
silent = true;
action = "<cmd>lua Snacks.picker.git_stash()<cr>";
desc = "Git Stash";
}
{
key = "<leader>gd";
mode = "n";
silent = true;
action = "<cmd>lua Snacks.picker.git_diff()<cr>";
desc = "Git Diff (Hunks)";
}
{
key = "<leader>gf";
mode = "n";
silent = true;
action = "<cmd>lua Snacks.picker.git_log_file()<cr>";
desc = "Git Log File";
}
# Grep
{
key = "<leader>sb";
mode = "n";
silent = true;
action = "<cmd>lua Snacks.picker.lines()<cr>";
desc = "Buffer Lines";
}
{
key = "<leader>st";
mode = "n";
silent = true;
action = "<cmd>lua Snacks.picker.todo_comments()<cr>";
desc = "Todos";
}
{
key = "<leader>sB";
mode = "n";
silent = true;
action = "<cmd>lua Snacks.picker.grep_buffers()<cr>";
desc = "Grep Open Buffers";
}
{
key = "<leader>sg";
mode = "n";
silent = true;
action = "<cmd>lua Snacks.picker.grep()<cr>";
desc = "Grep";
}
{
key = "<leader>sw";
mode = "n";
silent = true;
action = "<cmd>lua Snacks.picker.grep_word()<cr>";
desc = "Visual selection or word";
}
{
key = "<leader>sr";
mode = "n";
silent = true;
action = "<cmd>nohlsearch<cr>";
desc = "Reset search";
}
# LSP
{
key = "gd";
mode = "n";
silent = true;
action = "<cmd>lua Snacks.picker.lsp_definitions()<cr>";
desc = "Goto Definition";
}
{
key = "gD";
mode = "n";
silent = true;
action = "<cmd>lua Snacks.picker.lsp_declarations()<cr>";
desc = "Goto Declaration";
}
{
key = "gr";
mode = "n";
silent = true;
action = "<cmd>lua Snacks.picker.lsp_references()<cr>";
desc = "References";
nowait = true;
}
{
key = "gI";
mode = "n";
silent = true;
action = "<cmd>lua Snacks.picker.lsp_implementations()<cr>";
desc = "Goto Implementation";
}
{
key = "gy";
mode = "n";
silent = true;
action = "<cmd>lua Snacks.picker.lsp_type_definitions()<cr>";
desc = "Goto Type Definition";
}
{
key = "<leader>ss";
mode = "n";
silent = true;
action = "<cmd>lua Snacks.picker.lsp_symbols()<cr>";
desc = "LSP Symbols";
}
{
key = "<leader>sS";
mode = "n";
silent = true;
action = "<cmd>lua Snacks.picker.lsp_workspace_symbols()<cr>";
desc = "LSP Workspace Symbols";
}
];
};
}

View File

@@ -0,0 +1,19 @@
{
programs.nvf.settings.vim.utility.snacks-nvim = {
enable = true;
setupOpts = {
image = {
enabled = true;
doc = {
inline = false;
float = true;
};
};
quickfile.enabled = true;
statuscolumn.enabled = true;
zen.enabled = true;
bufdelete.enabled = true;
gitsigns.enabled = true;
};
};
}

View File

@@ -0,0 +1,53 @@
{pkgs, ...}: {
programs.nvf.settings.vim = {
undoFile.enable = true;
utility = {
motion.flash-nvim.enable = true;
outline.aerial-nvim.enable = true;
};
tabline.nvimBufferline.enable = true;
notes.todo-comments.enable = true;
assistant.copilot = {
enable = true;
cmp.enable = true;
};
statusline.lualine.enable = true;
autocomplete = {
nvim-cmp = {
enable = true;
sources = {
buffer = "[Buffer]";
nvim-cmp = null;
path = "[Path]";
};
sourcePlugins = [
pkgs.vimPlugins.cmp-cmdline
];
};
};
snippets.luasnip.enable = true;
ui = {
noice.enable = true;
colorizer.enable = true;
};
git = {
enable = true;
gitsigns.enable = true;
};
terminal.toggleterm = {
enable = true;
lazygit = {
enable = true;
mappings.open = "<leader>gl";
};
};
visuals = {
rainbow-delimiters.enable = true;
nvim-scrollbar = {
enable = false;
};
};
};
}

View File

@@ -0,0 +1,35 @@
{
programs.rclone = {
enable = true;
remotes = {
gdrive = {
config = {
type = "drive";
scope = "drive";
root_folder_id = "";
};
secrets = {
token = "/home/kiri/.config/rclone/gdrive_token";
client_id = "/home/kiri/.config/rclone/gdrive_client_id";
client_secret = "/home/kiri/.config/rclone/gdrive_client_secret"; #TODO: sops?
};
mounts = {
"/" = {
enable = true;
mountPoint = "/home/kiri/gdrive";
options = {
dir-cache-time = "5000h";
poll-interval = "10s";
vfs-cache-mode = "full";
};
};
};
};
};
};
}

View File

@@ -0,0 +1,4 @@
# Import all shell configurations
{
imports = [./fzf.nix ./zsh.nix ./starship.nix ./zoxide.nix ./eza.nix];
}

View File

@@ -0,0 +1,13 @@
# Eza is a ls replacement
{
programs.eza = {
enable = true;
icons = "auto";
extraOptions = [
"--group-directories-first"
"--no-quotes"
"--icons=always"
];
};
}

View File

@@ -0,0 +1,33 @@
# Fzf is a general-purpose command-line fuzzy finder.
{
config,
lib,
...
}: let
accent = "#" + config.lib.stylix.colors.base0D;
foreground = "#" + config.lib.stylix.colors.base05;
muted = "#" + config.lib.stylix.colors.base03;
in {
programs.fzf = {
enable = true;
enableZshIntegration = true;
colors = lib.mkForce {
"fg+" = accent;
"bg+" = "-1";
"fg" = foreground;
"bg" = "-1";
"prompt" = muted;
"pointer" = accent;
};
defaultOptions = [
"--margin=1"
"--layout=reverse"
"--border=none"
"--info='hidden'"
"--header=''"
"--prompt='/ '"
"-i"
"--no-bold"
];
};
}

View File

@@ -0,0 +1,72 @@
# starship is a minimal, fast, and extremely customizable prompt for any shell!
{
config,
lib,
...
}:
let
accent = "#${config.lib.stylix.colors.base0D}";
background-alt = "#${config.lib.stylix.colors.base01}";
in
{
programs.starship = {
enable = true;
enableZshIntegration = true;
settings = {
add_newline = true;
format = lib.concatStrings [
"$nix_shell"
"$hostname"
"$directory"
"$git_branch"
"$git_state"
"$git_status"
"$line_break"
"$character"
];
directory = {
style = accent;
truncation_length = 99;
truncate_to_repo = false;
};
character = {
success_symbol = "[](${accent})";
error_symbol = "[](red)";
vimcmd_symbol = "[](${accent})";
};
nix_shell = {
format = "[$symbol]($style) ";
symbol = "🐚";
style = "";
};
git_branch = {
symbol = "[](${background-alt}) ";
style = "fg:${accent} bg:${background-alt}";
format = "on [$symbol$branch]($style)[](${background-alt}) ";
};
git_status = {
format = "[[(*$conflicted$untracked$modified$staged$renamed$deleted)](218)($ahead_behind$stashed)]($style)";
style = "cyan";
conflicted = "";
renamed = "";
deleted = "";
stashed = "";
};
git_state = {
format = "([$state( $progress_current/$progress_total)]($style)) ";
style = "bright-black";
};
line_break = {
disabled = false;
};
};
};
}

View File

@@ -0,0 +1,7 @@
# Zoxide is a cd replacement
{
programs.zoxide = {
enable = true;
enableZshIntegration = true;
};
}

214
home/programs/shell/zsh.nix Normal file
View File

@@ -0,0 +1,214 @@
# My shell configuration
{
pkgs,
lib,
config,
...
}:
let
fetch = config.theme.fetch; # neofetch, nerdfetch, pfetch
in
{
home.packages = with pkgs; [
bat
ripgrep
tldr
sesh
];
# Add go binaries to the PATH
home.sessionPath = [ "$HOME/go/bin" ];
programs.zsh = {
enable = true;
enableCompletion = true;
autosuggestion.enable = true;
syntaxHighlighting = {
enable = true;
highlighters = [
"main"
"brackets"
"pattern"
"regexp"
"root"
"line"
];
};
historySubstringSearch.enable = true;
history = {
ignoreDups = true;
save = 10000;
size = 10000;
};
profileExtra = lib.optionalString (config.home.sessionPath != [ ]) ''
export PATH="$PATH''${PATH:+:}${lib.concatStringsSep ":" config.home.sessionPath}"
'';
shellAliases = {
c = "clear";
clera = "clear";
celar = "clear";
e = "exit";
cd = "z";
ls = "eza --icons=always --no-quotes";
tree = "eza --icons=always --tree --no-quotes";
sl = "ls";
open = "${pkgs.xdg-utils}/bin/xdg-open";
cat = "bat --theme=base16 --color=always --paging=never --tabs=2 --wrap=never --plain";
mkdir = "mkdir -p";
obsidian-no-gpu = "env ELECTRON_OZONE_PLATFORM_HINT=auto obsidian --ozone-platform=x11";
wireguard-import = "nmcli connection import type wireguard file";
notes = "nvim ~/notes/index.md --cmd 'cd ~/notes' -c ':lua Snacks.picker.smart()'";
note = "notes";
tmp = "nvim /tmp/$(date | sed 's/ //g;s/\\.//g').md";
nix-shell = "nix-shell --command zsh";
# git
g = "lazygit";
ga = "git add";
gc = "git commit";
gcu = "git add . && git commit -m 'Update'";
gp = "git push";
gpl = "git pull";
gs = "git status";
gd = "git diff";
gco = "git checkout";
gcb = "git checkout -b";
gbr = "git branch";
grs = "git reset HEAD~1";
grh = "git reset --hard HEAD~1";
gaa = "git add .";
gcm = "git commit -m";
};
initContent =
# bash
''
bindkey -v
export KEYTIMEOUT=1
${
if fetch == "neofetch" then
pkgs.neofetch + "/bin/neofetch"
else if fetch == "nerdfetch" then
"nerdfetch"
else if fetch == "pfetch" then
"echo; ${pkgs.pfetch}/bin/pfetch"
else
""
}
function sesh-sessions() {
session=$(sesh list -t -c | fzf --height 70% --reverse)
[[ -z "$session" ]] && return
sesh connect $session
}
function chatgptfolder(){
echo "################################"
echo "### TREE ###"
echo "################################"
${pkgs.eza}/bin/eza --tree -aF --icons never
echo -e "\n\n"
echo "##############################"
echo "### CONTENT ###"
echo "##############################"
find . -type f -not -path '*/.git/*' -print0 | while IFS= read -r -d "" file; do
echo -e "\n--- DEBUT: $file ---\n"
cat "$file"
echo -e "\n--- FIN: $file ---\n"
done
}
function n4c() {
category=''${1:-all}
shift
args=''${*}
nix develop "github:nix4cyber/n4c#''${category}" ''${args} -c zsh
}
zle -N sesh-sessions
bindkey -M emacs '\es' sesh-sessions
bindkey -M vicmd '\es' sesh-sessions
bindkey -M viins '\es' sesh-sessions
# search history based on what's typed in the prompt
autoload -U history-search-end
zle -N history-beginning-search-backward-end history-search-end
zle -N history-beginning-search-forward-end history-search-end
bindkey "^[OA" history-beginning-search-backward-end
bindkey "^[OB" history-beginning-search-forward-end
# General completion behavior
zstyle ':completion:*' completer _extensions _complete _approximate
# Use cache
zstyle ':completion:*' use-cache on
zstyle ':completion:*' cache-path "$XDG_CACHE_HOME/zsh/.zcompcache"
# Complete the alias
zstyle ':completion:*' complete true
# Autocomplete options
zstyle ':completion:*' complete-options true
# Completion matching control
zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
zstyle ':completion:*' keep-prefix true
# Group matches and describe
zstyle ':completion:*' menu select
zstyle ':completion:*' list-grouped false
zstyle ':completion:*' list-separator '''
zstyle ':completion:*' group-name '''
zstyle ':completion:*' verbose yes
zstyle ':completion:*:matches' group 'yes'
zstyle ':completion:*:warnings' format '%F{red}%B-- No match for: %d --%b%f'
zstyle ':completion:*:messages' format '%d'
zstyle ':completion:*:corrections' format '%B%d (errors: %e)%b'
zstyle ':completion:*:descriptions' format '[%d]'
# Colors
zstyle ':completion:*' list-colors ''${(s.:.)LS_COLORS}
# case insensitive tab completion
zstyle ':completion:*:*:cd:*' tag-order local-directories directory-stack path-directories
zstyle ':completion:*:*:cd:*:directory-stack' menu yes select
zstyle ':completion:*:-tilde-:*' group-order 'named-directories' 'path-directories' 'users' 'expand'
zstyle ':completion:*:*:-command-:*:*' group-order aliases builtins functions commands
zstyle ':completion:*' special-dirs true
zstyle ':completion:*' squeeze-slashes true
# Sort
zstyle ':completion:*' sort false
zstyle ":completion:*:git-checkout:*" sort false
zstyle ':completion:*' file-sort modification
zstyle ':completion:*:eza' sort false
zstyle ':completion:complete:*:options' sort false
zstyle ':completion:files' sort false
${lib.optionalString config.services.gpg-agent.enable ''
gnupg_path=$(ls $XDG_RUNTIME_DIR/gnupg)
export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/gnupg/$gnupg_path/S.gpg-agent.ssh"
''}
# Allow foot to pipe command output
function precmd {
if ! builtin zle; then
print -n "\e]133;D\e\\"
fi
}
function preexec {
print -n "\e]133;C\e\\"
}
'';
};
}

View File

@@ -0,0 +1,44 @@
# Spicetify is a spotify client customizer
{
pkgs,
config,
lib,
inputs,
...
}:
let
spicePkgs = inputs.spicetify-nix.legacyPackages.${pkgs.stdenv.hostPlatform.system};
accent = "${config.lib.stylix.colors.base0D}";
background = "${config.lib.stylix.colors.base00}";
in
{
imports = [ inputs.spicetify-nix.homeManagerModules.default ];
stylix.targets.spicetify.enable = false;
programs.spicetify = {
enable = true;
theme = lib.mkForce spicePkgs.themes.dribbblish;
colorScheme = "custom";
customColorScheme = {
button = accent;
button-active = accent;
tab-active = accent;
player = background;
main = background;
sidebar = background;
};
enabledExtensions = with spicePkgs.extensions; [
playlistIcons
lastfm
historyShortcut
hidePodcasts
adblock
fullAppDisplay
keyboardShortcut
];
};
}

View File

@@ -0,0 +1,7 @@
# Tailscale is a VPN service that works on top of WireGuard.
# It allows me to access my servers and devices from anywhere.
{inputs, ...}: {
home.packages = with inputs.nixpkgs-stable.legacyPackages.x86_64-linux; [tailscale tailscale-systray];
# wayland.windowManager.hyprland.settings.exec-once = ["${pkgs.tailscale-systray}/bin/tailscale-systray"];
}

View File

@@ -0,0 +1,137 @@
# Thunar is a file explorer
{
pkgs,
config,
...
}: let
user = config.var.username;
in {
# ctrl + m to toggle the menubar
home.packages = with pkgs; [
xfce.thunar
xfce.xfconf
xfce.tumbler
xfce.thunar-archive-plugin
xfce.thunar-volman
xfce.thunar-media-tags-plugin
p7zip
xarchiver
];
gtk = {
iconTheme = {
name = "WhiteSur";
package = pkgs.whitesur-icon-theme.override {
boldPanelIcons = true;
alternativeIcons = true;
};
};
};
home.sessionVariables = {
XDG_ICON_DIR = "${pkgs.whitesur-icon-theme}/share/icons/WhiteSur";
};
# bookmarks for the side pane
gtk.gtk3.bookmarks = [
"file:///home/${user}/Downloads Downloads"
"file:///home/${user}/Pictures Pictures"
"file:///home/${user}/.config/nixos NixOS"
"file:///home/${user}/dev Development"
];
home.file.".config/xarchiver/xarchiverrc".text = ''
[xarchiver]
preferred_format=0
prefer_unzip=true
confirm_deletion=true
sort_filename_content=false
advanced_isearch=true
auto_expand=true
store_output=false
icon_size=2
show_archive_comment=false
show_sidebar=true
show_location_bar=true
show_toolbar=true
preferred_custom_cmd=
preferred_temp_dir=/tmp
preferred_extract_dir=/home/${user}/Downloads
allow_sub_dir=0
ensure_directory=true
overwrite=false
full_path=2
touch=false
fresh=false
update=false
store_path=false
updadd=true
freshen=false
recurse=true
solid_archive=false
remove_files=false
'';
home.file.".config/xfce4/xfconf/xfce-perchannel-xml/thunar.xml".text = ''
<?xml version="1.0" encoding="UTF-8"?>
<channel name="thunar" version="1.0">
<property name="last-view" type="string" value="ThunarIconView"/>
<property name="last-icon-view-zoom-level" type="string" value="THUNAR_ZOOM_LEVEL_100_PERCENT"/>
<property name="last-window-maximized" type="bool" value="true"/>
<property name="last-separator-position" type="int" value="170"/>
<property name="last-statusbar-visible" type="bool" value="false"/>
<property name="last-menubar-visible" type="bool" value="false"/>
<property name="misc-single-click" type="bool" value="false"/>
<property name="shortcuts-icon-emblems" type="bool" value="true"/>
<property name="tree-icon-emblems" type="bool" value="true"/>
<property name="misc-file-size-binary" type="bool" value="true"/>
<property name="misc-thumbnail-draw-frames" type="bool" value="false"/>
<property name="misc-text-beside-icons" type="bool" value="true"/>
<property name="misc-change-window-icon" type="bool" value="true"/>
<property name="hidden-bookmarks" type="array">
<value type="string" value="computer:///"/>
<value type="string" value="recent:///"/>
<value type="string" value="file:///"/>
<value type="string" value="network:///"/>
</property>
<property name="hidden-devices" type="array">
<value type="string" value="52FEA905FEA8E309"/>
</property>
<property name="last-toolbar-item-order" type="string" value="0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17"/>
<property name="last-toolbar-visible-buttons" type="string" value="0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0"/>
<property name="last-location-bar" type="string" value="ThunarLocationButtons"/>
<property name="last-show-hidden" type="bool" value="false"/>
<property name="last-details-view-zoom-level" type="string" value="THUNAR_ZOOM_LEVEL_38_PERCENT"/>
<property name="last-details-view-column-widths" type="string" value="50,50,127,50,50,50,50,50,751,50,50,75,50,145"/>
<property name="last-toolbar-items" type="string" value="menu:1,back:1,forward:0,open-parent:0,open-home:0,undo:0,redo:0,zoom-in:0,zoom-out:0,zoom-reset:0,view-as-icons:0,view-as-detailed-list:0,view-as-compact-list:0,toggle-split-view:0,location-bar:1,reload:0,search:1,uca-action-1710183590071525-1:0,new-tab:0,new-window:0,view-switcher:0"/>
</channel>
'';
xdg.configFile."Thunar/uca.xml".text = ''
<?xml version="1.0" encoding="UTF-8"?>
<actions>
<action>
<icon>utilities-terminal</icon>
<name>Open Terminal Here</name>
<unique-id>1700000000000001</unique-id>
<command>kitty -d %f</command>
<description>Opens Kitty terminal in the selected folder</description>
<patterns>*</patterns>
<startup-notify/>
<directories/>
</action>
<action>
<icon></icon>
<name>Extract here</name>
<submenu></submenu>
<unique-id>1689618425925956-3</unique-id>
<command>xarchiver -x . %f</command>
<description>Extracts the archive into the directory it is located in.</description>
<range>*</range>
<patterns>*.tar.bz2;*.tar.gz;*.tar.xz;*.tar.Z;*.tar;*.taz;*.tb2;*.tbz;*.tbz2;*.tgz;*.txz;*.zip;*.bz2;*.docx;*.apk;*.gz;*.odt;</patterns>
<other-files/>
</action>
</actions>
'';
}

View File

@@ -0,0 +1,87 @@
{
accounts.email.accounts = {
Main = {
enable = true;
address = "mail@jelles.net";
imap = {
authentication = "plain";
host = "taylor.mxrouting.net";
port = 993;
tls.enable = true;
};
#passwordCommand = "rbw get \"Main E-Mail\""; #NOTE: Does not work for thunderbird
primary = true;
realName = "Jelle Spreeuwenberg";
smtp = {
authentication = "plain";
host = "taylor.mxrouting.net";
port = 465;
tls.enable = true;
};
thunderbird = {
enable = true;
};
userName = "mail@jelles.net";
};
Old = {
enable = true;
address = "mail@jellespreeuwenberg.nl";
imap = {
authentication = "plain";
host = "taylor.mxrouting.net";
port = 993;
tls.enable = true;
};
realName = "Jelle Spreeuwenberg";
smtp = {
authentication = "plain";
host = "taylor.mxrouting.net";
port = 465;
tls.enable = true;
};
thunderbird = {
enable = true;
};
userName = "mail@jellespreeuwenberg.nl";
};
Uni = {
# TODO: Thunderbird automatically uses normal password authentication instead of oauth, you have to manually change it
enable = true;
flavor = "outlook.office365.com";
address = "j.spreeuwenberg@student.tue.nl";
realName = "Jelle Spreeuwenberg";
thunderbird = {
enable = true;
};
userName = "j.spreeuwenberg@student.tue.nl";
};
Work = {
# TODO: Thunderbird automatically uses normal password authentication instead of oauth, you have to manually change it
enable = true;
flavor = "outlook.office365.com";
address = "jelle.spreeuwenberg@yookr.org";
realName = "Jelle Spreeuwenberg";
thunderbird = {
enable = true;
};
userName = "jelle.spreeuwenberg@yookr.org";
};
};
accounts.email.maildirBasePath = ".local/share/mail";
programs.thunderbird = {
enable = true;
profiles.default = {
accountsOrder = [
"Main"
"Old"
"Uni"
"Work"
];
isDefault = true;
};
};
}

View File

@@ -0,0 +1,8 @@
{ inputs, ... }:
{
imports = [
inputs.zen-browser.homeModules.twilight
];
programs.zen-browser.enable = true;
}