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;
}

View File

@@ -0,0 +1,36 @@
# - ## Brightness
#-
#- This module provides a set of scripts to control the brightness of the screen.
#-
#- - `brightness-up` increases the brightness by 5%.
#- - `brightness-down` decreases the brightness by 5%.
#- - `brightness-set [value]` sets the brightness to the given value.
#- - `brightness-change [up|down] [value]` increases or decreases the brightness by the given value.
{pkgs, ...}: let
increments = "5";
brightness-change = pkgs.writeShellScriptBin "brightness-change" ''
[[ $1 == "up" ]] && ${pkgs.brightnessctl}/bin/brightnessctl set ''${2-${increments}}%+
[[ $1 == "down" ]] && ${pkgs.brightnessctl}/bin/brightnessctl set ''${2-${increments}}%-
'';
brightness-set = pkgs.writeShellScriptBin "brightness-set" ''
${pkgs.brightnessctl}/bin/brightnessctl set ''${1-100}%
'';
brightness-up = pkgs.writeShellScriptBin "brightness-up" ''
brightness-change up ${increments}
'';
brightness-down = pkgs.writeShellScriptBin "brightness-down" ''
brightness-change down ${increments}
'';
in {
home.packages = [
pkgs.brightnessctl
brightness-change
brightness-up
brightness-down
brightness-set
];
}

View File

@@ -0,0 +1,26 @@
# - ## Caffeine
#-
#- Caffeine is a simple script that toggles hypridle (disable suspend & screenlock).
#-
#- - `caffeine-status` - Check if hypridle is running. (0/1)
#- - `caffeine-status-icon` - Check if hypridle is running. (icon)
#- - `caffeine` - Toggle hypridle.
{pkgs, ...}: let
caffeine-status = pkgs.writeShellScriptBin "caffeine-status" ''
[[ $(pidof "hypridle") ]] && echo "0" || echo "1"
'';
caffeine-status-icon = pkgs.writeShellScriptBin "caffeine-status-icon" ''
[[ $(pidof "hypridle") ]] && echo "󰾪" || echo "󰅶"
'';
caffeine = pkgs.writeShellScriptBin "caffeine" ''
if [[ $(pidof "hypridle") ]]; then
systemctl --user stop hypridle.service
${pkgs.swayosd}/bin/swayosd-client --custom-message="Caffeine On" --custom-icon="emblem-default"
else
systemctl --user start hypridle.service
${pkgs.swayosd}/bin/swayosd-client --custom-message="Caffeine Off" --custom-icon="emblem-default"
fi
'';
in {home.packages = [caffeine-status caffeine caffeine-status-icon];}

15
home/scripts/default.nix Normal file
View File

@@ -0,0 +1,15 @@
{
imports = [
./nixy
./sounds
./brightness
./caffeine
./hyprpanel
./hyprfocus
./night-shift
./screenshot
./nerdfont-fzf
./notification
./system
];
}

View File

@@ -0,0 +1,52 @@
# - ## Hyprfocus
#-
#- A simple script to toggle focus on few windows in Hyprland.
#- (disable gaps, border, shadow, opacity, etc.)
#-
#- - `hyprfocus-on` - Enable hyprfocus.
#- - `hyprfocus-off` - Disable hyprfocus.
#- - `hyprfocus-toggle` - Toggle hyprfocus.
{pkgs, ...}: let
hyprfocus-on =
pkgs.writeShellScriptBin "hyprfocus-on"
# bash
''
hyprpanel-hide
hyprctl --batch "\
keyword animations:enabled 0;\
keyword decoration:shadow:enabled 0;\
keyword decoration:blur:enabled 0;\
keyword general:gaps_in 0;\
keyword general:gaps_out 0;\
keyword general:border_size 1;\
keyword decoration:rounding 0;\
keyword decoration:inactive_opacity 1;\
keyword decoration:active_opacity 1"
echo "1" > /tmp/hyprfocus
${pkgs.swayosd}/bin/swayosd-client --custom-message="Hyprfocus On" --custom-icon="emblem-default"
'';
hyprfocus-off =
pkgs.writeShellScriptBin "hyprfocus-off"
# bash
''
hyprctl reload
hyprpanel-show
rm /tmp/hyprfocus
${pkgs.swayosd}/bin/swayosd-client --custom-message="Hyprfocus Off" --custom-icon="emblem-default"
'';
hyprfocus-toggle =
pkgs.writeShellScriptBin "hyprfocus-toggle"
# bash
''
if [ -f /tmp/hyprfocus ]; then
hyprfocus-off
else
hyprfocus-on
fi
'';
in {home.packages = [hyprfocus-on hyprfocus-off hyprfocus-toggle];}

View File

@@ -0,0 +1,45 @@
# - ## Hyprpanel
#-
#- Quick scripts to toggle, reload, hide & show hyprpanel.
#-
#- - `hyprpanel-toggle` - Toggle hyprpanel (hide/show).
#- - `hyprpanel-show` - Show hyprpanel.
#- - `hyprpanel-hide` - Hide hyprpanel.
#- - `hyprpanel-reload` - Reload hyprpanel.
{pkgs, ...}: let
hyprpanel-toggle = pkgs.writeShellScriptBin "hyprpanel-toggle" ''
hyprpanel toggleWindow bar-0
hyprpanel toggleWindow bar-1
hyprpanel toggleWindow bar-2
hyprpanel toggleWindow bar-3
'';
hyprpanel-hide = pkgs.writeShellScriptBin "hyprpanel-hide" ''
status=$(hyprpanel isWindowVisible bar-0)
if [[ $status == "true" ]]; then
hyprpanel toggleWindow bar-0
fi
status=$(hyprpanel isWindowVisible bar-1)
if [[ $status == "true" ]]; then
hyprpanel toggleWindow bar-1
fi
'';
hyprpanel-show = pkgs.writeShellScriptBin "hyprpanel-show" ''
status=$(hyprpanel isWindowVisible bar-0)
if [[ $status == "false" ]]; then
hyprpanel toggleWindow bar-0
fi
status=$(hyprpanel isWindowVisible bar-1)
if [[ $status == "false" ]]; then
hyprpanel toggleWindow bar-1
fi
'';
hyprpanel-reload = pkgs.writeShellScriptBin "hyprpanel-reload" ''
[ $(pgrep "hyprpanel") ] && pkill hyprpanel
hyprctl dispatch exec hyprpanel
'';
in {
home.packages = [hyprpanel-toggle hyprpanel-reload hyprpanel-hide hyprpanel-show];
}

