This commit is contained in:
2026-07-12 15:25:55 -03:00
commit 29377d0c9a
160 changed files with 6138 additions and 0 deletions
Generated
+185
View File
@@ -0,0 +1,185 @@
{
"nodes": {
"awsvpnclient": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1709887232,
"narHash": "sha256-SpJv0a1QORJ0V1I2qWMGGTjkk3i3gb41ELOetlmM8oA=",
"owner": "ymatsiuk",
"repo": "awsvpnclient",
"rev": "56ca114e3f7fe4db9d745a0ab8ed70c6bd803a8f",
"type": "github"
},
"original": {
"owner": "ymatsiuk",
"repo": "awsvpnclient",
"type": "github"
}
},
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1701680307,
"narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "4022d587cbbfd70fe950c1e2083a02621806a725",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"home-manager": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1783740085,
"narHash": "sha256-qajyHfZY29G2oEQk+uHxmsJcRoBUBXP9maTpFlwP/dI=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "3cd22efe6471dc7365c822bd9ad73a21e55f38fb",
"type": "github"
},
"original": {
"owner": "nix-community",
"ref": "release-26.05",
"repo": "home-manager",
"type": "github"
}
},
"home-manager-deck": {
"inputs": {
"nixpkgs": [
"nixpkgs-deck"
]
},
"locked": {
"lastModified": 1783823409,
"narHash": "sha256-OI4IkRjRXa1e7hYmCGJDPDq5H/kPwhsyoS80cNUF9fI=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "7566825d4652a1b885bd4ce65bd9e8def432fec9",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "home-manager",
"type": "github"
}
},
"home-manager_2": {
"inputs": {
"nixpkgs": [
"zen-browser",
"nixpkgs"
]
},
"locked": {
"lastModified": 1782839684,
"narHash": "sha256-vzs4SBgPsK4aNzlJR2PpFwtARazXMOxZonQnDz0YHxk=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "2a37d71bbe69e1522ddabf03a4cea0374958bdbe",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "home-manager",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1783703440,
"narHash": "sha256-O3/YajjWo001VUIgD8BwaRdSNLUFe7nZ1qV5TwhRBcw=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "8f0500b9660505dc3cb647775fe9a978a74b5283",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-26.05",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-deck": {
"locked": {
"lastModified": 1783776592,
"narHash": "sha256-UgCQzxeWI75XM8G+hPrPh+MKzEPjG3SpAj7dtqSbksA=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "e7a3ca8092b61ff85b6a45bf863ea2b2d6a661b3",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"awsvpnclient": "awsvpnclient",
"home-manager": "home-manager",
"home-manager-deck": "home-manager-deck",
"nixpkgs": "nixpkgs",
"nixpkgs-deck": "nixpkgs-deck",
"zen-browser": "zen-browser"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"zen-browser": {
"inputs": {
"home-manager": "home-manager_2",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1783866614,
"narHash": "sha256-o2h5BfVz9MPIERBPVHtvQGilphtNn5+cCuqqfY5Lkq8=",
"owner": "0xc000022070",
"repo": "zen-browser-flake",
"rev": "51602966429e8ccae61324e56b51c37308d1b64e",
"type": "github"
},
"original": {
"owner": "0xc000022070",
"repo": "zen-browser-flake",
"type": "github"
}
}
},
"root": "root",
"version": 7
}
+64
View File
@@ -0,0 +1,64 @@
{
description = "jpporta's NixOS and Home Manager configurations";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-26.05";
nixpkgs-deck = {
url = "github:NixOS/nixpkgs/nixos-unstable";
};
home-manager = {
url = "github:nix-community/home-manager/release-26.05";
inputs.nixpkgs.follows = "nixpkgs";
};
home-manager-deck = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs-deck";
};
zen-browser = {
url = "github:0xc000022070/zen-browser-flake";
inputs.nixpkgs.follows = "nixpkgs";
};
awsvpnclient = {
url = "github:ymatsiuk/awsvpnclient";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
inputs:
let
systems = [
"x86_64-linux"
"aarch64-linux"
];
in
{
nixosConfigurations.jpporta-nixos = inputs.nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = { inherit inputs; };
modules = [
./hosts/jpporta-nixos/configuration.nix
inputs.home-manager.nixosModules.home-manager
{
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
backupFileExtension = "bak";
extraSpecialArgs = { inherit inputs; };
users.jpporta = import ./hosts/jpporta-nixos/home.nix;
};
}
];
};
homeConfigurations.jpporta-deck = inputs.home-manager-deck.lib.homeManagerConfiguration {
pkgs = inputs.nixpkgs-deck.legacyPackages.aarch64-linux;
extraSpecialArgs = { inherit inputs; };
modules = [
./hosts/writter-deck/home.nix
];
};
};
}
+217
View File
@@ -0,0 +1,217 @@
{
config,
lib,
pkgs,
inputs,
...
}:
{
imports = [
# Include the results of the hardware scan.
./hardware-configuration.nix
../../modules/nixos/hyprland
../../modules/nixos/steam
../../modules/nixos/awsvpn
];
# Bootloader
boot = {
loader.systemd-boot.enable = true;
loader.efi.canTouchEfiVariables = true;
initrd = {
kernelModules = [ "amdgpu" ];
# Encrypted Drives
luks.devices = {
"cryptstorage-nvme" = {
device = "/dev/disk/by-uuid/6331fbf8-5f21-4e72-b196-f31788f61d28";
keyFile = "/storage.key";
allowDiscards = true;
};
"cryptstorage-ssd" = {
device = "/dev/disk/by-uuid/8f275b47-c2fd-4b80-80e2-9dfba3279607";
keyFile = "/storage.key";
allowDiscards = true;
};
"cryptstorage-hd" = {
device = "/dev/disk/by-uuid/ef1bc263-b241-48c6-a93d-1a2497c1fa1d";
keyFile = "/storage.key";
};
};
secrets = {
"/storage.key" = "/etc/secrets/storage.key";
};
};
};
# Mount Points
fileSystems = {
"/mnt/work" = {
device = "/dev/mapper/cryptstorage-nvme";
fsType = "ext4";
options = [
"nofail"
"x-systemd.device-timeout=10s"
];
};
"/mnt/documents" = {
device = "/dev/mapper/cryptstorage-ssd";
fsType = "ext4";
options = [
"nofail"
"x-systemd.device-timeout=10s"
];
};
"/mnt/storage" = {
device = "/dev/mapper/cryptstorage-hd";
fsType = "ext4";
options = [
"nofail"
"x-systemd.device-timeout=10s"
];
};
};
# Networking
networking = {
hostName = "jpporta-nixos";
networkmanager.enable = true;
nameservers = [ "192.168.0.200" ];
};
# Locale
time.timeZone = "America/Sao_Paulo";
i18n.defaultLocale = "en_US.UTF-8";
i18n.inputMethod = {
enable = true;
type = "fcitx5";
fcitx5.waylandFrontend = true;
};
# User
users.users.jpporta = {
isNormalUser = true;
description = "jpporta";
extraGroups = [
"wheel"
"networkmanager"
"audio"
"video"
"docker"
];
shell = pkgs.zsh;
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHtBfMUaNtpUYOi0dFsGsAv/ypw535+SouH7fn8eYDvr writterdeck"
];
};
nix.settings.experimental-features = [
"nix-command"
"flakes"
];
# Refactored Config
custom = {
hyprland.enable = true;
steam.enable = true;
};
##------------------------------
programs = {
zsh.enable = true;
};
# System Packages
environment.systemPackages = with pkgs; [
vim
git
wget
curl
htop
wofi
waybar
ollama-rocm
glib
gsettings-desktop-schemas
];
virtualisation.docker.enable = true; # docker, buildx
virtualisation.virtualbox.host.enable = true;
services = {
resolved = {
enable = true;
settings = {
Resolve = {
DNSOverTLS = "opportunistic";
DNSSEC = "false"; # delegate DNSSEC to Pi-hole / its upstream
FallbackDNS = [ "1.1.1.1#cloudflare-dns.com" ]; # only if Pi-hole is unreachable
};
};
};
pulseaudio.enable = false; # make sure the old one is off
pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true; # apps expecting pulseaudio still work
jack.enable = true; # only if you use jack apps (reaper, etc.)
wireplumber.enable = true;
};
keyd = {
enable = true;
keyboards.default = {
ids = [ "*" ]; # or specific vendor:product ids
settings = {
main = {
capslock = "overload(control, esc)"; # translate your default.conf here
};
};
};
};
postgresql.enable = true;
redis.servers."".enable = true; # valkey/redis
syncthing = {
enable = true;
user = "jpporta";
group = "users";
dataDir = "/home/jpporta";
configDir = "/home/jpporta/.config/syncthing";
};
};
security.rtkit.enable = true; # lets pipewire get realtime priority
# TODO: remove later. Required by Teleo old tools
systemd.services.docker.environment.DOCKER_MIN_API_VERSION = "1.24";
hardware.bluetooth.enable = true; # bluez
networking.firewall.enable = true; # replaces ufw
zramSwap.enable = true; # replaces zram-generator
boot.extraModulePackages = [ config.boot.kernelPackages.v4l2loopback ];
boot.kernelModules = [ "v4l2loopback" ];
boot.extraModprobeConfig = ''
options v4l2loopback devices=1 video_nr=10 card_label="OBS Cam" exclusive_caps=1
'';
programs.obs-studio = {
enable = true;
enableVirtualCamera = true; # sets up the udev/module glue for you
plugins = with pkgs.obs-studio-plugins; [
obs-pipewire-audio-capture # capture individual app audio on wayland
obs-backgroundremoval # green-screen without a green screen
obs-vkcapture # game capture for vulkan/opengl on wayland
wlrobs # wlroots screen capture (not for hyprland — use pipewire portal)
];
};
programs.awsVpnClient.enable = true;
programs.dconf.enable = true;
# OpenSSH
services.openssh.enable = true;
programs.mosh.enable = true;
nixpkgs.config.allowUnfree = true;
system.stateVersion = "26.05";
}
@@ -0,0 +1,52 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{
config,
lib,
pkgs,
modulesPath,
...
}:
{
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];
boot = {
initrd.availableKernelModules = [
"nvme"
"ahci"
"xhci_pci"
"usbhid"
"usb_storage"
"sd_mod"
];
initrd.kernelModules = [ ];
kernelModules = [ "kvm-amd" ];
extraModulePackages = [ ];
};
fileSystems."/" = {
device = "/dev/mapper/cryptroot";
fsType = "ext4";
};
boot.initrd.luks.devices."cryptroot".device =
"/dev/disk/by-uuid/a672a214-222c-44f4-ad34-0a259523cf59";
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/8C2E-99B6";
fsType = "vfat";
options = [
"fmask=0022"
"dmask=0022"
];
};
swapDevices = [ ];
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}
+152
View File
@@ -0,0 +1,152 @@
{
config,
pkgs,
lib,
inputs,
...
}:
{
imports = [
# Shared home-manager modules
../../modules/home-manager/arch-packages
../../modules/home-manager/calendar
../../modules/home-manager/oh-my-posh
../../modules/home-manager/zshrc
../../modules/home-manager/alacritty
../../modules/home-manager/bat
../../modules/home-manager/fastfetch
../../modules/home-manager/hyprland
../../modules/home-manager/hypridle
../../modules/home-manager/hyprlock
../../modules/home-manager/hyprpaper
../../modules/home-manager/awww
../../modules/home-manager/hyprsunset
../../modules/home-manager/darkman
../../modules/home-manager/wlogout
../../modules/home-manager/opencode
../../modules/home-manager/cedilla
../../modules/home-manager/dictation
../../modules/home-manager/nvim
../../modules/home-manager/pi
../../modules/home-manager/tmux
inputs.zen-browser.homeModules.beta
];
home = {
username = "jpporta";
homeDirectory = "/home/jpporta";
stateVersion = "26.05";
sessionPath = [
"$HOME/.local/bin"
"$HOME/.cargo/bin"
"$HOME/go/bin"
];
sessionVariables = {
EDITOR = "nvim";
};
};
custom = {
jpporta-calendars.enable = true;
oh-my-posh.enable = true;
zsh.enable = true;
alacritty.enable = true;
bat.enable = true;
fastfetch.enable = true;
opencode.enable = true;
hyprland.enable = true;
hypridle.enable = true;
hyprlock.enable = true;
hyprpaper.enable = false;
awww = {
enable = true;
transition = {
fps = 240;
step = 90;
duration = "1.5";
};
};
hyprsunset.enable = true;
wlogout.enable = true;
darkman.enable = true;
cedilla.enable = true;
dictation = {
enable = true;
modelHash = "sha256-ZNGCtEC5jVIDxPm9VBVE2ExgUZbE97hF36EfsjWU0eI=";
};
nvim.enable = true;
pi.enable = true;
tmux.enable = true;
};
home.packages =
let
mediaplayerPython = pkgs.python3.withPackages (ps: with ps; [ pygobject3 ]);
in
with pkgs;
[
playerctl
(pkgs.writeShellScriptBin "mediaplayer-python" ''
export GI_TYPELIB_PATH=${pkgs.playerctl}/lib/girepository-1.0''${GI_TYPELIB_PATH:+:$GI_TYPELIB_PATH}
exec ${mediaplayerPython}/bin/python3 "$@"
'')
eza
fastfetch
bat-extras.batman
nodejs
firefox
];
programs = {
zen-browser.enable = true;
git = {
enable = true;
settings = {
user = {
name = "João Pedro Pin Porta";
email = "jpedro.porta@gmail.com"; # must match the uid on the gpg key
};
gpg.program = "gpg";
commit.gpgSign = true;
tag.gpgSign = true;
};
signing = {
key = "7BA72FF4FA933219";
signByDefault = true;
};
};
fzf = {
enable = true;
enableZshIntegration = true;
};
zoxide = {
enable = true;
enableZshIntegration = true;
options = [
"--cmd"
"cd"
];
};
gpg.enable = true;
};
services.gpg-agent = {
enable = true;
pinentry.package = pkgs.pinentry-rofi;
enableSshSupport = true; # only if you use gpg keys as ssh keys
defaultCacheTtl = 3600;
maxCacheTtl = 86400;
};
services.swaync.enable = true;
}
+177
View File
@@ -0,0 +1,177 @@
{
config,
pkgs,
lib,
...
}:
let
mainFont = "Berkeley Mono Nerd Font Mono";
fontSize = 14;
in
{
imports = [
# Shared home-manager modules
../../modules/home-manager/arch-packages
../../modules/home-manager/oh-my-posh
../../modules/home-manager/zshrc
../../modules/home-manager/alacritty
../../modules/home-manager/bat
../../modules/home-manager/fastfetch
../../modules/home-manager/hyprland
../../modules/home-manager/hyprlock
../../modules/home-manager/hyprpaper
../../modules/home-manager/awww
../../modules/home-manager/hyprsunset
../../modules/home-manager/darkman
../../modules/home-manager/wlogout
../../modules/home-manager/opencode
../../modules/home-manager/swaync
../../modules/home-manager/nvim
../../modules/home-manager/pi
../../modules/home-manager/tmux
];
home = {
username = "jpporta";
homeDirectory = "/home/jpporta";
stateVersion = "26.11";
sessionVariables = {
EDITOR = "nvim";
};
};
custom = {
zsh = {
enable = true;
fastfetch = false;
};
tmux.enable = true;
oh-my-posh.enable = true;
pi.enable = true;
nvim.enable = true;
hyprland.enable = true;
hyprlock.enable = true;
hyprpaper.enable = false;
hyprsunset.enable = true;
wlogout.enable = true;
darkman.enable = true;
awww.enable = true;
opencode.enable = true;
alacritty.enable = true;
bat.enable = true;
fastfetch.enable = true;
swaync.enable = true;
};
home.packages = with pkgs; [
cage
foot
git
ripgrep
fd
mosh
fastfetch
stow
tmux
];
# Non-NixOS host: fixes locales, ld paths, XDG desktop entries
targets.genericLinux.enable = true;
# ---- fonts ----
fonts.fontconfig.enable = true;
home.file."my-fonts" = {
source = ./fonts;
target = ".local/share/fonts/custom";
recursive = true;
};
programs = {
home-manager.enable = true;
foot = {
enable = true;
server.enable = false;
settings = {
main = {
shell = "${pkgs.zsh}/bin/zsh --login";
term = "xterm-256color";
font = "${mainFont}:size=${toString fontSize}";
font-bold = "${mainFont}:size=${toString fontSize}";
pad = "12x12";
};
scrollback.lines = 10000;
cursor.style = "beam";
colors-dark = {
alpha = 1.0;
background = "282828";
foreground = "ebdbb2";
regular0 = "282828";
regular1 = "cc241d";
regular2 = "98971a";
regular3 = "d79921";
regular4 = "458588";
regular5 = "b16286";
regular6 = "689d6a";
regular7 = "a89984";
bright0 = "928374";
bright1 = "fb4934";
bright2 = "b8bb26";
bright3 = "fabd2f";
bright4 = "83a598";
bright5 = "d3869b";
bright6 = "8ec07c";
bright7 = "ebdbb2";
};
key-bindings = {
font-increase = "Control+plus Control+equal";
font-decrease = "Control+minus";
font-reset = "Control+0";
};
};
};
bash = {
enable = true;
profileExtra = ''
if [ -z "$WAYLAND_DISPLAY" ] && [ "$XDG_VTNR" = "1" ]; then
export WLR_RENDERER=pixman
export XDG_RUNTIME_DIR=''${XDG_RUNTIME_DIR:-/run/user/$(id -u)}
exec cage -- foot
fi
'';
};
ssh = {
enable = true;
enableDefaultConfig = false;
settings = {
"*" = {
forwardAgent = false;
addKeysToAgent = "no";
compression = false;
serverAliveInterval = 0;
serverAliveCountMax = 3;
hashKnownHosts = false;
userKnownHostsFile = "~/.ssh/known_hosts";
controlMaster = "no";
controlPath = "~/.ssh/master-%r@%n:%p";
controlPersist = "no";
};
"pc" = {
hostname = "192.168.0.100";
user = "jpporta";
serverAliveInterval = 30;
};
};
};
};
services.syncthing.enable = true;
home.sessionVariables.TERMINAL = "foot";
}
@@ -0,0 +1,56 @@
{
inputs,
lib,
config,
pkgs,
...
}:
{
options.custom = {
alacritty.enable = lib.mkEnableOption "enable alacritty terminal emulator";
};
config = lib.mkIf config.custom.alacritty.enable {
programs.alacritty = {
enable = true;
settings = {
font = {
size = 10.3;
normal = {
family = "BerkeleyMono Nerd Font Mono";
};
bold = {
family = "BerkeleyMono Nerd Font Mono";
};
italic = {
family = "BerkeleyMono Nerd Font Mono";
};
bold_italic = {
family = "BerkeleyMono Nerd Font Mono";
};
};
window = {
decorations = "None";
opacity = 0.8;
blur = true;
dynamic_padding = true;
padding = {
x = 10;
y = 16;
};
};
keyboard = {
bindings = [
{
key = "Return";
mods = "Shift";
chars = "\u001B\r";
}
];
};
};
};
};
}
@@ -0,0 +1,169 @@
{ pkgs, ... }:
let
claude-code = pkgs.symlinkJoin {
name = "claude-code-wrapped";
paths = [ pkgs.claude-code ];
nativeBuildInputs = [ pkgs.makeWrapper ];
postBuild = ''
wrapProgram $out/bin/claude \
--suffix PATH : ${pkgs.lib.makeBinPath [ pkgs.python3 ]}
'';
};
in
{
home.packages = with pkgs; [
# ---- shell & core CLI ----
tree
worktrunk
zoxide
fzf
eza
fd
bc
wget
which
entr
stow
bat-extras.batman
bat-extras.batgrep
bat-extras.batdiff
bat-extras.batpipe
bat-extras.batwatch
bat-extras.prettybat
fastfetch
tldr
superfile
silicon
expect
jq
killall
gnupg
pinentry-gtk2
# nitch
# ---- editors & dev tooling ----
tree
ffmpeg
chromium
neovim
vim
tree-sitter
stylua
lua5_1
luarocks
ruby
git
gh
lazygit
tmux
sesh
serie
gcc
gnumake
pandoc
typst
tectonic
mkcert
sqlc
rainfrog
unzip
# Languages
go
cargo
php
julia
eslint_d
golangci-lint
rust-analyzer
imagemagick
ghostscript
ripgrep
gopls
typescript-language-server
nixfmt
# ---- cloud / infra ----
awscli2
kubectl
kubernetes-helm
k9s
kind
opentofu
hasura-cli
docker-compose
platformio
claude-code
jujutsu
# ---- hyprland / wayland desktop ----
hyprshot
waybar
wofi
wlogout
rofi
quickshell
grim
slurp
wl-clipboard
wl-color-picker
swayimg
wev
wiremix
matugen
dmenu-wayland
udiskie
networkmanagerapplet
pywal16
# swaync
# ---- theming & fonts ----
adw-gtk3
bibata-cursors
papirus-icon-theme
papirus-folders
rose-pine-hyprcursor
nwg-look
nerd-fonts.jetbrains-mono
noto-fonts-color-emoji
libsForQt5.qtstyleplugin-kvantum
# ---- GUI apps ----
obsidian
obs-cmd
qbittorrent
zathura
mpv
yt-dlp
libreoffice-fresh
evolution
slack
spotify
zoom-us
localsend
feishin
darktable
gthumb
kdePackages.kdenlive
shotcut
video-trimmer
kdePackages.dolphin
thunar
gnome-calendar
gnome-clocks
gnome-weather
pass
bluetuith
cameractrls
gphoto2
gnuplot
pnpm
hyprshutdown
sl
p7zip
# surfshark-client -> no package; use their generic linux app or wireguard configs
# tidaler, awww, hyprpwcenter, hyprshutdown
];
}
+129
View File
@@ -0,0 +1,129 @@
{
config,
lib,
pkgs,
...
}:
let
cfg = config.custom.awww;
# Picks a random image from the (mutable) wallpaper dir at runtime and hands
# it to the running daemon. Only this script lives in the nix store — the
# images are read live on every cycle, so they are never copied into the store.
cycleScript = pkgs.writeShellScript "awww-cycle" ''
set -euo pipefail
dir="${cfg.wallpaperDir}"
if [ ! -d "$dir" ]; then
echo "awww-cycle: wallpaper dir '$dir' does not exist" >&2
exit 0
fi
# -L follows symlinks, so $dir (or files inside it) may be symlinks.
img="$(${pkgs.findutils}/bin/find -L "$dir" -type f \
\( -iname '*.jpg' -o -iname '*.jpeg' -o -iname '*.png' \
-o -iname '*.webp' -o -iname '*.bmp' -o -iname '*.gif' \) \
| ${pkgs.coreutils}/bin/shuf -n1)"
if [ -z "''${img:-}" ]; then
echo "awww-cycle: no images found in '$dir'" >&2
exit 0
fi
exec ${lib.getExe cfg.package} img "$img" \
--transition-type "${cfg.transition.type}" \
--transition-fps ${toString cfg.transition.fps} \
--transition-step ${toString cfg.transition.step} \
--transition-duration ${cfg.transition.duration}
'';
in
{
options.custom.awww = {
enable = lib.mkEnableOption "awww (ex-swww) animated wallpaper daemon with timed random cycling";
package = lib.mkPackageOption pkgs "awww" { };
wallpaperDir = lib.mkOption {
type = lib.types.str;
default = "${config.home.homeDirectory}/Wallpapers";
description = ''
Directory scanned at runtime for wallpapers. Its contents are read live on
every cycle and are never copied into the nix store, so you can add, remove
or edit images freely without a rebuild. Symlinks are followed.
'';
};
interval = lib.mkOption {
type = lib.types.str;
default = "15min";
example = "1h";
description = "How often to switch wallpaper, as a systemd time span.";
};
transition = {
type = lib.mkOption {
type = lib.types.str;
default = "random";
example = "grow";
description = "awww --transition-type (random, grow, wipe, fade, simple, outer, center, any, ...).";
};
fps = lib.mkOption {
type = lib.types.int;
default = 60;
description = "awww --transition-fps.";
};
step = lib.mkOption {
type = lib.types.int;
default = 90;
description = "awww --transition-step (how abruptly the transition advances).";
};
duration = lib.mkOption {
type = lib.types.str;
default = "1.5";
description = "awww --transition-duration, in seconds.";
};
};
};
config = lib.mkIf cfg.enable {
# Runs awww-daemon as a systemd user service, bound to graphical-session.target
# and gated on WAYLAND_DISPLAY. Also installs the awww package.
services.awww = {
enable = true;
inherit (cfg) package;
};
# Ensure the wallpaper directory exists (left empty and mutable — you own it).
home.activation.createWallpaperDir = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
run mkdir -p ${lib.escapeShellArg cfg.wallpaperDir}
'';
# Oneshot that sets a single random wallpaper. Waits for the daemon to be up.
systemd.user.services.awww-cycle = {
Unit = {
Description = "Set a random wallpaper via awww";
After = [ "awww.service" ];
Requires = [ "awww.service" ];
PartOf = [ config.wayland.systemd.target ];
};
Service = {
Type = "oneshot";
ExecStart = "${cycleScript}";
};
};
# Timer that fires the oneshot shortly after login and then every ${interval}.
# Tied to the graphical session, so it starts/stops with Hyprland.
systemd.user.timers.awww-cycle = {
Unit = {
Description = "Cycle wallpaper every ${cfg.interval} via awww";
PartOf = [ config.wayland.systemd.target ];
};
Timer = {
OnActiveSec = "3s";
OnUnitActiveSec = cfg.interval;
};
Install.WantedBy = [ config.wayland.systemd.target ];
};
};
}
+17
View File
@@ -0,0 +1,17 @@
{ lib, config, ... }:
{
options.custom = {
bat.enable = lib.mkEnableOption "enable bat - color cat alternative";
};
config = lib.mkIf config.custom.bat.enable {
programs.bat = {
enable = true;
config = {
theme = "ansi";
style = "numbers,changes";
};
};
};
}
+240
View File
@@ -0,0 +1,240 @@
{
inputs,
lib,
config,
pkgs,
...
}:
{
accounts = {
calendar = {
basePath = "${config.home.homeDirectory}/.calendars";
accounts = {
inbox = {
remote = {
type = "caldav";
url = "https://cal.joaoporta.com/jpporta/3a35411d-3b32-854e-9a57-1cca5510fd8e/";
userName = "jpporta";
passwordCommand = [
"pass"
"show"
"personal/caldav"
];
};
local = {
type = "filesystem";
fileExt = ".ics";
};
vdirsyncer = {
enable = true;
collections = null;
conflictResolution = "remote wins";
metadata = [
"color"
"displayname"
];
};
khal = {
enable = true;
type = "calendar";
color = "light blue";
};
};
avodah = {
remote = {
type = "caldav";
url = "https://cal.joaoporta.com/jpporta/f3901be0-8dca-7856-d1cb-fe7869e92c1e/";
userName = "jpporta";
passwordCommand = [
"pass"
"show"
"personal/caldav"
];
};
local = {
type = "filesystem";
fileExt = ".ics";
};
vdirsyncer = {
enable = true;
collections = null;
conflictResolution = "remote wins";
metadata = [
"color"
"displayname"
];
};
khal = {
enable = true;
type = "calendar";
color = "light red";
};
};
casa = {
remote = {
type = "caldav";
url = "https://cal.joaoporta.com/jpporta/4f26caba-3134-4253-cdb6-16d34df2a109/";
userName = "jpporta";
passwordCommand = [
"pass"
"show"
"personal/caldav"
];
};
local = {
type = "filesystem";
fileExt = ".ics";
};
vdirsyncer = {
enable = true;
collections = null;
conflictResolution = "remote wins";
metadata = [
"color"
"displayname"
];
};
khal = {
enable = true;
type = "calendar";
color = "dark red";
};
};
exercicio = {
remote = {
type = "caldav";
url = "https://cal.joaoporta.com/jpporta/773de611-4f21-053f-e916-f48f1b3f0e24/";
userName = "jpporta";
passwordCommand = [
"pass"
"show"
"personal/caldav"
];
};
local = {
type = "filesystem";
fileExt = ".ics";
};
vdirsyncer = {
enable = true;
collections = null;
conflictResolution = "remote wins";
metadata = [
"color"
"displayname"
];
};
khal = {
enable = true;
type = "calendar";
color = "dark green";
};
};
familia = {
remote = {
type = "caldav";
url = "https://cal.joaoporta.com/jpporta/4fb446ab-33a1-1a91-c009-5b69316c8cea/";
userName = "jpporta";
passwordCommand = [
"pass"
"show"
"personal/caldav"
];
};
local = {
type = "filesystem";
fileExt = ".ics";
};
vdirsyncer = {
enable = true;
collections = null;
conflictResolution = "remote wins";
metadata = [
"color"
"displayname"
];
};
khal = {
enable = true;
type = "calendar";
color = "dark blue";
};
};
saude = {
remote = {
type = "caldav";
url = "https://cal.joaoporta.com/jpporta/4b455515-de59-2bdb-9e51-aee5a1a2d960/";
userName = "jpporta";
passwordCommand = [
"pass"
"show"
"personal/caldav"
];
};
local = {
type = "filesystem";
fileExt = ".ics";
};
vdirsyncer = {
enable = true;
collections = null;
conflictResolution = "remote wins";
metadata = [
"color"
"displayname"
];
};
khal = {
enable = true;
type = "calendar";
color = "light magenta";
};
};
teleo = {
remote = {
type = "caldav";
url = "https://cal.joaoporta.com/jpporta/dd52bfd0-c8c4-2d7b-6469-25244f69fe3a/";
userName = "jpporta";
passwordCommand = [
"pass"
"show"
"personal/caldav"
];
};
local = {
type = "filesystem";
fileExt = ".ics";
};
vdirsyncer = {
enable = true;
collections = null;
conflictResolution = "remote wins";
metadata = [
"color"
"displayname"
];
};
khal = {
enable = true;
type = "calendar";
color = "yellow";
};
};
};
};
};
}
+41
View File
@@ -0,0 +1,41 @@
{
inputs,
lib,
config,
pkgs,
...
}:
{
imports = [
./accounts.nix
];
options.custom = {
jpporta-calendars.enable = lib.mkEnableOption "enable personal jpporta calendars";
};
config = lib.mkIf config.custom.jpporta-calendars.enable {
programs = {
vdirsyncer.enable = true;
khal = {
enable = true;
locale = {
timeformat = "%H:%M";
dateformat = "%Y-%m-%d";
longdateformat = "%Y-%m-%d";
datetimeformat = "%Y-%m-%d %H:%M";
longdatetimeformat = "%Y-%m-%d %H:%M";
};
};
};
services.vdirsyncer = {
enable = true;
frequency = "*:0/15"; # every 15 minutes; systemd OnCalendar format
};
};
}
+29
View File
@@ -0,0 +1,29 @@
{ lib, config, ... }:
{
options.custom = {
cedilla.enable = lib.mkEnableOption "enable cedilla - apply Compose configuration for cedilla";
};
config = lib.mkIf config.custom.cedilla.enable {
home.file.".XCompose".text = ''
include "%L"
<dead_acute> <c> : "ç" ccedilla
<dead_acute> <C> : "Ç" Ccedilla
'';
systemd.user.services.fcitx5 = {
Unit = {
Description = "Fcitx5 input method";
PartOf = [ "graphical-session.target" ];
After = [ "graphical-session.target" ];
};
Service = {
ExecStart = "/run/current-system/sw/bin/fcitx5";
Restart = "on-failure";
};
Install.WantedBy = [ "graphical-session.target" ];
};
};
}
+69
View File
@@ -0,0 +1,69 @@
{
lib,
config,
pkgs,
...
}:
let
schemaDir = "${pkgs.gsettings-desktop-schemas}/share/gsettings-schemas/gsettings-desktop-schemas-${pkgs.gsettings-desktop-schemas.version}/glib-2.0/schemas";
hyprctl = "${pkgs.hyprland}/bin/hyprctl";
ensureHis = ''
if [ -z "$HYPRLAND_INSTANCE_SIGNATURE" ]; then
export HYPRLAND_INSTANCE_SIGNATURE="$(${pkgs.coreutils}/bin/ls -t "$XDG_RUNTIME_DIR/hypr" | ${pkgs.coreutils}/bin/head -n1)"
fi
'';
hyprsunsetEnabled = config.custom.hyprsunset.enable or false;
in
{
options.custom = {
darkman.enable = lib.mkEnableOption "enable darkman - auto dark/light switch";
};
config = lib.mkIf config.custom.darkman.enable {
home.packages = with pkgs; [
glib
gsettings-desktop-schemas
];
services.darkman = {
enable = true;
settings = {
lat = -22.48;
lng = -47.08;
usegeoclue = false;
};
darkModeScripts = {
gtk-theme = ''
export GSETTINGS_SCHEMA_DIR=${schemaDir}
${pkgs.glib}/bin/gsettings set org.gnome.desktop.interface color-scheme 'prefer-dark'
${pkgs.glib}/bin/gsettings set org.gnome.desktop.interface gtk-theme 'Adwaita-dark'
'';
}
// lib.optionalAttrs hyprsunsetEnabled {
hyprsunset = ''
${ensureHis}
${hyprctl} hyprsunset temperature 4000
${hyprctl} hyprsunset gamma 85
'';
};
lightModeScripts = {
gtk-theme = ''
export GSETTINGS_SCHEMA_DIR=${schemaDir}
${pkgs.glib}/bin/gsettings set org.gnome.desktop.interface color-scheme 'prefer-light'
${pkgs.glib}/bin/gsettings set org.gnome.desktop.interface gtk-theme 'Adwaita'
'';
}
// lib.optionalAttrs hyprsunsetEnabled {
hyprsunset = ''
${ensureHis}
${hyprctl} hyprsunset identity
${hyprctl} hyprsunset gamma 100
'';
};
};
};
}
+168
View File
@@ -0,0 +1,168 @@
{ config, lib, pkgs, ... }:
let
cfg = config.custom.dictation;
# AMD GPU: Vulkan backend (works on any RADV-capable Radeon, no ROCm stack).
# Swap to { rocmSupport = true; } if you'd rather use ROCm (see notes).
whisper = pkgs.whisper-cpp.override { vulkanSupport = true; };
# Declaratively pinned GGML model. Build once with the default fakeHash and
# paste back the sha256 Nix reports.
model = pkgs.fetchurl {
url = "https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-${cfg.model}.bin";
hash = cfg.modelHash;
};
port = toString cfg.port;
histRel = "dictation/history.jsonl";
dictate = pkgs.writeShellApplication {
name = "dictate-toggle";
runtimeInputs = with pkgs; [ pipewire curl jq wtype wl-clipboard libnotify coreutils ];
text = ''
# -c / --clipboard: put the transcript on the clipboard instead of typing it.
clipboard=0
case "''${1:-}" in
-c|--clipboard) clipboard=1 ;;
esac
run="''${XDG_RUNTIME_DIR:-/tmp}"
pid="$run/dictate.pid"
wav="$run/dictate.wav"
hist="''${XDG_STATE_HOME:-$HOME/.local/state}/${histRel}"
if [ -f "$pid" ] && kill -0 "$(cat "$pid")" 2>/dev/null; then
# ---- second press: stop, transcribe, type ----
kill "$(cat "$pid")" 2>/dev/null || true
rm -f "$pid"
sleep 0.2
# ignore fat-finger taps (<~0.5s @ 16kHz*2B mono = 16000 bytes)
bytes="$(stat -c%s "$wav" 2>/dev/null || echo 0)"
if [ "$bytes" -lt 16000 ]; then
notify-send -t 1000 -a dictation "🎤 too short"
rm -f "$wav"; exit 0
fi
notify-send -t 1200 -a dictation "🧠 transcribing"
args=(-sS "http://127.0.0.1:${port}/inference"
-F file=@"$wav" -F temperature=0 -F response_format=json
-F language=${cfg.language})
result="$(curl "''${args[@]}" | jq -r '.text' \
| tr '\n' ' ' \
| sed -e 's/ */ /g' -e 's/^ *//' -e 's/ *$//')"
if [ -n "$result" ]; then
# log it (newest last), then keep only the most recent N entries
mkdir -p "$(dirname "$hist")"
jq -cn --arg ts "$(date -Is)" --arg text "$result" \
'{ts: $ts, text: $text}' >> "$hist"
tmp="$(mktemp -p "$(dirname "$hist")")"
tail -n ${toString cfg.historyMax} "$hist" > "$tmp" && mv -f "$tmp" "$hist"
if [ "$clipboard" -eq 1 ]; then
printf '%s' "$result" | wl-copy
notify-send -t 1500 -a dictation "📋 copied to clipboard"
else
wtype -- "$result"
fi
fi
rm -f "$wav"
else
# ---- first press: start recording ----
rm -f "$wav"
pw-record --rate 16000 --channels 1 --format s16 "$wav" &
echo "$!" > "$pid"
notify-send -t 1200 -a dictation "🎤 recording F5 to stop"
fi
'';
};
history = pkgs.writeShellApplication {
name = "dictate-history";
runtimeInputs = with pkgs; [ jq rofi wl-clipboard libnotify coreutils ];
text = ''
hist="''${XDG_STATE_HOME:-$HOME/.local/state}/${histRel}"
if [ ! -s "$hist" ]; then
notify-send -t 1500 -a dictation "📋 no dictation history yet"
exit 0
fi
# newest first; keep full texts and menu rows index-aligned
mapfile -t texts < <(tac "$hist" | jq -r '.text')
mapfile -t menu < <(tac "$hist" | jq -r '
(.ts[5:16] | sub("T"; " ")) as $t
| (if (.text | length) > 60 then .text[0:60] + "" else .text end) as $p
| "\($t) \($p)"')
idx="$(printf '%s\n' "''${menu[@]}" \
| rofi -dmenu -i -format i -p "dictation" || true)"
[[ "$idx" =~ ^[0-9]+$ ]] || exit 0
printf '%s' "''${texts[$idx]}" | wl-copy
notify-send -t 1500 -a dictation "📋 copied to clipboard"
'';
};
in
{
options.custom.dictation = {
enable = lib.mkEnableOption "local F5 push-to-talk dictation (whisper.cpp + wtype)";
model = lib.mkOption {
type = lib.types.str;
default = "large-v3";
description = ''GGML model stem, e.g. "large-v3" or "large-v3-turbo".'';
};
modelHash = lib.mkOption {
type = lib.types.str;
default = lib.fakeHash;
description = "sha256 of the model. Build once with the default, paste the reported hash.";
};
language = lib.mkOption {
type = lib.types.str;
default = "auto";
description = ''Pin a language ("en", "pt") or "auto" to detect per utterance.'';
};
port = lib.mkOption {
type = lib.types.port;
default = 8117;
};
historyMax = lib.mkOption {
type = lib.types.int;
default = 1000;
description = "Keep only the most recent N transcriptions in the history log.";
};
};
config = lib.mkIf cfg.enable {
home.packages = [ dictate history whisper ]; # whisper-cli also available for testing
systemd.user.services.whisper-server = {
Unit = {
Description = "whisper.cpp server (keeps the model warm in VRAM)";
After = [ "graphical-session.target" ];
};
Service = {
# If your build names it 'whisper-whisper-server', adjust the path below
# (nixpkgs has occasionally double-prefixed it). `ls ${whisper}/bin`.
ExecStart = lib.escapeShellArgs [
"${whisper}/bin/whisper-server"
"--model" "${model}"
"--host" "127.0.0.1"
"--port" port
"--max-len" "100000" # default 0 is silently coerced to 60; large = don't chop
];
Restart = "on-failure";
};
Install.WantedBy = [ "default.target" ];
};
};
}
+224
View File
@@ -0,0 +1,224 @@
{ lib, config, ... }:
{
options.custom = {
fastfetch.enable = lib.mkEnableOption "enable fastfetch - system prompt decoration";
};
config = lib.mkIf config.custom.fastfetch.enable {
programs.fastfetch = {
enable = true;
settings = {
logo = {
source = "nixos_small";
padding = {
top = 4;
left = 0;
right = 2;
};
position = "right";
};
display = {
stat = false;
pipe = false;
showErrors = false;
disableLinewrap = true;
hideCursor = false;
separator = ": ";
color = {
keys = "";
title = "";
output = "";
separator = "";
};
brightColor = true;
duration = {
abbreviation = false;
spaceBeforeUnit = "default";
};
size = {
maxPrefix = "YB";
binaryPrefix = "iec";
ndigits = 2;
spaceBeforeUnit = "default";
};
temp = {
unit = "D";
ndigits = 1;
color = {
green = 32;
yellow = 93;
red = 91;
};
spaceBeforeUnit = "default";
};
percent = {
type = [
"num"
"num-color"
];
ndigits = 0;
color = {
green = 32;
yellow = 93;
red = 91;
};
spaceBeforeUnit = "default";
width = 0;
};
bar = {
char = {
elapsed = "";
total = "-";
};
border = {
left = "[ ";
right = " ]";
leftElapsed = "";
rightElapsed = "";
};
color = {
elapsed = "auto";
total = 97;
border = 97;
};
width = 10;
};
fraction = {
ndigits = 2;
};
noBuffer = false;
key = {
width = 0;
type = "string";
paddingLeft = 0;
};
freq = {
ndigits = 2;
spaceBeforeUnit = "default";
};
constants = [ ];
};
general = {
thread = true;
processingTimeout = 5000;
detectVersion = true;
playerName = "";
dsForceDrm = false;
};
modules = [
{
type = "title";
key = "";
keyIcon = "";
fqdn = false;
color = {
user = "";
at = "";
host = "";
};
}
{
type = "separator";
string = "-";
outputColor = "";
times = 0;
}
{
type = "os";
keyIcon = "";
}
{
type = "uptime";
keyIcon = "";
}
{
type = "shell";
keyIcon = "";
}
{
type = "display";
keyIcon = "󰍹";
compactType = "none";
preciseRefreshRate = false;
order = null;
}
{
type = "wm";
keyIcon = "";
detectPlugin = false;
}
{
type = "terminal";
keyIcon = "";
}
{
type = "terminalfont";
keyIcon = "";
}
{
type = "cpu";
keyIcon = "";
temp = false;
showPeCoreCount = false;
}
{
type = "gpu";
keyIcon = "󰾲";
driverSpecific = false;
detectionMethod = "pci";
temp = true;
hideType = "none";
percent = {
green = 50;
yellow = 80;
type = 0;
};
}
{
type = "memory";
keyIcon = "";
percent = {
green = 50;
yellow = 80;
type = 0;
};
}
{
type = "disk";
keyIcon = "";
showRegular = true;
showExternal = true;
showHidden = false;
showSubvolumes = false;
showReadOnly = true;
showUnknown = false;
folders = "";
hideFolders = [
"/efi"
"/boot"
"/boot/*"
];
hideFS = "";
useAvailable = false;
percent = {
green = 50;
yellow = 80;
type = 0;
};
}
{ }
{
type = "colors";
key = "";
keyIcon = "";
symbol = "block";
paddingLeft = 0;
block = {
width = 3;
range = "[0, 15]";
};
}
];
};
};
};
}
+43
View File
@@ -0,0 +1,43 @@
{
config,
lib,
pkgs,
...
}:
{
options.custom = {
hypridle.enable = lib.mkEnableOption "enable hypridle - screen lock";
};
config = lib.mkIf config.custom.hypridle.enable {
services.hypridle = {
enable = true;
settings = {
general = {
lock_cmd = "pidof hyprlock || hyprlock";
before_sleep_cmd = "loginctl lock-session";
after_sleep_cmd = "hyprctl dispatch dpms on";
};
listener = [
{
timeout = 600;
on-timeout = "loginctl lock-session";
}
{
timeout = 660;
on-timeout = "hyprctl dispatch dpms off";
on-resume = "hyprctl dispatch dpms on";
}
{
timeout = 1800;
on-timeout = "systemctl suspend";
}
];
};
};
};
}
+332
View File
@@ -0,0 +1,332 @@
{
config,
lib,
pkgs,
...
}:
let
dotfiles = "${config.home.homeDirectory}/nixos-config/modules/home-manager/hyprland/hypr";
in
{
options.custom.hyprland.enable = lib.mkEnableOption "Hyprland user config";
config = lib.mkIf config.custom.hyprland.enable {
systemd.user.targets.hyprland-session = {
Unit = {
Description = "hyprland compositor session";
BindsTo = [ "graphical-session.target" ];
Wants = [ "graphical-session-pre.target" ];
After = [ "graphical-session-pre.target" ];
};
};
wayland.windowManager.hyprland.settings.input.numlock_by_default = true;
xdg.configFile."hypr/hyprland.lua".text = ''
local home = os.getenv("HOME")
local config_dir = home .. "/.config/hypr"
package.path = config_dir .. "/?.lua;" .. config_dir .. "/?/init.lua;" .. package.path
-- Monitors ----------------------------------------
hl.monitor({
output = "DP-1",
mode = "1920x1080@239.96Hz",
position = "1080x0",
scale = 1,
})
-- Looks ----------------------------------------
hl.env("HYPRCURSOR_THEME", "Bibata-Modern-Ice-Right")
hl.env("HYPRCURSOR_SIZE", "24")
hl.config({
input = {
kb_layout = "us,us",
kb_variant = ",intl",
kb_options = "grp:alt_shift_toggle",
},
general = {
gaps_in = 7,
gaps_out = 10,
border_size = 2,
col = {
active_border = "rgba(ebcc71ff)",
inactive_border = "rgba(54461eff)",
},
layout = "dwindle",
},
scrolling = {
fullscreen_on_one_column = true,
column_width = 0.95,
focus_fit_method = 0,
},
dwindle = {
preserve_split = true,
},
master = {
new_status = "slave",
allow_small_split = false,
special_scale_factor = 0.75,
mfact = 0.40,
orientation = "center",
new_on_top = true,
},
})
hl.device({
name = "8bitdo-retro-18-numpad-keyboard",
kb_options = "numpad:mac",
numlock_by_default = true,
})
hl.config({
decoration = {
rounding = 15,
rounding_power = 2,
active_opacity = 1.0,
inactive_opacity = 0.75,
fullscreen_opacity = 1.0,
blur = {
enabled = true,
size = 1,
passes = 2,
new_optimizations = true,
vibrancy = 0.5,
vibrancy_darkness = 0.2,
},
shadow = {
enabled = true,
range = 15,
render_power = 3,
color = "rgba(121212aa)",
},
},
})
hl.layer_rule({
name = "swaync-control-center-blur",
match = { namespace = "swaync-control-center" },
blur = true,
dim_around = true,
ignore_alpha = 0.5,
no_screen_share = true,
})
hl.layer_rule({
name = "swaync-notification-blur",
match = { namespace = "swaync-notification-window" },
blur = true,
ignore_alpha = 0.5,
no_screen_share = true,
})
-- Animations ----------------------------------------
hl.config({ animations = { enabled = true } })
-- Bezier curves
hl.curve("easeOutQuint", { type = "bezier", points = { { 0.23, 1 }, { 0.32, 1 } } })
hl.curve("easeInOutCubic", { type = "bezier", points = { { 0.65, 0.05 }, { 0.36, 1 } } })
hl.curve("linear", { type = "bezier", points = { { 0, 0 }, { 1, 1 } } })
hl.curve("almostLinear", { type = "bezier", points = { { 0.5, 0.5 }, { 0.75, 1 } } })
hl.curve("quick", { type = "bezier", points = { { 0.15, 0 }, { 0.1, 1 } } })
-- Animations
hl.animation({ leaf = "global", enabled = true, speed = 10, bezier = "default" })
hl.animation({ leaf = "border", enabled = true, speed = 5.39, bezier = "easeOutQuint" })
hl.animation({ leaf = "windows", enabled = true, speed = 4.79, bezier = "easeOutQuint" })
hl.animation({ leaf = "windowsIn", enabled = true, speed = 4.1, bezier = "easeOutQuint", style = "popin 95%" })
hl.animation({ leaf = "windowsOut", enabled = true, speed = 1.49, bezier = "linear", style = "popin 95%" })
hl.animation({ leaf = "fadeIn", enabled = true, speed = 1.73, bezier = "almostLinear" })
hl.animation({ leaf = "fadeOut", enabled = true, speed = 1.46, bezier = "almostLinear" })
hl.animation({ leaf = "fade", enabled = true, speed = 3.03, bezier = "quick" })
hl.animation({ leaf = "layers", enabled = true, speed = 3.81, bezier = "easeOutQuint" })
hl.animation({ leaf = "layersIn", enabled = true, speed = 4, bezier = "easeOutQuint", style = "fade" })
hl.animation({ leaf = "layersOut", enabled = true, speed = 1.5, bezier = "linear", style = "fade" })
hl.animation({ leaf = "fadeLayersIn", enabled = true, speed = 1.79, bezier = "almostLinear" })
hl.animation({ leaf = "fadeLayersOut", enabled = true, speed = 1.39, bezier = "almostLinear" })
hl.animation({ leaf = "workspaces", enabled = true, speed = 1.94, bezier = "almostLinear", style = "slidefade 10%" })
hl.animation({ leaf = "workspacesIn", enabled = true, speed = 1.21, bezier = "almostLinear", style = "slidefade 10%" })
hl.animation({ leaf = "workspacesOut", enabled = true, speed = 1.94, bezier = "almostLinear", style = "slidefade 10%" })
-- Autostart ----------------------------------------
hl.on("hyprland.start", function()
hl.exec_cmd("dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP HYPRLAND_INSTANCE_SIGNATURE")
hl.exec_cmd("systemctl --user start hyprland-session.target")
hl.exec_cmd("waybar")
hl.exec_cmd("hypridle")
hl.exec_cmd("swaync")
hl.exec_cmd("hyprctl setcursor Bibata-Modern-Ice-Right 24")
end)
-- Programs ----------------------------------------
local p = {
terminal = "alacritty",
file_manager = "thunar",
menu = "pkill rofi || " .. home .. "/.config/rofi/launchers/type-7/launcher.sh",
logout_menu = "wlogout -b 5 -T 400 -B 400",
toggle_notifications = "swaync-client -t -sw",
screen_ocr = home .. "/.local/bin/read-screen",
}
-- Binds ----------------------------------------
local mod = "SUPER"
local mod_shft = "SUPER + SHIFT"
local mod_ctrl = "SUPER + CTRL"
local mod_alt = "SUPER + ALT"
-- ---------- App launchers / global actions ----------
hl.bind(mod .. " + Return", hl.dsp.exec_cmd(p.terminal))
hl.bind(mod .. " + Q", hl.dsp.window.close())
hl.bind(mod_shft .. " + Q", hl.dsp.exec_cmd("killall zoom"))
hl.bind(mod .. " + E", hl.dsp.exec_cmd(p.file_manager))
hl.bind(mod .. " + V", hl.dsp.window.float({ action = "toggle" }))
hl.bind(mod .. " + F", hl.dsp.window.fullscreen())
hl.bind(mod .. " + M", hl.dsp.layout("togglesplit")) -- dwindle
hl.bind(mod .. " + N", hl.dsp.exec_cmd(p.toggle_notifications))
hl.bind(mod .. " + Space", hl.dsp.exec_cmd(p.menu))
hl.bind("CTRL + ALT + DELETE", hl.dsp.exec_cmd(p.logout_menu))
-- ---------- Focus movement (vim) ----------
hl.bind(mod .. " + H", hl.dsp.focus({ direction = "left" }))
hl.bind(mod .. " + L", hl.dsp.focus({ direction = "right" }))
hl.bind(mod .. " + K", hl.dsp.focus({ direction = "up" }))
hl.bind(mod .. " + J", hl.dsp.focus({ direction = "down" }))
-- ---------- Move window ----------
hl.bind(mod_shft .. " + H", hl.dsp.window.move({ direction = "left" }))
hl.bind(mod_shft .. " + L", hl.dsp.window.move({ direction = "right" }))
hl.bind(mod_shft .. " + K", hl.dsp.window.move({ direction = "up" }))
hl.bind(mod_shft .. " + J", hl.dsp.window.move({ direction = "down" }))
-- ---------- Splitratio (dwindle layoutmsg) ----------
hl.bind(mod .. " + comma", hl.dsp.layout("splitratio -0.1"))
hl.bind(mod .. " + period", hl.dsp.layout("splitratio 0.1"))
-- ---------- Workspaces (Y U I O P -> 1..5) ----------
local ws_keys = { Y = 1, U = 2, I = 3, O = 4, P = 5 }
for key, ws in pairs(ws_keys) do
hl.bind(mod .. " + " .. key, hl.dsp.focus({ workspace = ws }))
hl.bind(mod_shft .. " + " .. key, hl.dsp.window.move({ workspace = ws }))
end
-- ---------- Special workspace (scratchpad) ----------
hl.bind(mod .. " + S", hl.dsp.workspace.toggle_special("magic"))
hl.bind(mod_shft .. " + S", hl.dsp.window.move({ workspace = "special:magic" }))
-- ---------- Workspace scroll ----------
hl.bind(mod .. " + mouse_down", hl.dsp.focus({ workspace = "e+1" }))
hl.bind(mod .. " + mouse_up", hl.dsp.focus({ workspace = "e-1" }))
-- ---------- Mouse drag/resize ----------
hl.bind(mod .. " + mouse:272", hl.dsp.window.drag(), { mouse = true })
hl.bind(mod .. " + mouse:273", hl.dsp.window.resize(), { mouse = true })
-- ---------- Multimedia (locked + repeating) ----------
local el = { locked = true, repeating = true }
hl.bind("XF86AudioRaiseVolume", hl.dsp.exec_cmd("wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+"), el)
hl.bind("XF86AudioLowerVolume", hl.dsp.exec_cmd("wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"), el)
hl.bind("XF86AudioMute", hl.dsp.exec_cmd("wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"), el)
hl.bind("XF86AudioMicMute", hl.dsp.exec_cmd("wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle"), el)
hl.bind("XF86MonBrightnessUp", hl.dsp.exec_cmd("brightnessctl s 10%+"), el)
hl.bind("XF86MonBrightnessDown", hl.dsp.exec_cmd("brightnessctl s 10%-"), el)
-- ---------- Media (locked, no repeat) ----------
local l = { locked = true }
hl.bind("XF86AudioNext", hl.dsp.exec_cmd("playerctl next"), l)
hl.bind("XF86AudioPause", hl.dsp.exec_cmd("playerctl play-pause"), l)
hl.bind("XF86AudioPlay", hl.dsp.exec_cmd("playerctl play-pause"), l)
hl.bind("XF86AudioPrev", hl.dsp.exec_cmd("playerctl previous"), l)
-- ---------- Screenshots ----------
hl.bind(mod_shft .. " + 2", hl.dsp.exec_cmd("hyprshot -m output -m DP-1 -o ~/Pictures/Screenshots"))
hl.bind(mod_shft .. " + 3", hl.dsp.exec_cmd("hyprshot -m window -m active -o ~/Pictures/Screenshots"))
hl.bind(mod_shft .. " + 4", hl.dsp.exec_cmd("hyprshot -m region -o ~/Pictures/Screenshots"))
-- ---------- OBS Recording ----------
hl.bind(mod_shft .. " + 9", hl.dsp.exec_cmd("obs-cmd recording toggle"))
hl.bind(mod .. " + 9", hl.dsp.exec_cmd("obs-cmd recording toggle-pause"))
-- Disable animations on the screenshot selection layer
hl.layer_rule({
name = "no-anim-selection",
match = { namespace = "selection" },
no_anim = true,
})
hl.bind(mod_shft .. " + 0", hl.dsp.exec_cmd(p.screen_ocr))
-- ---------- Lock / suspend ----------
hl.bind(mod_alt .. " + L", hl.dsp.exec_cmd("hyprlock"))
hl.bind(mod .. " + ALT + CTRL + L", hl.dsp.exec_cmd("systemctl suspend"))
-- ---------- Waybar reload ----------
hl.bind(mod_alt .. " + R", hl.dsp.exec_cmd("/home/jpporta/.config/waybar/scripts/launch.sh"))
-- ---------- Dictation ----------
hl.bind(mod .. " + code:71", hl.dsp.exec_cmd("dictate-toggle"))
hl.bind(mod .. " + code:72", hl.dsp.exec_cmd("dictate-history"))
hl.bind(mod_shft .. " + code:71", hl.dsp.exec_cmd("dictate-toggle -c"))
-- ---------- misc ----------
hl.config({
misc = {
force_default_wallpaper = 0,
disable_hyprland_logo = true,
},
})
-- ---------- window rules ----------
-- Zoom Behave -----------
hl.window_rule({
match = { class = "^zoom$", title = "^annotate_toolbar$" },
float = true,
})
hl.window_rule({
match = { class = "^zoom$" },
no_blur = true,
border_size = 0,
no_initial_focus = true,
no_shadow = true,
})
-- Ignore maximize requests from apps.
hl.window_rule({
name = "Ignore Maximize Requests",
match = { class = ".*" },
suppress_event = "maximize",
})
-- Fix some dragging issues with XWayland.
hl.window_rule({
name = "XWayland Drag Fix",
match = {
xwayland = 1,
title = "^$",
class = "^$",
float = true,
fullscreen = false,
pin = false,
},
no_focus = true,
})
hl.window_rule({
name = "Pinentry Center",
match = { class = "^(pinentry-.*)$" },
float = true,
center = true,
stay_focused = true,
})
-- Picture-in-Picture: pinned floating mini-player in bottom-right quadrant.
hl.window_rule({
name = "PIP",
match = { title = "Picture-in-Picture" },
pin = 1,
float = 1,
size = "(monitor_w/4) (monitor_h/4)",
move = "(3*monitor_w/4)-22 (monitor_h-window_h-22)",
})
hl.env("QT_QPA_PLATFORMTHEME", "hyprqt6engine")
'';
};
}
+105
View File
@@ -0,0 +1,105 @@
{
config,
lib,
pkgs,
...
}:
let
font = "BerkeleyMono Nerd Font Mono";
monitor = "DP-1";
bg = "rgba(1d202144)"; # hard dark background
bg1 = "rgb(3c3836)"; # input fill
fg = "rgb(ebdbb2)"; # main text
muted = "rgb(928374)"; # dim text
orange = "rgb(fe8019)"; # accent — echoes your rofi orange
yellow = "rgb(fabd2f)"; # caps-lock
green = "rgb(b8bb26)"; # correct password
red = "rgb(fb4934)"; # wrong password
in
{
options.custom = {
hyprlock.enable = lib.mkEnableOption "enable hyprlock - lock splash screen";
};
config = lib.mkIf config.custom.hyprlock.enable {
programs.hyprlock = {
enable = true;
settings = {
general = {
hide_cursor = true;
ignore_empty_input = true;
# grace = 2 # seconds to dismiss with mouse before a password is required
};
# ---------- Background ----------
background = {
monitor = "${monitor}";
color = "${bg}";
# Prefer a wallpaper? drop `color` above and use:
# path = ~/nixos-config/wallpapers/lock.png
# blur_passes = 3
# blur_size = 6
};
# ---------- Clock ----------
label = [
{
monitor = "${monitor}";
text = "$TIME";
color = "${fg}";
font_size = 96;
font_family = "${font}";
position = "0, 120";
halign = "center";
valign = "center";
}
{
monitor = "${monitor}";
text = "cmd[update:60000] date +\"%A, %d %B\"";
color = "${muted}";
font_size = 18;
font_family = "${font}";
position = "0, 48";
halign = "center";
valign = "center";
}
{
monitor = "${monitor}";
text = "Hey, $USER";
color = "${orange}";
font_size = 16;
font_family = "${font}";
position = "0, -20";
halign = "center";
valign = "center";
}
];
# ---------- Input field ----------
input-field = {
monitor = "${monitor}";
size = "300, 54";
rounding = 14;
outline_thickness = 2;
dots_size = 0.25;
dots_spacing = 0.3;
dots_center = true;
outer_color = "${orange}";
inner_color = "${bg1}";
font_color = "${fg}";
check_color = "${green}";
fail_color = "${red}";
capslock_color = "${yellow}";
fade_on_empty = false;
placeholder_text = "<span foreground=\"##928374\"><i>󰌾 Enter password</i></span>";
fail_text = "<span foreground=\"##fb4934\"><i>$FAIL ($ATTEMPTS)</i></span>";
position = "0, -95";
halign = "center";
valign = "center";
};
};
};
};
}
@@ -0,0 +1,31 @@
{
config,
lib,
pkgs,
...
}:
let
font = "BerkeleyMono Nerd Font Mono";
monitor = "DP-1";
in{
options.custom = {
hyprpaper.enable = lib.mkEnableOption "enable hyprpaper - wallpaper manager";
};
config = lib.mkIf config.custom.hyprpaper.enable {
services.hyprpaper = {
enable = true;
settings = {
splash = false;
wallpaper = [
{
fit_mode = "cover";
monitor = "DP-1";
path = "/home/jpporta/dotfiles/colorschemes/.config/colorschemes/gruvbox-dark/wallpapers/wallhaven-9oxg98.jpg";
}
];
};
};
};
}
@@ -0,0 +1,36 @@
{
config,
lib,
pkgs,
...
}:
{
options.custom = {
hyprsunset.enable = lib.mkEnableOption "enable hyprsunset - eye saver";
};
config = lib.mkIf config.custom.hyprsunset.enable {
services.hyprsunset = {
enable = true;
settings = {
max-gamma = 150;
# profile = [
# {
# time = "7:30";
# identity = true;
# }
# {
# time = "18:00";
# temperature = 4000;
# gamma = 1;
# }
# {
# time = "20:00";
# temperature = 4000;
# gamma = 0.8;
# }
# ];
};
};
};
}
+16
View File
@@ -0,0 +1,16 @@
{ lib, config, pkgs, ... }:
{
options.custom = {
nvim.enable = lib.mkEnableOption "enable nvim - symlink config files";
};
config = lib.mkIf config.custom.nvim.enable {
home.packages = with pkgs; [
neovim
fzf
];
xdg.configFile."nvim".source = config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/nixos-config/modules/home-manager/nvim/nvim";
};
}
+27
View File
@@ -0,0 +1,27 @@
vim.g.mapleader = " "
vim.g.maplocalleader = " "
vim.opt.termguicolors = true
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable", -- latest stayle release
lazypath,
})
end
vim.opt.rtp:prepend(lazypath)
vim.g.language = "en_US"
require("lazy").setup("plugins")
require("jpporta.autocommands")
require("jpporta.remaps")
require("jpporta.sets")
require("jpporta.lsp")
require("jpporta.theme")
require("jpporta.snippets")
require("jpporta.macros")
@@ -0,0 +1,72 @@
{
"LuaSnip": { "branch": "master", "commit": "0abc8f390b278c3b4aabc4c004ac8a088b65cf24" },
"base16-nvim": { "branch": "master", "commit": "21233d5fd574439ae1e2f5e4bfbc574214f4ab3d" },
"catppuccin": { "branch": "main", "commit": "05e8787020dcfdb937bf2ff23855ea2415b4e072" },
"cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" },
"cmp-nvim-lsp": { "branch": "main", "commit": "cbc7b02bb99fae35cb42f514762b89b5126651ef" },
"cmp-path": { "branch": "main", "commit": "c642487086dbd9a93160e1679a1327be111cbc25" },
"cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" },
"cobalt2.nvim": { "branch": "main", "commit": "0cc17f3491feba19ed62b2d9622577f7822a0113" },
"colorbuddy.nvim": { "branch": "master", "commit": "cdb5b0654d3cafe61d2a845e15b2b4b0e78e752a" },
"copilot.vim": { "branch": "release", "commit": "a12fd5672110c8aa7e3c8419e28c96943ca179be" },
"diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" },
"dracula.nvim": { "branch": "main", "commit": "ae752c13e95fb7c5f58da4b5123cb804ea7568ee" },
"everforest": { "branch": "master", "commit": "85a86eb62409e3ec88713bff3d1b9d7374e112e4" },
"friendly-snippets": { "branch": "main", "commit": "6cd7280adead7f586db6fccbd15d2cac7e2188b9" },
"git-blame.nvim": { "branch": "main", "commit": "5c536e2d4134d064aa3f41575280bc8a2a0e03d7" },
"gitsigns.nvim": { "branch": "main", "commit": "eb60cc7b94c46005237fd34170d76f3a089a90aa" },
"gruvbox.nvim": { "branch": "main", "commit": "154eb5ff5b96d0641307113fa385eaf0d36d9796" },
"icalendar.vim": { "branch": "master", "commit": "542fff45385b1b5ad9781b0ad4878ba3b7ee9d5f" },
"kanagawa.nvim": { "branch": "master", "commit": "bb85e4bfc8d89b0e62c8fa53ccdd13d12e2f77b3" },
"lazy.nvim": { "branch": "main", "commit": "85c7ff3711b730b4030d03144f6db6375044ae82" },
"lazygit.nvim": { "branch": "main", "commit": "a04ad0dbc725134edbee3a5eea29290976695357" },
"leetcode.nvim": { "branch": "master", "commit": "4e8b3683940a8377379ce9398e7f329e3560b42c" },
"lspkind.nvim": { "branch": "master", "commit": "c7274c48137396526b59d86232eabcdc7fed8a32" },
"lualine.nvim": { "branch": "master", "commit": "221ce6b2d999187044529f49da6554a92f740a96" },
"lush.nvim": { "branch": "main", "commit": "9c60ec2279d62487d942ce095e49006af28eed6e" },
"markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" },
"marks.nvim": { "branch": "master", "commit": "f353e8c08c50f39e99a9ed474172df7eddd89b72" },
"mason.nvim": { "branch": "main", "commit": "2a6940af80375532e5e9e7c1f2fc6319a1b7a69d" },
"mini.comment": { "branch": "main", "commit": "27a29d6b949b9497f80a0a03421e89fed71d8c37" },
"mini.nvim": { "branch": "main", "commit": "928971c3cfe99ddf29659acc31214cfa836fabe4" },
"monochrome.nvim": { "branch": "main", "commit": "2de78d9688ea4a177bcd9be554ab9192337d35ff" },
"monokai.nvim": { "branch": "master", "commit": "b8bd44d5796503173627d7a1fc51f77ec3a08a63" },
"neo-tree.nvim": { "branch": "v3.x", "commit": "ebd66767191714e008ce73b769518a763ff31bdc" },
"neoformat": { "branch": "master", "commit": "9d95e5ca3ab263363758d5b1d7a174a30556ab2d" },
"neovim": { "branch": "main", "commit": "ff483051a47e27d84bdef47703538df1ed9f4a47" },
"neovim-ayu": { "branch": "master", "commit": "e5a9f0fa2918d6b5f57c21b3ac014314ee5e41c8" },
"nightfox.nvim": { "branch": "main", "commit": "4dacd3f0185a2227bdf3b6c0975a8f0bf87cac9a" },
"none-ls-extras.nvim": { "branch": "main", "commit": "27681d797a26f1b4d6119296df42f5204c88a2dc" },
"none-ls.nvim": { "branch": "main", "commit": "01f8e62ea11603e59ad9ff7afcfa94fd183f76d6" },
"nord.nvim": { "branch": "master", "commit": "80c1e5321505aeb22b7a9f23eb82f1e193c12470" },
"nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" },
"nvim-autopairs": { "branch": "master", "commit": "7b9923abad60b903ece7c52940e1321d39eccc79" },
"nvim-cmp": { "branch": "main", "commit": "a1d504892f2bc56c2e79b65c6faded2fd21f3eca" },
"nvim-colorizer.lua": { "branch": "master", "commit": "664c0b7cea1de71f8b65dfe951b7996fc3e6ccde" },
"nvim-lsp-file-operations": { "branch": "master", "commit": "b9c795d3973e8eec22706af14959bc60c579e771" },
"nvim-notify": { "branch": "master", "commit": "8701bece920b38ea289b457f902e2ad184131a5d" },
"nvim-parinfer": { "branch": "master", "commit": "3968e669d9f02589aa311d33cb475b16b27c5fbb" },
"nvim-silicon": { "branch": "main", "commit": "7f66bda8f60c97a5bf4b37e5b8acb0e829ae3c32" },
"nvim-snazzy": { "branch": "main", "commit": "2d53dc44eac2e13cb205270cb534a500971d3ad5" },
"nvim-treesitter": { "branch": "main", "commit": "4916d6592ede8c07973490d9322f187e07dfefac" },
"nvim-web-devicons": { "branch": "master", "commit": "dad71387de386a946b123079d0e53f23028f3abd" },
"oil.nvim": { "branch": "master", "commit": "b73018b75affd13fa38e2fc94ef753b465f770d7" },
"plenary.nvim": { "branch": "master", "commit": "74b06c6c75e4eeb3108ec01852001636d85a932b" },
"quicker.nvim": { "branch": "master", "commit": "4a6883cb13fe097a20a046eb55f6dffd239276e3" },
"render-markdown.nvim": { "branch": "main", "commit": "f422cb5c6855f150e2ddcfaf44e7157b98b34f6a" },
"rustaceanvim": { "branch": "main", "commit": "3ace64feb1ce3cf3c63e6297e1378a82fe548618" },
"snacks.nvim": { "branch": "main", "commit": "882c996cf28183f4d63640de0b4c02ec886d01f2" },
"tailwindcss-colorizer-cmp.nvim": { "branch": "main", "commit": "3d3cd95e4a4135c250faf83dd5ed61b8e5502b86" },
"telescope-emoji": { "branch": "master", "commit": "86248d97be84a1ce83f0541500ef9edc99ea2aa1" },
"telescope-fzf-native.nvim": { "branch": "main", "commit": "b25b749b9db64d375d782094e2b9dce53ad53a40" },
"telescope.nvim": { "branch": "master", "commit": "5255aa27c422de944791318024167ad5d40aad20" },
"todo-comments.nvim": { "branch": "main", "commit": "31e3c38ce9b29781e4422fc0322eb0a21f4e8668" },
"tokyonight.nvim": { "branch": "main", "commit": "cdc07ac78467a233fd62c493de29a17e0cf2b2b6" },
"transparent.nvim": { "branch": "main", "commit": "e00ca1cf09caef575edf8da7e5a8b9193893b4c7" },
"vim-markdown": { "branch": "master", "commit": "f9f845f28f4da33a7655accb22f4ad21f7d9fb66" },
"vim-polyglot": { "branch": "master", "commit": "f061eddb7cdcc614c8406847b2bfb53099832a4e" },
"vim-tmux-navigator": { "branch": "master", "commit": "e41c431a0c7b7388ae7ba341f01a0d217eb3a432" },
"vimwiki": { "branch": "dev", "commit": "a54a3002e229c4b43d69ced170ff77663a5b2c40" },
"which-key.nvim": { "branch": "main", "commit": "3aab2147e74890957785941f0c1ad87d0a44c15a" },
"zk": { "branch": "main", "commit": "bca7e4a119353f18f2a819385fb7ce10269ef747" }
}
@@ -0,0 +1,28 @@
return {
cmd = { 'gopls' },
filetypes = {
'go',
'gomod',
'gowork',
'gotmpl',
'gosum'
},
root_markers = {
'go.mod',
'go.work',
'.git'
},
settings = {
gopls = {
gofumpt = true,
hints = {
assignVariableTypes = true,
compositeLiteralFields = true,
compositeLiteralTypes = true,
functionTypeParameters = true,
parameterNames = true,
rangeVariableTypes = true,
},
}
}
}
@@ -0,0 +1,162 @@
local function insert_package_json(root_files, field, fname)
local pkg_path = vim.fs.find("package.json", { upward = true, path = fname })[1]
if pkg_path then
local ok, content = pcall(vim.fn.readfile, pkg_path)
if ok then
local json = table.concat(content, "\n")
if string.find(json, '"' .. field .. '"') then
table.insert(root_files, pkg_path)
end
end
end
return root_files
end
local function root_markers_with_field(root_files, files, field, fname)
for _, f in ipairs(files) do
local path = vim.fs.find(f, { upward = true, path = fname })[1]
if path then
local ok, content = pcall(vim.fn.readfile, path)
if ok then
local text = table.concat(content, "\n")
if string.find(text, field) then
table.insert(root_files, path)
end
end
end
end
return root_files
end
---@brief
--- https://github.com/tailwindlabs/tailwindcss-intellisense
---
--- Tailwind CSS Language Server can be installed via npm:
---
--- npm install -g @tailwindcss/language-server
---@type vim.lsp.Config
return {
cmd = { "tailwindcss-language-server", "--stdio" },
-- filetypes copied and adjusted from tailwindcss-intellisense
filetypes = {
-- html
"aspnetcorerazor",
"astro",
"astro-markdown",
"blade",
"clojure",
"django-html",
"htmldjango",
"edge",
"eelixir", -- vim ft
"elixir",
"ejs",
"erb",
"eruby", -- vim ft
"gohtml",
"gohtmltmpl",
"haml",
"handlebars",
"hbs",
"html",
"htmlangular",
"html-eex",
"heex",
"jade",
"leaf",
"liquid",
"markdown",
"mdx",
"mustache",
"njk",
"nunjucks",
"php",
"razor",
"slim",
"twig",
-- css
"css",
"less",
"postcss",
"sass",
"scss",
"stylus",
"sugarss",
-- js
"javascript",
"javascriptreact",
"reason",
"rescript",
"typescript",
"typescriptreact",
-- mixed
"vue",
"svelte",
"templ",
},
settings = {
tailwindCSS = {
validate = true,
lint = {
cssConflict = "warning",
invalidApply = "error",
invalidScreen = "error",
invalidVariant = "error",
invalidConfigPath = "error",
invalidTailwindDirective = "error",
recommendedVariantOrder = "warning",
},
classAttributes = {
"class",
"className",
"class:list",
"classList",
"ngClass",
},
includeLanguages = {
eelixir = "html-eex",
elixir = "phoenix-heex",
eruby = "erb",
heex = "phoenix-heex",
htmlangular = "html",
templ = "html",
},
},
},
before_init = function(_, config)
if not config.settings then
config.settings = {}
end
if not config.settings.editor then
config.settings.editor = {}
end
if not config.settings.editor.tabSize then
config.settings.editor.tabSize = vim.lsp.util.get_effective_tabstop()
end
end,
workspace_required = true,
root_dir = function(bufnr, on_dir)
local root_files = {
-- Generic
"tailwind.config.js",
"tailwind.config.cjs",
"tailwind.config.mjs",
"tailwind.config.ts",
"postcss.config.js",
"postcss.config.cjs",
"postcss.config.mjs",
"postcss.config.ts",
-- Django
"theme/static_src/tailwind.config.js",
"theme/static_src/tailwind.config.cjs",
"theme/static_src/tailwind.config.mjs",
"theme/static_src/tailwind.config.ts",
"theme/static_src/postcss.config.js",
-- Fallback for tailwind v4, where tailwind.config.* is not required anymore
".git",
}
local fname = vim.api.nvim_buf_get_name(bufnr)
root_files = insert_package_json(root_files, "tailwindcss", fname)
root_files = root_markers_with_field(root_files, { "mix.lock", "Gemfile.lock" }, "tailwind", fname)
on_dir(vim.fs.dirname(vim.fs.find(root_files, { path = fname, upward = true })[1]))
end,
}
@@ -0,0 +1,7 @@
return {
cmd = { "tinymist" },
filetypes = { "typst" },
settings = {
formatterMode = "typstyle"
}
}
@@ -0,0 +1,69 @@
return {
init_options = { hostInfo = 'neovim' },
cmd = { 'typescript-language-server', '--stdio' },
filetypes = {
'javascript',
'javascriptreact',
'javascript.jsx',
'typescript',
'typescriptreact',
'typescript.tsx',
},
root_markers = { 'tsconfig.json', 'jsconfig.json', 'package.json', '.git' },
handlers = {
-- handle rename request for certain code actions like extracting functions / types
['_typescript.rename'] = function(_, result, ctx)
local client = assert(vim.lsp.get_client_by_id(ctx.client_id))
vim.lsp.util.show_document({
uri = result.textDocument.uri,
range = {
start = result.position,
['end'] = result.position,
},
}, client.offset_encoding)
vim.lsp.buf.rename()
return vim.NIL
end,
},
commands = {
['editor.action.showReferences'] = function(command, ctx)
local client = assert(vim.lsp.get_client_by_id(ctx.client_id))
local file_uri, position, references = unpack(command.arguments)
local quickfix_items = vim.lsp.util.locations_to_items(references, client.offset_encoding)
vim.fn.setqflist({}, ' ', {
title = command.title,
items = quickfix_items,
context = {
command = command,
bufnr = ctx.bufnr,
},
})
vim.lsp.util.show_document({
uri = file_uri,
range = {
start = position,
['end'] = position,
},
}, client.offset_encoding)
vim.cmd('botright copen')
end,
},
on_attach = function(client, bufnr)
-- ts_ls provides `source.*` code actions that apply to the whole file. These only appear in
-- `vim.lsp.buf.code_action()` if specified in `context.only`.
vim.api.nvim_buf_create_user_command(bufnr, 'LspTypescriptSourceAction', function()
local source_actions = vim.tbl_filter(function(action)
return vim.startswith(action, 'source.')
end, client.server_capabilities.codeActionProvider.codeActionKinds)
vim.lsp.buf.code_action({
context = {
only = source_actions,
},
})
end, {})
end,
}
@@ -0,0 +1,33 @@
vim.api.nvim_create_autocmd({ "BufRead", "BufNewFile" }, { pattern = "*.http", command = "set ft=http" })
vim.api.nvim_create_autocmd({ "BufRead", "BufNewFile" }, { pattern = "*.templ", command = "set ft=templ" })
vim.api.nvim_create_autocmd({ "BufReadPost", "BufNewFile" }, {
pattern = "**/inbox/[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9].md",
callback = function()
-- Run `date` and capture output
local handle = io.popen('date "+%H:%M"')
local time = handle:read("*l")
handle:close()
-- Build the line with a trailing colon and space
local line = time .. ": "
-- Append it at the bottom
local last_line = vim.api.nvim_buf_line_count(0)
vim.api.nvim_buf_set_lines(0, last_line, last_line, false, { line })
-- Place cursor at the end of the inserted line
vim.api.nvim_win_set_cursor(0, { last_line + 1, #line })
-- Enter insert mode
vim.cmd("startinsert")
end,
})
local highlight_group = vim.api.nvim_create_augroup("YankHighlight", { clear = true })
vim.api.nvim_create_autocmd("TextYankPost", {
callback = function()
vim.highlight.on_yank()
end,
group = highlight_group,
pattern = "*",
})
@@ -0,0 +1,154 @@
return {
kind = {
Array = "",
Boolean = "",
Class = "",
Color = "",
Constant = "",
Constructor = "",
Enum = "",
EnumMember = "",
Event = "",
Field = "",
File = "",
Folder = "󰉋 ",
Function = "",
Interface = "",
Key = "",
Keyword = "",
Method = "",
Module = "",
Namespace = "",
Null = "󰟢 ",
Number = "",
Object = "",
Operator = "",
Package = "",
Property = "",
Reference = "",
Snippet = "",
String = "",
Struct = "",
Text = "",
TypeParameter = "",
Unit = "",
Value = "",
Variable = ""
},
git = {
LineAdded = "",
LineModified = "",
LineRemoved = "",
FileDeleted = "",
FileIgnored = "",
FileRenamed = "",
FileStaged = "S",
FileUnmerged = "",
FileUnstaged = "",
FileUntracked = "U",
Diff = "",
Repo = "",
Octoface = "",
Branch = ""
},
ui = {
ArrowCircleDown = "",
ArrowCircleLeft = "",
ArrowCircleRight = "",
ArrowCircleUp = "",
BoldArrowDown = "",
BoldArrowLeft = "",
BoldArrowRight = "",
BoldArrowUp = "",
BoldClose = "",
BoldDividerLeft = "",
BoldDividerRight = "",
BoldLineLeft = "",
BookMark = "",
BoxChecked = "",
Bug = "",
Stacks = "",
Scopes = "",
Watches = "󰂥",
DebugConsole = "",
Calendar = "",
Check = "",
ChevronRight = "",
ChevronShortDown = "",
ChevronShortLeft = "",
ChevronShortRight = "",
ChevronShortUp = "",
Circle = "",
Close = "󰅖",
CloudDownload = "",
Code = "",
Comment = "",
Dashboard = "",
DividerLeft = "",
DividerRight = "",
DoubleChevronRight = "»",
Ellipsis = "",
EmptyFolder = "",
EmptyFolderOpen = "",
File = "",
FileSymlink = "",
Files = "",
FindFile = "󰈞",
FindText = "󰊄",
Fire = "",
Folder = "󰉋 ",
FolderOpen = "",
FolderSymlink = "",
Forward = "",
Gear = "",
History = "",
Lightbulb = "",
LineLeft = "",
LineMiddle = "",
List = "",
Lock = "",
NewFile = " ",
Note = "",
Package = "",
Pencil = "󰏫 ",
Plus = "",
Project = "",
Search = "",
SignIn = "",
SignOut = "",
Tab = "󰌒 ",
Table = "",
Target = "󰀘 ",
Telescope = "",
Text = "",
Tree = "",
Triangle = "󰐊",
TriangleShortArrowDown = "",
TriangleShortArrowLeft = "",
TriangleShortArrowRight = "",
TriangleShortArrowUp = ""
},
diagnostics = {
BoldError = "",
Error = "",
BoldWarning = "",
Warning = "",
BoldInformation = "",
Information = "",
BoldQuestion = "",
Question = "",
BoldHint = "",
Hint = "󰌶",
Debug = "",
Trace = ""
},
misc = {
Robot = "󰚩 ",
Squirrel = "",
Tag = "",
Watch = "",
Smiley = "",
Package = "",
CircuitBoard = ""
}
}
@@ -0,0 +1,62 @@
vim.lsp.enable("ts_ls")
vim.lsp.enable("gopls")
-- vim.lsp.enable("tailwindcss")
-- Auto complete
vim.api.nvim_create_autocmd("LspAttach", {
callback = function(args)
local client = vim.lsp.get_client_by_id(args.data.client_id)
-- if client:supports_method("textDocument/completion") then
-- vim.opt.completeopt = { "menu", "menuone", "noinsert", "fuzzy", "popup" }
-- vim.lsp.completion.enable(true, client.id, args.buf, { autotrigger = true })
-- vim.keymap.set("i", "<C-Space>", function()
-- vim.lsp.completion.get()
-- end)
-- end
local augroup = vim.api.nvim_create_augroup("LspFormatting", {})
vim.api.nvim_clear_autocmds({ group = augroup, buffer = args.buf })
-- vim.api.nvim_create_autocmd("BufWritePre", {
-- group = augroup,
-- buffer = args.buf,
-- callback = function()
-- vim.cmd("Neoformat")
-- end,
-- })
if client:supports_method("textDocument/inlayHint") then
vim.lsp.inlay_hint.enable(true)
vim.keymap.set("n", "gp", function()
vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled())
end, {
desc = "Toggle Inlay Hints",
})
end
vim.keymap.set("n", "gd", function()
vim.lsp.buf.type_definition()
end, {
desc = "Go to Type Definition",
})
vim.keymap.set("n", "gi", function()
vim.lsp.buf.implementation()
end, {
desc = "Go to Implementation",
})
end,
})
vim.diagnostic.config({
virtual_text = {
spacing = 4,
},
signs = {
text = {
[vim.diagnostic.severity.ERROR] = "",
[vim.diagnostic.severity.WARN] = "",
[vim.diagnostic.severity.INFO] = "",
[vim.diagnostic.severity.HINT] = "󰠠 ",
},
},
update_in_insert = false,
severity_sort = true,
})
@@ -0,0 +1,4 @@
local esc = vim.api.nvim_replace_termcodes("<Esc>", true, true, true)
local ret = vim.api.nvim_replace_termcodes("<CR>", true, true, true)
vim.fn.setreg('o', "jjo€ - " ..esc.. "p4j0f:llv$hP3j0wv$hP" ..esc.. ":w" ..ret)
@@ -0,0 +1,27 @@
vim.keymap.set({ "n", "v" }, "<Space>", "<Nop>", { silent = true })
vim.keymap.set("n", "k", "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true })
vim.keymap.set("n", "j", "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true })
vim.keymap.set("n", "<C-u>", "<C-u>zz")
vim.keymap.set("n", "<C-d>", "<C-d>zz")
vim.keymap.set("n", "[d", vim.diagnostic.goto_prev, { desc = "Go to previous diagnostic message" })
vim.keymap.set("n", "]d", vim.diagnostic.goto_next, { desc = "Go to next diagnostic message" })
vim.keymap.set("n", "<leader>q", vim.diagnostic.setloclist, { desc = "Open diagnostics list" })
vim.keymap.set("n", "<leader>qq", function()
local wins = vim.fn.getwininfo()
for _, win in pairs(wins) do
if win["quickfix"] == 1 then
vim.cmd.cclose()
return
end
end
vim.cmd.copen()
end, { desc = "Toggle quickfix list" })
vim.keymap.set("n", "<leader>bo", "<cmd>%bd|e#<cr>", { desc = "Close all buffers but the current one" }) -- https://stackoverflow.com/a/42071865/516188
vim.keymap.set("n", "<leader>tt", function()
vim.cmd("TransparentToggle")
source_matugen()
end, { desc = "Toggle transparency" })
@@ -0,0 +1,39 @@
vim.opt.guicursor = ""
vim.opt.relativenumber = true
vim.o.hlsearch = false
vim.wo.number = true
vim.o.mouse = "a"
vim.o.clipboard = "unnamedplus"
vim.o.breakindent = true
vim.o.undofile = true
vim.o.ignorecase = true
vim.o.smartcase = true
vim.wo.signcolumn = "yes"
vim.o.updatetime = 250
vim.o.tabstop = 2
vim.o.shiftwidth = 4
vim.o.timeout = true
vim.o.timeoutlen = 300
vim.opt.scrolloff = 8
vim.o.completeopt = "menuone,noselect"
vim.o.termguicolors = true
vim.o.swapfile = false
vim.o.cursorline = true
vim.cmd.set("cursorline")
vim.cmd.set("cursorcolumn")
vim.opt.conceallevel = 2
vim.opt.colorcolumn = "80"
vim.api.nvim_create_user_command("CpFullPath", function()
local path = vim.fn.expand("%:p")
vim.fn.setreg("+", path)
vim.notify('Copied "' .. path .. '" to the clipboard!')
end, {})
vim.api.nvim_create_user_command("CpRelPath", function()
local path = vim.fn.expand("%")
vim.fn.setreg("+", path)
vim.notify('Copied "' .. path .. '" to the clipboard!')
end, {})
vim.g.neoformat_try_node_exe = 1
vim.opt.winborder = 'rounded'
@@ -0,0 +1,31 @@
local ls = require("luasnip")
local s = ls.snippet
local i = ls.insert_node
local t = ls.text_node
local extras = require("luasnip.extras")
local rep = extras.rep
vim.keymap.set({ "i", "s" }, "<A-k>", function()
if ls.expand_or_jumpable() then
ls.expand_or_jump()
end
end, { silent = true })
vim.keymap.set({ "i", "s" }, "<A-j>", function()
if ls.jumpable(-1) then
ls.jump(-1)
end
end, { silent = true })
local console_log_snippet = s("cl", {
t("console.log('"),
i(1, "var"),
t(":', "),
rep(1),
t(");"),
})
ls.add_snippets("typescript", { console_log_snippet })
ls.add_snippets("javascript", { console_log_snippet })
ls.add_snippets("typescriptreact", { console_log_snippet })
ls.add_snippets("javascriptreact", { console_log_snippet })
@@ -0,0 +1,18 @@
function source_matugen()
local matugen_path = os.getenv("HOME") .. "/.config/nvim/lua/jpporta/themes/gruvbox-dark.lua"
-- dofile doesn't expand $HOME or ~
dofile(matugen_path)
end
-- local function auxiliary_function()
-- source_matugen()
-- vim.cmd("TransparentEnable")
-- end
--
-- -- Register an autocmd to listen for matugen updates
-- vim.api.nvim_create_autocmd("Signal", {
-- pattern = "SIGUSR1",
-- callback = auxiliary_function,
-- })
source_matugen()
@@ -0,0 +1,2 @@
vim.o.background = "dark"
vim.cmd("colorscheme ayu-dark")
@@ -0,0 +1,2 @@
vim.o.background = "light"
vim.cmd("colorscheme ayu-light")
@@ -0,0 +1,2 @@
vim.o.background = "light"
vim.cmd("colorscheme catppuccin-latte")
@@ -0,0 +1,2 @@
vim.o.background = "dark"
vim.cmd("colorscheme catppuccin-mocha")
@@ -0,0 +1,2 @@
vim.o.background = "dark"
vim.cmd("colorscheme cobalt2")
@@ -0,0 +1,2 @@
vim.o.background = "dark"
vim.cmd("colorscheme dracula")
@@ -0,0 +1,2 @@
vim.o.background = "dark"
vim.cmd("colorscheme gruvbox")
@@ -0,0 +1,2 @@
vim.o.background = "light"
vim.cmd("colorscheme gruvbox")
@@ -0,0 +1,2 @@
vim.o.background = "dark"
vim.cmd("colorscheme monokai_pro")
@@ -0,0 +1,2 @@
vim.o.background = "light"
vim.cmd("colorscheme monokai_ristretto")
@@ -0,0 +1,2 @@
vim.o.background = "dark"
vim.cmd("colorscheme rose-pine")
@@ -0,0 +1,2 @@
vim.o.background = "light"
vim.cmd("colorscheme rose-pine")
@@ -0,0 +1,2 @@
vim.o.background = "dark"
vim.cmd("colorscheme snazzy")
@@ -0,0 +1,2 @@
vim.o.background = "dark"
vim.cmd("colorscheme tokyonight")
@@ -0,0 +1,10 @@
return {
"OlegGulevskyy/better-ts-errors.nvim",
dependencies = { "MunifTanjim/nui.nvim" },
opts = {
keymaps = {
toggle = "<leader>dd",
go_to_definition = "<leader>dx",
},
},
}
@@ -0,0 +1,54 @@
return {
{
"folke/zen-mode.nvim",
opts = {
window = {
width = 80,
},
plugins = {
options = {
ruler = false,
enabled = true,
},
kitty = {
enabled = true,
},
gitsigns = {
enabled = true,
},
tmux = { enabled = true },
twilight = {
enabled = true,
},
},
},
keys = {
{
"<leader>zm",
":ZenMode<CR>",
desc = "Zen Mode",
mode = "n",
},
},
cmd = {
"ZenMode",
},
},
{
"folke/twilight.nvim",
opts = {},
cmd = { "Twilight" },
keys = {
{
"<leader>tw",
":Twilight<CR>",
desc = "Twilight",
mode = "n",
},
},
},
{
"preservim/vim-pencil",
cmd = { "Pencil", "NoPencil", "TogglePencil", "SoftPencil", "HardPencil" },
},
}
@@ -0,0 +1,127 @@
local js_based_languages = {
"typescript",
"javascript",
"typescriptreact",
"javascriptreact",
"vue",
}
return {
"rcarriga/nvim-dap-ui",
event = "VeryLazy",
dependencies = {
{ "mfussenegger/nvim-dap" },
{ "nvim-neotest/nvim-nio" },
{
"microsoft/vscode-js-debug",
-- After install, build it and rename the dist directory to out
build = "npm install --legacy-peer-deps --no-save && npx gulp vsDebugServerBundle && rm -rf out && mv dist out",
version = "1.*",
},
{
"mxsdev/nvim-dap-vscode-js",
config = function()
---@diagnostic disable-next-line: missing-fields
require("dap-vscode-js").setup({
debugger_path = vim.fn.resolve(vim.fn.stdpath("data") .. "/lazy/vscode-js-debug"),
adapters = {
"chrome",
"pwa-node",
"pwa-chrome",
"pwa-msedge",
"pwa-extensionHost",
"node-terminal",
},
})
end,
},
{
"Joakker/lua-json5",
build = "./install.sh",
},
},
config = function()
local dap = require("dap")
local dapui = require("dapui")
dapui.setup()
-- ADAPTERS
for _, language in ipairs(js_based_languages) do
dap.configurations[language] = {
-- Debug single nodejs files
{
type = "pwa-node",
request = "launch",
name = "Launch file",
program = "${file}",
cwd = vim.fn.getcwd(),
sourceMaps = true,
},
-- Debug nodejs processes (make sure to add --inspect when you run the process)
{
type = "pwa-node",
request = "attach",
name = "Attach",
processId = require("dap.utils").pick_process,
cwd = vim.fn.getcwd(),
sourceMaps = true,
},
-- Debug web applications (client side)
{
type = "pwa-chrome",
request = "launch",
name = "Launch & Debug Chrome",
url = function()
local co = coroutine.running()
return coroutine.create(function()
vim.ui.input({
prompt = "Enter URL: ",
default = "http://localhost:3000",
}, function(url)
if url == nil or url == "" then
return
else
coroutine.resume(co, url)
end
end)
end)
end,
webRoot = vim.fn.getcwd(),
protocol = "inspector",
sourceMaps = true,
userDataDir = false,
},
-- Divider for the launch.json derived configs
{
name = "----- ↓ launch.json configs ↓ -----",
type = "",
request = "launch",
},
}
end
-- EVENT LISTENERS
dap.listeners.after.event_initialized["dapui_config"] = function()
dapui.open()
end
dap.listeners.before.event_terminated["dapui_config"] = function()
dapui.close()
end
dap.listeners.before.event_exited["dapui_config"] = function()
dapui.close()
end
-- MAPPINGS
vim.keymap.set("n", "<leader>db", "<cmd>DapToggleBreakpoint<CR>", { desc = "[D]ap [B]reakpoint" })
vim.keymap.set("n", "<leader>dc", "<cmd>DapContinue<CR>", { desc = "[D]ap [C]ontinue" })
vim.keymap.set("n", "<leader>da", function()
if vim.fn.filereadable(".vscode/launch.json") then
local dap_vscode = require("dap.ext.vscode")
dap_vscode.load_launchjs(nil, {
["pwa-node"] = js_based_languages,
["chrome"] = js_based_languages,
["pwa-chrome"] = js_based_languages,
})
end
require("dap").continue()
end, { desc = "[D]ap [A]ttach" })
end,
}
@@ -0,0 +1,4 @@
return {
"stevearc/dressing.nvim",
event = "VeryLazy",
}
@@ -0,0 +1,14 @@
return {
"folke/flash.nvim",
event = "VeryLazy",
---@type Flash.Config
opts = {},
-- stylua: ignore
keys = {
{ "s", mode = { "n", "x", "o" }, function() require("flash").jump() end, desc = "Flash" },
{ "S", mode = { "n", "x", "o" }, function() require("flash").treesitter() end, desc = "Flash Treesitter" },
{ "r", mode = "o", function() require("flash").remote() end, desc = "Remote Flash" },
{ "R", mode = { "o", "x" }, function() require("flash").treesitter_search() end, desc = "Treesitter Search" },
{ "<c-s>", mode = { "c" }, function() require("flash").toggle() end, desc = "Toggle Flash Search" },
},
}
@@ -0,0 +1,40 @@
return {
"stevearc/conform.nvim",
event = { "BufReadPre", "BufNewFile" },
config = function()
local conform = require("conform")
conform.setup({
formatters = {
csharpier = {
command = "csharpier",
args = { "format" },
},
},
formatters_by_ft = {
lua = { "stylua" },
javascript = { "prettierd", "prettier", stop_after_first = true },
typescript = { "prettierd", "prettier", stop_after_first = true },
javascriptreact = { "prettierd", "prettier", stop_after_first = true },
typescriptreact = { "prettierd", "prettier", stop_after_first = true },
json = { "prettierd", "prettier", stop_after_first = true },
markdown = { "prettierd", "prettier", stop_after_first = true },
go = { "gofmt" },
nix = { "nixfmt" },
templ = { "gofmt" },
cs = { "csharpier" },
},
format_on_save = {
timeout_ms = 500,
lsp_fomrat = "fallback",
},
})
vim.keymap.set({ "n", "v" }, "<leader>f", function()
conform.format({
lsp_fallback = true,
async = false,
timeout_ms = 500,
})
end, { desc = "Format" })
end,
}
@@ -0,0 +1,111 @@
return {
"mhartington/formatter.nvim",
event = "VeryLazy",
keys = {
{
"<leader>f",
":Format<CR>",
desc = "Format file",
mode = "n",
},
},
config = function()
require("formatter").setup({
filetype = {
javascript = { require("formatter.filetypes.javascript").prettierd },
typescript = { require("formatter.filetypes.typescript").prettierd },
javascriptreact = { require("formatter.filetypes.javascriptreact").prettierd },
typescriptreact = { require("formatter.filetypes.typescriptreact").prettierd },
json = { require("formatter.filetypes.json").jq },
lua = { require("formatter.filetypes.lua").stylua },
rust = { require("formatter.filetypes.rust").rustfmt },
go = { require("formatter.filetypes.go").goimports },
markdown = { require("formatter.filetypes.markdown").prettierd },
html = { require("formatter.filetypes.html").prettierd },
css = { require("formatter.filetypes.css").prettierd },
nix = { require("formatter.filetypes.nix").nixpkgs_fmt },
["*"] = {
require("formatter.filetypes.any").remove_trailing_whitespace,
},
},
})
vim.api.nvim_create_autocmd("BufWritePost", { command = "FormatWriteLock" })
end,
}
-- return {
-- "stevearc/conform.nvim",
-- event = { "BufReadPre", "BufNewFile" },
-- cmd = "ConformInfo",
-- opts = {
-- formatters_by_ft = {
-- javascript = { { "prettier", "jsbeautify" } },
-- typescript = { "prettier" },
-- javascriptreact = { { "prettier", "jsbeautify" } },
-- typescriptreact = { "prettier" },
-- json = { "prettier" },
-- lua = { "stylua" },
-- rust = { "rustfmt" },
-- go = { "goimports" },
-- markdown = { { "deno_fmt", "prettier", "prettierd" } },
-- html = { "prettier" },
-- css = { "prettier" },
-- },
-- format_on_save = function(bufnr)
-- -- Disable with a global or buffer-local variable
-- if vim.g.disable_autoformat or vim.b[bufnr].disable_autoformat then
-- return
-- end
-- return { timeout_ms = 500, lsp_fallback = true }
-- end,
-- },
-- keys = {
-- {
-- "<leader>f",
-- function()
-- require("conform").format({
-- lsp_fallback = true,
-- async = true,
-- })
-- end,
-- desc = "Format file",
-- },
-- },
-- config = function()
-- local notify = require("notify")
-- local function show_notification(message, level)
-- notify(message, level, { title = "conform.nvim" })
-- end
-- vim.api.nvim_create_user_command("FormatToggle", function(args)
-- local is_global = not args.bang
-- if is_global then
-- vim.g.disable_autoformat = not vim.g.disable_autoformat
-- if vim.g.disable_autoformat then
-- show_notification("Autoformat-on-save disabled globally", "info")
-- else
-- show_notification("Autoformat-on-save enabled globally", "info")
-- end
-- else
-- vim.b.disable_autoformat = not vim.b.disable_autoformat
-- if vim.b.disable_autoformat then
-- show_notification("Autoformat-on-save disabled for this buffer", "info")
-- else
-- show_notification("Autoformat-on-save enabled for this buffer", "info")
-- end
-- end
-- end, {
-- desc = "Toggle autoformat-on-save",
-- bang = true,
-- })
-- vim.api.nvim_create_user_command("Format", function(args)
-- local range = nil
-- if args.count ~= -1 then
-- local end_line = vim.api.nvim_buf_get_lines(0, args.line2 - 1, args.line2, true)[1]
-- range = {
-- start = { args.line1, 0 },
-- ["end"] = { args.line2, end_line:len() },
-- }
-- end
-- require("conform").format({ async = true, lsp_fallback = true, range = range })
-- end, { range = true })
-- end,
-- }
@@ -0,0 +1,3 @@
return {
"tpope/vim-fugitive",
}
@@ -0,0 +1,4 @@
return {
"gleam-lang/gleam.vim",
ft = "gleam",
}
@@ -0,0 +1 @@
return { "ellisonleao/glow.nvim", config = true, cmd = "Glow" }

Some files were not shown because too many files have changed in this diff Show More