View File

@@ -0,0 +1,31 @@
# - ## Nerdfont FZF
#-
#- This module provides a script to search for Nerd Fonts icons using fzf.
#-
#- - `nerdfont-fzf` - Search for Nerd Fonts icons using fzf.
{
pkgs,
config,
...
}: let
nerdfont-fzf = pkgs.writeShellScriptBin "nerdfont-fzf" ''
icons=$(${pkgs.jq}/bin/jq -r 'to_entries[] | "\(.key):\(.value.char)"' "/home/${config.var.username}/.config/nerdfont_glyphnames.json" | awk -F: '{print "\033[95m "$2" \033[0m "$1}')
fzf_result=$(echo "$icons" | ${pkgs.fzf}/bin/fzf --ansi --border none | awk '{print $1}')
if [ -z "$fzf_result" ]; then
echo "No icon selected"
exit 1
fi
echo "Copied to clipboard: $fzf_result"
${pkgs.wl-clipboard}/bin/wl-copy "$fzf_result"
'';
in {
home.packages = [nerdfont-fzf];
xdg.configFile."nerdfont_glyphnames.json" = {
source = pkgs.fetchurl {
url = "https://raw.githubusercontent.com/ryanoasis/nerd-fonts/384b1825ea0037b0314f7f9c660a80c1ecdb219a/glyphnames.json";
hash = "sha256-Ps0dyFcMs51RMTthBOVSOf/lafPV/53JxuNSKlmZ7cc=";
};
};
}

View File

@@ -0,0 +1,71 @@
# - ## Night-Shift
#-
#- Night-Shift is a feature that reduces the amount of blue light emitted by your screen, which can help reduce eye strain and improve sleep quality. This module provides a set of scripts to control Night-Shift on your system.
#- It use hyprsunset to control the screen temperature.
#-
#- - `night-shift-on` activates Night-Shift.
#- - `night-shift-off` deactivates Night-Shift.
#- - `night-shift` toggles Night-Shift.
#- - `night-shift-status` checks if Night-Shift is active. (0/1)
#- - `night-shift-status-icon` checks if Night-Shift is active. (icon)
{pkgs, ...}: let
value = "4500"; # Default value for night-shift temperature
night-shift-on =
pkgs.writeShellScriptBin "night-shift-on"
# bash
''
${pkgs.hyprsunset}/bin/hyprsunset -t ${value} &
${pkgs.swayosd}/bin/swayosd-client --custom-message="Night-Shift On" --custom-icon="emblem-default"
'';
night-shift-off =
pkgs.writeShellScriptBin "night-shift-off"
# bash
''
pkill hyprsunset
${pkgs.swayosd}/bin/swayosd-client --custom-message="Night-Shift Off" --custom-icon="emblem-default"
'';
night-shift =
pkgs.writeShellScriptBin "night-shift"
# bash
''
if pidof "hyprsunset"; then
night-shift-off
else
night-shift-on
fi
'';
night-shift-status =
pkgs.writeShellScriptBin "night-shift-status"
# bash
''
if pidof "hyprsunset"; then
echo "1"
else
echo "0"
fi
'';
night-shift-status-icon =
pkgs.writeShellScriptBin "night-shift-status-icon"
# bash
''
if pidof "hyprsunset"; then
echo "󰖔"
else
echo "󰖕"
fi
'';
in {
home.packages = [
pkgs.hyprsunset
night-shift-on
night-shift-off
night-shift
night-shift-status
night-shift-status-icon
];
}

View File

@@ -0,0 +1,77 @@
# - ## Nixy
#-
#- Nixy is a simple script that I use to manage my NixOS system. It's a simple script that provides a menu to rebuild, test, update, collect garbage, clean boot menu, etc.
#-
#- - `nixy` - UI wizard to manage the system.
#- - `nixy rebuild` - Rebuild the system.
#- - `nixy ...` - ... see the script for more commands.
{ pkgs, config, ... }:
let
configDirectory = config.var.configDirectory;
nixy = pkgs.writeShellScriptBin "nixy"
# bash
''
function exec() {
$@
}
function ui(){
DEFAULT_ICON="󰘳"
# "icon;name;command"[]
apps=(
"󰑓;Rebuild;nixy rebuild"
"󰐊;Test;nixy test"
"󰚰;Update;nixy update"
";Collect Garbage;nixy gc"
"󰍜;Clean Boot Menu;nixy cb"
";List generation;nixy listgen"
"󰌌;Hyprland Keybindings;nvim ${configDirectory}/docs/KEYBINDINGS-HYPRLAND.md"
"󰋩;Wallpapers;zen https://github.com/anotherhadi/nixy-wallpapers"
)
# Apply default icons if empty:
for i in "''${!apps[@]}"; do
apps[i]=$(echo "''${apps[i]}" | sed 's/^;/'$DEFAULT_ICON';/')
done
fzf_result=$(printf "%s\n" "''${apps[@]}" | awk -F ';' '{print $1" "$2}' | fzf)
[[ -z $fzf_result ]] && exit 0
fzf_result=''${fzf_result/ /;}
line=$(printf "%s\n" "''${apps[@]}" | grep "$fzf_result")
command=$(echo "$line" | sed 's/^[^;]*;//;s/^[^;]*;//')
exec "$command"
exit $?
}
[[ $1 == "" ]] && ui
if [[ $1 == "rebuild" ]];then
cd ${configDirectory} && git add . && sudo nixos-rebuild switch --flake
elif [[ $1 == "test" ]];then
cd ${configDirectory} && git add . && sudo nixos-rebuild test --flake
elif [[ $1 == "update" ]];then
cd ${configDirectory} && nix flake update
elif [[ $1 == "gc" ]];then
echo "Starting Nix garbage collection..."
cd ${configDirectory} && \
echo "Cleaning up system garbage..." && \
sudo nix-collect-garbage -d && \
echo "Cleaning up user garbage..." && \
nix-collect-garbage -d && \
echo "Collecting garbage from Nix store..." && \
nix-store --gc && \
echo "Optimizing Nix store..." && \
nix-store --optimise
echo "Nix garbage collection complete."
elif [[ $1 == "cb" ]];then
sudo /run/current-system/bin/switch-to-configuration boot
elif [[ $1 == "listgen" ]];then
sudo nix-env -p /nix/var/nix/profiles/system --list-generations
else
echo "Unknown argument"
fi
'';
in { home.packages = [ nixy ]; }

View File

@@ -0,0 +1,31 @@
# - ## Notif
#-
# This file provides a script to send custom notifications using `notify-send`.
#-
#- - `notif {id} {title} {description}` - Sends a notification
{pkgs, ...}: let
notif =
pkgs.writeShellScriptBin "notif" # bash
''
# Shell script to send custom notifications
# Usage: notif "sender_id" "message" ["description"]
NOTIF_FOLDER="/tmp/notif"
sender_id=$1 # To overwrite existing notifications
title=$2
description=$3
[[ -d "$NOTIF_FOLDER" ]] || mkdir $NOTIF_FOLDER
[[ -f "$NOTIF_FOLDER/$sender_id" ]] || (echo "0" > "$NOTIF_FOLDER/$sender_id")
old_notification_id=$(cat "$NOTIF_FOLDER/$sender_id")
[[ -z "$old_notification_id" ]] && old_notification_id=0
${pkgs.libnotify}/bin/notify-send \
--replace-id="$old_notification_id" --print-id \
--app-name="$sender_id" \
"$title" \
"$description" \
> "$NOTIF_FOLDER/$sender_id"
'';
in {home.packages = [pkgs.libnotify notif];}

View File

@@ -0,0 +1,32 @@
# - ## Screenshot
#-
#- This module provides a script to take screenshots using `grimblast` and `swappy`.
#-
#- - `screenshot [region|window|monitor] [swappy]` - Take a screenshot of the region, window, or monitor. Optionally, use `swappy` to copy the screenshot to the clipboard.
{pkgs, ...}: let
screenshot = pkgs.writeShellScriptBin "screenshot" ''
if [[ $2 == "swappy" ]];then
folder="/tmp"
else
folder="$HOME/Pictures"
fi
filename="$(date +%Y-%m-%d_%H:%M:%S).png"
if [[ $1 == "window" ]];then
mode="active"
elif [[ $1 == "region" ]];then
mode="area"
elif [[ $1 == "monitor" ]];then
mode="output"
fi
${pkgs.grimblast}/bin/grimblast --notify --freeze copysave $mode "$folder/$filename" || exit 1
if [[ $2 == "swappy" ]];then
${pkgs.swappy}/bin/swappy -f "$folder/$filename" -o "$HOME/Pictures/$filename"
exit 0
fi
'';
in {
home.packages = [ screenshot pkgs.grim pkgs.grimblast ];
}

View File

@@ -0,0 +1,36 @@
# - ## Sound
#-
#- This module provides a set of scripts to control the volume of the default audio sink using `wpctl`.
#-
#- - `sound-up` increases the volume by 5%.
#- - `sound-down` decreases the volume by 5%.
#- - `sound-set [value]` sets the volume to the given value.
#- - `sound-toggle` toggles the mute state of the default audio sink.
{pkgs, ...}: let
increments = "5";
sound-change = pkgs.writeShellScriptBin "sound-change" ''
[[ $1 == "mute" ]] && wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle
[[ $1 == "up" ]] && wpctl set-volume @DEFAULT_AUDIO_SINK@ ''${2-${increments}}%+
[[ $1 == "down" ]] && wpctl set-volume @DEFAULT_AUDIO_SINK@ ''${2-${increments}}%-
[[ $1 == "set" ]] && wpctl set-volume @DEFAULT_AUDIO_SINK@ ''${2-100}%
'';
sound-up = pkgs.writeShellScriptBin "sound-up" ''
sound-change up ${increments}
'';
sound-set = pkgs.writeShellScriptBin "sound-set" ''
sound-change set ''${1-100}
'';
sound-down = pkgs.writeShellScriptBin "sound-down" ''
sound-change down ${increments}
'';
sound-toggle = pkgs.writeShellScriptBin "sound-toggle" ''
sound-change mute
'';
in {
home.packages = [sound-change sound-up sound-down sound-toggle sound-set];
}

View File

@@ -0,0 +1,69 @@
# - ## System
#-
#- Usefull quick scripts
#-
#- - `lock` - Lock the screen. (hyprlock)
#- - `powermode-toggle` - Toggle between performance and balanced power mode. (powerprofilesctl)
{pkgs, ...}: let
menu =
pkgs.writeShellScriptBin "menu"
# bash
''
if pgrep wofi; then
pkill wofi
else
wofi -p "Apps" --show drun
fi
'';
powermenu =
pkgs.writeShellScriptBin "powermenu"
# bash
''
if pgrep wofi >/dev/null; then
pkill wofi
exit 0
fi
declare -A actions=(
["󰌾 Lock"]="hyprlock"
["󰍃 Logout"]="hyprctl dispatch exit"
[" Suspend"]="systemctl suspend"
["󰑐 Reboot"]="systemctl reboot"
["󰿅 Shutdown"]="systemctl poweroff"
)
selected_option=$(
printf '%s\n' "''${!actions[@]}" | wofi -p "Powermenu" --dmenu
)
if [[ -n "$selected_option" ]]; then
action_command=''${actions["''$selected_option"]}
if [[ -n "$action_command" ]]; then
eval "$action_command"
fi
fi
'';
lock =
pkgs.writeShellScriptBin "lock"
# bash
''
${pkgs.hyprlock}/bin/hyprlock
'';
powermode-toggle =
pkgs.writeShellScriptBin "powermode-toggle"
# bash
''
current_profile=$(powerprofilesctl get)
if [ "$current_profile" = "performance" ]; then
powerprofilesctl set balanced
${pkgs.swayosd}/bin/swayosd-client --custom-message="Powermode set to balanced" --custom-icon="emblem-default"
else
powerprofilesctl set performance
${pkgs.swayosd}/bin/swayosd-client --custom-message="Powermode set to performance" --custom-icon="emblem-default"
fi
'';
in {home.packages = [lock powermode-toggle menu powermenu];}

View File

@@ -0,0 +1,30 @@
{
programs.ashell = {
enable = true;
settings = {
modules = {
center = [
"Window Title"
];
left = [
"Workspaces"
];
right = [
"SystemInfo"
[
"Clock"
"Privacy"
"Settings"
]
];
};
workspaces = {
visibilityMode = "MonitorSpecific";
};
};
systemd.enable = true;
};
}

View File

@@ -0,0 +1,32 @@
# Hypridle is a daemon that listens for user activity and runs commands when the user is idle.
{
pkgs,
lib,
...
}: {
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";
}
];
};
};
systemd.user.services.hypridle.Unit.After =
lib.mkForce "graphical-session.target";
}

View File

@@ -0,0 +1,52 @@
{config, ...}: let
animationSpeed = config.theme.animation-speed;
animationDuration =
if animationSpeed == "slow"
then "4"
else if animationSpeed == "medium"
then "2.5"
else "1.5";
borderDuration =
if animationSpeed == "slow"
then "10"
else if animationSpeed == "medium"
then "6"
else "3";
in {
wayland.windowManager.hyprland.settings = {
animations = {
enabled = true;
bezier = [
"linear, 0, 0, 1, 1"
"md3_standard, 0.2, 0, 0, 1"
"md3_decel, 0.05, 0.7, 0.1, 1"
"md3_accel, 0.3, 0, 0.8, 0.15"
"overshot, 0.05, 0.9, 0.1, 1.1"
"crazyshot, 0.1, 1.5, 0.76, 0.92"
"hyprnostretch, 0.05, 0.9, 0.1, 1.0"
"menu_decel, 0.1, 1, 0, 1"
"menu_accel, 0.38, 0.04, 1, 0.07"
"easeInOutCirc, 0.85, 0, 0.15, 1"
"easeOutCirc, 0, 0.55, 0.45, 1"
"easeOutExpo, 0.16, 1, 0.3, 1"
"softAcDecel, 0.26, 0.26, 0.15, 1"
"md2, 0.4, 0, 0.2, 1"
];
animation = [
"windows, 1, ${animationDuration}, md3_decel, popin 60%"
"windowsIn, 1, ${animationDuration}, md3_decel, popin 60%"
"windowsOut, 1, ${animationDuration}, md3_accel, popin 60%"
"border, 1, ${borderDuration}, default"
"fade, 1, ${animationDuration}, md3_decel"
"layersIn, 1, ${animationDuration}, menu_decel, slide"
"layersOut, 1, ${animationDuration}, menu_accel"
"fadeLayersIn, 1, ${animationDuration}, menu_decel"
"fadeLayersOut, 1, ${animationDuration}, menu_accel"
"workspaces, 1, ${animationDuration}, menu_decel, slide"
"specialWorkspace, 1, ${animationDuration}, md3_decel, slidevert"
];
};
};
}

View File

@@ -0,0 +1,75 @@
{ pkgs, ... }:
{
wayland.windowManager.hyprland.settings = {
bind = [
"$mod, return, exec, uwsm app -- ${pkgs.kitty}/bin/kitty" # Ghostty (terminal)
#"$mod,E, exec, uwsm app -- ${pkgs.xfce.thunar}/bin/thunar" # Thunar
"$mod, b, exec, uwsm app -- ${pkgs.brave}/bin/brave" # Brave Browser
"$mod, m, exec, uwsm app -- ${pkgs.thunderbird}/bin/thunderbird" # Proton Mail
#"$mod,L, exec, uwsm app -- ${pkgs.hyprlock}/bin/hyprlock" # Lock
"$mod, space, exec, vicinae toggle" # Launcher FIXME: broken
#"$mod,X, exec, powermenu" # Powermenu
#"$mod, space, exec, menu" # Launcher
"$shiftMod, space, exec, hyprfocus-toggle" # Toggle HyprFocus
"$mod, q, killactive," # Close window
"$mod, t, togglefloating," # Toggle Floating
"$mod, f, fullscreen" # Toggle Fullscreen
"$mod, j, layoutmsg, cyclenext" # Move focus Down
"$mod, k, layoutmsg, cycleprev" # Move focus Up
"$altMod, j, layoutmsg, swapnext" # Move focus Down
"$altMod, k, layoutmsg, swapprev" # Move focus Up
"$mod, x, focusmonitor, +1" # Focus next monitor
"$altMod, x, movewindow, mon:+1"
"$altMod, h, layoutmsg, addmaster" # Add to master
"$altMod, l, layoutmsg, removemaster" # Remove from master
"$mod, print, exec, screenshot region" # Screenshot region
", PRINT, exec, screenshot monitor" # Screenshot monitor
"$mod, w, workspace, 1"
"$mod, e, workspace, 2"
"$mod, r, workspace, 3"
"$mod, i, workspace, 11"
"$mod, o, workspace, 12"
"$mod, p, workspace, 13"
"$altMod, w, movetoworkspace, 1"
"$altMod, e, movetoworkspace, 2"
"$altMod, r, movetoworkspace, 3"
"$altMod, i, movetoworkspace, 11"
"$altMod, o, movetoworkspace, 12"
"$altMod, p, movetoworkspace, 13"
"$mod, z, togglespecialworkspace, scratchpad"
];
bindm = [
"$mod, mouse:272, movewindow" # Move Window (mouse)
"$mod, mouse:274, resizewindow" # Resize Window (mouse)
];
binde = [
"$mod, h, layoutmsg, mfact -0.01" # Move focus left
"$mod, l, layoutmsg, mfact +0.01" # Move focus Right
];
bindl = [
",XF86AudioMute, exec, sound-toggle" # Toggle Mute
",XF86AudioPlay, exec, ${pkgs.playerctl}/bin/playerctl play-pause" # Play/Pause Song
",XF86AudioNext, exec, ${pkgs.playerctl}/bin/playerctl next" # Next Song
",XF86AudioPrev, exec, ${pkgs.playerctl}/bin/playerctl previous" # Previous Song
",switch:Lid Switch, exec, ${pkgs.hyprlock}/bin/hyprlock" # Lock when closing Lid
];
bindle = [
",XF86AudioRaiseVolume, exec, sound-up" # Sound Up
",XF86AudioLowerVolume, exec, sound-down" # Sound Down
",XF86MonBrightnessUp, exec, brightness-up" # Brightness Up
",XF86MonBrightnessDown, exec, brightness-down" # Brightness Down
];
};
}

View File

@@ -0,0 +1,184 @@
# Hyprland is a dynamic tiling Wayland compositor that is highly customizable and performant.
{
pkgs,
config,
lib,
...
}:
let
border-size = config.theme.border-size;
gaps-in = config.theme.gaps-in;
gaps-out = config.theme.gaps-out;
active-opacity = config.theme.active-opacity;
inactive-opacity = config.theme.inactive-opacity;
rounding = config.theme.rounding;
blur = config.theme.blur;
keyboardLayout = config.var.keyboardLayout;
background = "rgb(" + config.lib.stylix.colors.base00 + ")";
in
{
imports = [
./animations.nix
./bindings.nix
./polkitagent.nix
];
home.packages = with pkgs; [
qt5.qtwayland
qt6.qtwayland
libsForQt5.qt5ct
qt6Packages.qt6ct
hyprshot
hyprpicker
swappy
imv
wf-recorder
wlr-randr
wl-clipboard
brightnessctl
gnome-themes-extra
libva
dconf
wayland-utils
wayland-protocols
glib
direnv
meson
];
wayland.windowManager.hyprland = {
enable = true;
xwayland.enable = true;
systemd = {
enable = false;
variables = [
"--all"
]; # https://wiki.hyprland.org/Nix/Hyprland-on-Home-Manager/#programs-dont-work-in-systemd-services-but-do-on-the-terminal
};
package = null;
portalPackage = null;
settings = {
"$mod" = "SUPER";
"$shiftMod" = "SUPER_SHIFT";
"$altMod" = "SUPER_ALT";
exec-once = [
"systemctl --user enable --now hyprpaper.service &"
];
monitor = config.var.hyprland.monitor;
env = [
"XDG_CURRENT_DESKTOP,Hyprland"
"MOZ_ENABLE_WAYLAND,1"
"ANKI_WAYLAND,1"
"DISABLE_QT5_COMPAT,0"
"NIXOS_OZONE_WL,1"
"XDG_SESSION_TYPE,wayland"
"XDG_SESSION_DESKTOP,Hyprland"
"QT_AUTO_SCREEN_SCALE_FACTOR,1"
"QT_QPA_PLATFORM=wayland,xcb"
"QT_WAYLAND_DISABLE_WINDOWDECORATION,1"
"ELECTRON_OZONE_PLATFORM_HINT,auto"
"__GL_GSYNC_ALLOWED,0"
"__GL_VRR_ALLOWED,0"
"DISABLE_QT5_COMPAT,0"
"DIRENV_LOG_FORMAT,"
"WLR_DRM_NO_ATOMIC,1"
"WLR_BACKEND,vulkan"
"WLR_RENDERER,vulkan"
"WLR_NO_HARDWARE_CURSORS,1"
"SDL_VIDEODRIVER,wayland"
"CLUTTER_BACKEND,wayland"
];
workspace = config.var.hyprland.workspace ++ [
"special:scratchpad, on-created-empty:[float; size monitor_w/1.5 monitor_h/1.5; center] $TERMINAL"
];
cursor = {
no_hardware_cursors = true;
default_monitor = "0";
};
general = {
resize_on_border = true;
gaps_in = gaps-in;
gaps_out = gaps-out;
border_size = border-size;
layout = "master";
"col.inactive_border" = lib.mkForce background;
};
decoration = {
dim_special = 0.3;
active_opacity = active-opacity;
inactive_opacity = inactive-opacity;
rounding = rounding;
shadow = {
enabled = true;
range = 20;
render_power = 3;
};
blur = {
enabled = if blur then "true" else "false";
size = 18;
};
};
master = {
new_status = true;
allow_small_split = true;
mfact = 0.65;
};
misc = {
vfr = true;
disable_hyprland_logo = true;
disable_splash_rendering = true;
disable_autoreload = false;
focus_on_activate = true;
new_window_takes_over_fullscreen = 2;
};
windowrule = [
"match:title hyprpanel-settings, float on"
"match:class xdg-desktop-portal-gtk, float on, center on, size monitor_w/2 monitor_h/2"
# Bitwarden extension
# idle inhibit while watching videos
#"idleinhibit focus, class:^(mpv|.+exe|celluloid)$"
#"idleinhibit focus, class:^(zen)$, title:^(.*YouTube.*)$"
#"idleinhibit fullscreen, class:^(zen)$"
#"dimaround, class:^(gcr-prompter)$"
#"dimaround, class:^(xdg-desktop-portal-gtk)$"
#"dimaround, class:^(polkit-gnome-authentication-agent-1)$"
#"dimaround, class:^(zen)$, title:^(File Upload)$"
];
layerrule = [
"match:namespace vicinae, no_anim on, blur on, ignore_alpha 0"
#"no_anim, launcher"
#"no_anim, ^ags-.*"
];
input = {
kb_layout = keyboardLayout;
kb_options = "caps:escape";
follow_mouse = 1;
sensitivity = 0.5;
repeat_delay = 300;
repeat_rate = 50;
numlock_by_default = true;
touchpad = {
natural_scroll = true;
clickfinger_behavior = true;
};
};
};
};
}

View File

@@ -0,0 +1,6 @@
# HyprPolkitAgent is a simple polkit agent for wayland compositors
{pkgs, ...}: {
home.packages = with pkgs; [hyprpolkitagent];
wayland.windowManager.hyprland.settings.exec-once = ["systemctl --user start hyprpolkitagent"];
}

View File

@@ -0,0 +1,72 @@
# Hyprlock is a lockscreen for Hyprland
{ config, lib, ... }:
let
foreground = "rgba(${config.theme.textColorOnWallpaper}ee)";
font = config.stylix.fonts.serif.name;
in {
programs.hyprlock = {
enable = true;
settings = {
general = {
ignore_empty_input = true;
hide_cursor = true;
};
background = { brightness = 0.7172; };
label = [
{
# Day-Month-Date
monitor = "";
text = ''cmd[update:1000] echo -e "$(date +"%A, %B %d")"'';
color = foreground;
font_size = 28;
font_family = font + " Bold";
position = "0, 490";
halign = "center";
valign = "center";
}
# Time
{
monitor = "";
text = ''cmd[update:1000] echo "<span>$(date +"%I:%M")</span>"'';
color = foreground;
font_size = 160;
font_family = "steelfish outline regular";
position = "0, 370";
halign = "center";
valign = "center";
}
# USER
{
monitor = "";
text = " $USER";
color = foreground;
font_size = 18;
font_family = font + " Bold";
position = "0, -180";
halign = "center";
valign = "center";
}
];
# INPUT FIELD
input-field = lib.mkForce {
size = "300, 60";
outline_thickness = 2;
dots_size = 0.2; # Scale of input-field height, 0.2 - 0.8
dots_spacing = 0.2; # Scale of dots' absolute size, 0.0 - 1.0
dots_center = true;
outer_color = "rgba(25, 25, 25, 0)";
inner_color = "rgba(25, 25, 25, 0.1)";
font_color = foreground;
fade_on_empty = false;
font_family = font + " Bold";
placeholder_text = "<i>🔒 Enter Password</i>";
position = "0, -250";
halign = "center";
valign = "center";
};
};
};
}

View File

@@ -0,0 +1,249 @@
# Hyprpanel is the bar on top of the screen
# Display information like workspaces, battery, wifi, ...
{ config, ... }:
let
transparentButtons = config.theme.bar.transparentButtons;
accent = "#${config.lib.stylix.colors.base0D}";
accent-alt = "#${config.lib.stylix.colors.base03}";
background = "#${config.lib.stylix.colors.base00}";
background-alt = "#${config.lib.stylix.colors.base01}";
foreground = "#${config.lib.stylix.colors.base05}";
foregroundOnWallpaper = "#${config.theme.textColorOnWallpaper}";
font = "${config.stylix.fonts.serif.name}";
fontSizeForHyprpanel = "${toString config.stylix.fonts.sizes.desktop}px";
rounding = config.theme.rounding;
border-size = config.theme.border-size;
gaps-out = config.theme.gaps-out;
gaps-in = config.theme.gaps-in;
floating = config.theme.bar.floating;
transparent = config.theme.bar.transparent;
position = config.theme.bar.position; # "top" ou "bottom"
notificationOpacity = 90;
location = config.var.location;
homeDir = "/home/${config.var.username}";
in
{
wayland.windowManager.hyprland.settings.exec-once = [ "hyprpanel" ];
programs.hyprpanel = {
enable = true;
settings = {
bar.layouts = {
"*" = {
left = [
"dashboard"
"workspaces"
"windowtitle"
];
middle = [
"media"
];
right = [
"systray"
"volume"
"bluetooth"
"battery"
"network"
"clock"
"notifications"
];
};
};
theme.font.name = font;
theme.font.size = fontSizeForHyprpanel;
theme.bar.outer_spacing = if floating && transparent then "0px" else "8px";
theme.bar.buttons.y_margins = if floating && transparent then "0px" else "8px";
theme.bar.buttons.spacing = "0.3em";
theme.bar.buttons.radius =
(if transparent then toString rounding else toString (rounding - 8)) + "px";
theme.bar.floating = floating;
theme.bar.buttons.padding_x = "0.8rem";
theme.bar.buttons.padding_y = "0.4rem";
theme.bar.margin_top = (if position == "top" then toString (gaps-in * 2) else "0") + "px";
theme.bar.margin_bottom = (if position == "top" then "0" else toString (gaps-in * 2)) + "px";
theme.bar.margin_sides = toString gaps-out + "px";
theme.bar.border_radius = toString rounding + "px";
theme.bar.transparent = transparent;
theme.bar.location = position;
theme.bar.dropdownGap = "4.5em";
theme.bar.menus.shadow = if transparent then "0 0 0 0" else "0px 0px 3px 1px #16161e";
theme.bar.buttons.style = "default";
theme.bar.buttons.monochrome = true;
theme.bar.menus.monochrome = true;
theme.bar.menus.card_radius = toString rounding + "px";
theme.bar.menus.border.size = toString border-size + "px";
theme.bar.menus.border.radius = toString rounding + "px";
theme.bar.menus.menu.media.card.tint = 90;
bar.launcher.icon = "";
bar.workspaces.show_numbered = false;
bar.workspaces.workspaces = 3;
bar.workspaces.numbered_active_indicator = "color";
bar.workspaces.monitorSpecific = true;
bar.workspaces.applicationIconEmptyWorkspace = "";
bar.workspaces.showApplicationIcons = true;
bar.workspaces.showWsIcons = true;
bar.workspaces.ignored = "-98"; # NOTE: Ignore special:scratchpad workspace. Hyprpanel only supports workspace numbers
#bar.workspaces.ignoredWorkspaces = "/scratchpad/i";
#bar.workspaces.ignored_workspaces = "/scratchpad/i";
bar.windowtitle.label = true;
bar.volume.label = false;
bar.network.truncation_size = 12;
bar.bluetooth.label = false;
bar.clock.format = "%a %b %d %H:%M";
bar.notifications.show_total = true;
bar.media.show_active_only = true;
bar.customModules.updates.pollingInterval = 1440000;
notifications.position = "top right";
notifications.showActionsOnHover = true;
theme.notification.opacity = notificationOpacity;
theme.notification.enableShadow = true;
theme.notification.border_radius = toString rounding + "px";
theme.osd.enable = true;
theme.osd.orientation = "vertical";
theme.osd.location = "left";
theme.osd.radius = toString rounding + "px";
theme.osd.margins = "0px 0px 0px 10px";
theme.osd.muted_zero = true;
menus.clock.weather.location = location;
menus.clock.weather.unit = "metric";
menus.dashboard.powermenu.confirmation = false;
menus.dashboard.powermenu.avatar.image = "~/.face.icon";
menus.dashboard.shortcuts.left.shortcut1.icon = "";
menus.dashboard.shortcuts.left.shortcut1.command = "zen";
menus.dashboard.shortcuts.left.shortcut1.tooltip = "Zen";
menus.dashboard.shortcuts.left.shortcut2.icon = "󰅶";
menus.dashboard.shortcuts.left.shortcut2.command = "caffeine";
menus.dashboard.shortcuts.left.shortcut2.tooltip = "Caffeine";
menus.dashboard.shortcuts.left.shortcut3.icon = "󰖔";
menus.dashboard.shortcuts.left.shortcut3.command = "night-shift";
menus.dashboard.shortcuts.left.shortcut3.tooltip = "Night-shift";
menus.dashboard.shortcuts.left.shortcut4.icon = "";
menus.dashboard.shortcuts.left.shortcut4.command = "menu";
menus.dashboard.shortcuts.left.shortcut4.tooltip = "Search Apps";
menus.dashboard.shortcuts.right.shortcut1.icon = "";
menus.dashboard.shortcuts.right.shortcut1.command = "hyprpicker -a";
menus.dashboard.shortcuts.right.shortcut1.tooltip = "Color Picker";
menus.dashboard.shortcuts.right.shortcut3.icon = "󰄀";
menus.dashboard.shortcuts.right.shortcut3.command = "screenshot region swappy";
menus.dashboard.shortcuts.right.shortcut3.tooltip = "Screenshot";
menus.dashboard.directories.left.directory1.label = " Home";
menus.dashboard.directories.left.directory1.command = "xdg-open ${homeDir}";
menus.dashboard.directories.left.directory2.label = "󰲂 Documents";
menus.dashboard.directories.left.directory2.command = "xdg-open ${homeDir}/Documents";
menus.dashboard.directories.left.directory3.label = "󰉍 Downloads";
menus.dashboard.directories.left.directory3.command = "xdg-open ${homeDir}/Downloads";
menus.dashboard.directories.right.directory1.label = " Desktop";
menus.dashboard.directories.right.directory1.command = "xdg-open ${homeDir}/Desktop";
menus.dashboard.directories.right.directory2.label = " Videos";
menus.dashboard.directories.right.directory2.command = "xdg-open ${homeDir}/Videos";
menus.dashboard.directories.right.directory3.label = "󰉏 Pictures";
menus.dashboard.directories.right.directory3.command = "xdg-open ${homeDir}/Pictures";
menus.power.lowBatteryNotification = true;
wallpaper.enable = false;
# theme.bar.buttons.workspaces.hover = accent-alt;
# theme.bar.buttons.workspaces.active = accent;
# theme.bar.buttons.workspaces.available = accent-alt;
# theme.bar.buttons.workspaces.occupied = accent-alt;
#
# theme.bar.menus.background = background;
# theme.bar.menus.cards = background-alt;
# theme.bar.menus.label = foreground;
# theme.bar.menus.text = foreground;
# theme.bar.menus.border.color = accent;
# theme.bar.menus.popover.text = foreground;
# theme.bar.menus.popover.background = background-alt;
# theme.bar.menus.listitems.active = accent;
# theme.bar.menus.icons.active = accent;
# theme.bar.menus.switch.enabled = accent;
# theme.bar.menus.check_radio_button.active = accent;
# theme.bar.menus.buttons.default = accent;
# theme.bar.menus.buttons.active = accent;
# theme.bar.menus.iconbuttons.active = accent;
# theme.bar.menus.progressbar.foreground = accent;
# theme.bar.menus.slider.primary = accent;
# theme.bar.menus.tooltip.background = background-alt;
# theme.bar.menus.tooltip.text = foreground;
# theme.bar.menus.dropdownmenu.background = background-alt;
# theme.bar.menus.dropdownmenu.text = foreground;
# theme.bar.background =
# background
# + (
# if transparentButtons && transparent
# then "00"
# else ""
# );
# theme.bar.buttons.text =
# if transparent && transparentButtons
# then foregroundOnWallpaper
# else foreground;
# theme.bar.buttons.background =
# (
# if transparent
# then background
# else background-alt
# )
# + (
# if transparentButtons
# then "00"
# else ""
# );
# theme.bar.buttons.icon = accent;
#
# theme.bar.buttons.notifications.background = background-alt;
# theme.bar.buttons.hover = background;
# theme.bar.buttons.notifications.hover = background;
# theme.bar.buttons.notifications.total = accent;
# theme.bar.buttons.notifications.icon = accent;
#
# theme.osd.bar_color = accent;
# theme.osd.bar_overflow_color = accent-alt;
# theme.osd.icon = background;
# theme.osd.icon_container = accent;
# theme.osd.label = accent;
# theme.osd.bar_container = background-alt;
#
# theme.bar.menus.menu.media.background.color = background-alt;
# theme.bar.menus.menu.media.card.color = background-alt;
#
# theme.notification.background = background-alt;
# theme.notification.actions.background = accent;
# theme.notification.actions.text = foreground;
# theme.notification.label = accent;
# theme.notification.border = background-alt;
# theme.notification.text = foreground;
# theme.notification.labelicon = accent;
# theme.notification.close_button.background = background-alt;
# theme.notification.close_button.label = "#f38ba8";
};
};
}

View File

@@ -0,0 +1,14 @@
# Hyprpaper is used to set the wallpaper on the system
{lib, ...}: {
# The wallpaper is set by stylix
services.hyprpaper = {
enable = true;
settings = {
ipc = "on";
splash = false;
splash_offset = 2.0;
};
};
systemd.user.services.hyprpaper.Unit.After =
lib.mkForce "graphical-session.target";
}

View File

@@ -0,0 +1,22 @@
{
services = {
hyprsunset = {
enable = true;
settings = {
max-gamma = 150;
profile = [
{
time = "7:30";
identity = true;
}
{
time = "23:00";
temperature = 3000;
gamma = 0.8;
}
];
};
};
};
}

View File

@@ -0,0 +1,98 @@
# Mime type associations for the system.
{ lib, ... }:
with lib;
let
defaultApps = {
# check desktop files here: `ls $(echo $XDG_DATA_DIRS| sed "s/:/ /g")`
browser = [ "brave-browser.desktop" ];
text = [ "nixCats.desktop" ];
image = [ "imv-dir.desktop" ];
audio = [ "mpv.desktop" ];
video = [ "mpv.desktop" ];
directory = [ "thunar.desktop" ];
office = [ "libreoffice.desktop" ];
pdf = [ "org.pwmt.zathura.desktop" ];
terminal = [ "kitty.desktop" ];
discord = [ "discord.desktop" ];
archive = [ "xarchiver.desktop" ];
};
mimeMap = {
text = [ "text/plain" ];
image = [
"image/bmp"
"image/gif"
"image/jpeg"
"image/jpg"
"image/png"
"image/svg+xml"
"image/tiff"
"image/vnd.microsoft.icon"
"image/webp"
];
audio = [
"audio/aac"
"audio/mpeg"
"audio/ogg"
"audio/opus"
"audio/wav"
"audio/webm"
"audio/x-matroska"
];
video = [
"video/mp2t"
"video/mp4"
"video/mpeg"
"video/ogg"
"video/webm"
"video/x-flv"
"video/x-matroska"
"video/x-msvideo"
];
directory = [ "inode/directory" ];
browser = [
"text/html"
"x-scheme-handler/about"
"x-scheme-handler/http"
"x-scheme-handler/https"
"x-scheme-handler/unknown"
];
office = [
"application/vnd.oasis.opendocument.text"
"application/vnd.oasis.opendocument.spreadsheet"
"application/vnd.oasis.opendocument.presentation"
"application/vnd.openxmlformats-officedocument.wordprocessingml.document"
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
"application/vnd.openxmlformats-officedocument.presentationml.presentation"
"application/msword"
"application/vnd.ms-excel"
"application/vnd.ms-powerpoint"
"application/rtf"
];
pdf = [ "application/pdf" ];
terminal = [ "terminal" ];
archive = [
"application/zip"
"application/rar"
"application/7z"
"application/*tar"
];
discord = [ "x-scheme-handler/discord" ];
};
associations =
with lists;
listToAttrs (
flatten (mapAttrsToList (key: map (type: attrsets.nameValuePair type defaultApps."${key}")) mimeMap)
);
in
{
xdg = {
configFile."mimeapps.list".force = true;
mimeApps = {
enable = true;
associations.added = associations;
defaultApplications = associations;
};
};
}

View File

@@ -0,0 +1,8 @@
# Udiskie is a simple daemon that uses udisks to automatically mount removable storage devices.
{
services.udiskie = {
enable = true;
notify = true;
automount = true;
};
}

View File

@@ -0,0 +1,13 @@
{ inputs, ... }:
{
imports = [ inputs.vicinae.homeManagerModules.default ];
services.vicinae = {
enable = true;
autoStart = true;
};
wayland.windowManager.hyprland.settings.exec-once = [
"systemctl enable --now --user vicinae.service"
];
}

View File

@@ -0,0 +1,102 @@
# Wofi is a launcher for Wayland, inspired by rofi.
{
config,
pkgs,
lib,
...
}:
let
accent = "#${config.lib.stylix.colors.base0D}";
background = "#${config.lib.stylix.colors.base00}";
background-alt = "#${config.lib.stylix.colors.base01}";
foreground = "#${config.lib.stylix.colors.base05}";
font = config.stylix.fonts.serif.name;
rounding = config.theme.rounding;
font-size = config.stylix.fonts.sizes.popups;
in
{
home.packages = with pkgs; [ wofi-emoji ];
programs.wofi = {
enable = true;
settings = {
allow_markup = true;
width = 450;
show = "drun";
prompt = "Apps";
normal_window = true;
height = 305;
allow_images = true;
image_size = 24;
insensitive = true;
hide_scroll = true;
no_actions = true;
gtk_dark = true;
};
style =
lib.mkForce
# css
''
* {
font-family: "${font}";
font-weight: 500;
font-size: ${toString font-size}px;
}
#window {
background-color: ${background};
color: ${foreground};
border-radius: ${toString rounding}px;
}
#outer-box {
padding: 20px;
}
#input {
background-color: ${background-alt};
border: 0px solid ${accent};
color: ${foreground};
padding: 8px 12px;
}
#scroll {
margin-top: 20px;
}
#inner-box {}
#img {
padding-right: 8px;
}
#text {
color: ${foreground};
}
#text:selected {
color: ${foreground};
}
#entry {
padding: 6px;
}
#entry:selected {
background-color: ${accent};
color: ${foreground};
}
#unselected {}
#selected {}
#input,
#entry:selected {
border-radius: ${toString rounding}px;
}
'';
};
}

View File

@@ -0,0 +1,14 @@
# Zathura is a PDF viewer
{
programs.zathura = {
enable = true;
options = {
guioptions = "v";
adjust-open = "width";
statusbar-basename = true;
render-loading = false;
scroll-step = 120;
};
};
}