commit 29377d0c9ab6920d84990338f169f1ac61b41851 Author: Joao Porta Date: Sun Jul 12 15:25:55 2026 -0300 merge diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..bcd9d26 --- /dev/null +++ b/flake.lock @@ -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 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..ea8435e --- /dev/null +++ b/flake.nix @@ -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 + ]; + }; + }; +} diff --git a/hosts/jpporta-nixos/configuration.nix b/hosts/jpporta-nixos/configuration.nix new file mode 100644 index 0000000..aaf4e69 --- /dev/null +++ b/hosts/jpporta-nixos/configuration.nix @@ -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"; +} diff --git a/hosts/jpporta-nixos/hardware-configuration.nix b/hosts/jpporta-nixos/hardware-configuration.nix new file mode 100644 index 0000000..55b777c --- /dev/null +++ b/hosts/jpporta-nixos/hardware-configuration.nix @@ -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; +} diff --git a/hosts/jpporta-nixos/home.nix b/hosts/jpporta-nixos/home.nix new file mode 100644 index 0000000..8709f3a --- /dev/null +++ b/hosts/jpporta-nixos/home.nix @@ -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; +} diff --git a/hosts/writter-deck/fonts/berkeley-mono-patched/BerkeleyMonoNerdFontMono-Black.otf b/hosts/writter-deck/fonts/berkeley-mono-patched/BerkeleyMonoNerdFontMono-Black.otf new file mode 100644 index 0000000..e2aeeae Binary files /dev/null and b/hosts/writter-deck/fonts/berkeley-mono-patched/BerkeleyMonoNerdFontMono-Black.otf differ diff --git a/hosts/writter-deck/fonts/berkeley-mono-patched/BerkeleyMonoNerdFontMono-BlackOblique.otf b/hosts/writter-deck/fonts/berkeley-mono-patched/BerkeleyMonoNerdFontMono-BlackOblique.otf new file mode 100644 index 0000000..2e50534 Binary files /dev/null and b/hosts/writter-deck/fonts/berkeley-mono-patched/BerkeleyMonoNerdFontMono-BlackOblique.otf differ diff --git a/hosts/writter-deck/fonts/berkeley-mono-patched/BerkeleyMonoNerdFontMono-Bold.otf b/hosts/writter-deck/fonts/berkeley-mono-patched/BerkeleyMonoNerdFontMono-Bold.otf new file mode 100644 index 0000000..ad3ec5a Binary files /dev/null and b/hosts/writter-deck/fonts/berkeley-mono-patched/BerkeleyMonoNerdFontMono-Bold.otf differ diff --git a/hosts/writter-deck/fonts/berkeley-mono-patched/BerkeleyMonoNerdFontMono-BoldOblique.otf b/hosts/writter-deck/fonts/berkeley-mono-patched/BerkeleyMonoNerdFontMono-BoldOblique.otf new file mode 100644 index 0000000..c7aef87 Binary files /dev/null and b/hosts/writter-deck/fonts/berkeley-mono-patched/BerkeleyMonoNerdFontMono-BoldOblique.otf differ diff --git a/hosts/writter-deck/fonts/berkeley-mono-patched/BerkeleyMonoNerdFontMono-ExtraBold.otf b/hosts/writter-deck/fonts/berkeley-mono-patched/BerkeleyMonoNerdFontMono-ExtraBold.otf new file mode 100644 index 0000000..fad796c Binary files /dev/null and b/hosts/writter-deck/fonts/berkeley-mono-patched/BerkeleyMonoNerdFontMono-ExtraBold.otf differ diff --git a/hosts/writter-deck/fonts/berkeley-mono-patched/BerkeleyMonoNerdFontMono-ExtraBoldOblique.otf b/hosts/writter-deck/fonts/berkeley-mono-patched/BerkeleyMonoNerdFontMono-ExtraBoldOblique.otf new file mode 100644 index 0000000..b19d9c0 Binary files /dev/null and b/hosts/writter-deck/fonts/berkeley-mono-patched/BerkeleyMonoNerdFontMono-ExtraBoldOblique.otf differ diff --git a/hosts/writter-deck/fonts/berkeley-mono-patched/BerkeleyMonoNerdFontMono-ExtraLight.otf b/hosts/writter-deck/fonts/berkeley-mono-patched/BerkeleyMonoNerdFontMono-ExtraLight.otf new file mode 100644 index 0000000..b094946 Binary files /dev/null and b/hosts/writter-deck/fonts/berkeley-mono-patched/BerkeleyMonoNerdFontMono-ExtraLight.otf differ diff --git a/hosts/writter-deck/fonts/berkeley-mono-patched/BerkeleyMonoNerdFontMono-ExtraLightOblique.otf b/hosts/writter-deck/fonts/berkeley-mono-patched/BerkeleyMonoNerdFontMono-ExtraLightOblique.otf new file mode 100644 index 0000000..a38f990 Binary files /dev/null and b/hosts/writter-deck/fonts/berkeley-mono-patched/BerkeleyMonoNerdFontMono-ExtraLightOblique.otf differ diff --git a/hosts/writter-deck/fonts/berkeley-mono-patched/BerkeleyMonoNerdFontMono-Light.otf b/hosts/writter-deck/fonts/berkeley-mono-patched/BerkeleyMonoNerdFontMono-Light.otf new file mode 100644 index 0000000..c64fc15 Binary files /dev/null and b/hosts/writter-deck/fonts/berkeley-mono-patched/BerkeleyMonoNerdFontMono-Light.otf differ diff --git a/hosts/writter-deck/fonts/berkeley-mono-patched/BerkeleyMonoNerdFontMono-LightOblique.otf b/hosts/writter-deck/fonts/berkeley-mono-patched/BerkeleyMonoNerdFontMono-LightOblique.otf new file mode 100644 index 0000000..dcd5a1b Binary files /dev/null and b/hosts/writter-deck/fonts/berkeley-mono-patched/BerkeleyMonoNerdFontMono-LightOblique.otf differ diff --git a/hosts/writter-deck/fonts/berkeley-mono-patched/BerkeleyMonoNerdFontMono-Medium.otf b/hosts/writter-deck/fonts/berkeley-mono-patched/BerkeleyMonoNerdFontMono-Medium.otf new file mode 100644 index 0000000..31890ac Binary files /dev/null and b/hosts/writter-deck/fonts/berkeley-mono-patched/BerkeleyMonoNerdFontMono-Medium.otf differ diff --git a/hosts/writter-deck/fonts/berkeley-mono-patched/BerkeleyMonoNerdFontMono-MediumOblique.otf b/hosts/writter-deck/fonts/berkeley-mono-patched/BerkeleyMonoNerdFontMono-MediumOblique.otf new file mode 100644 index 0000000..1811a5f Binary files /dev/null and b/hosts/writter-deck/fonts/berkeley-mono-patched/BerkeleyMonoNerdFontMono-MediumOblique.otf differ diff --git a/hosts/writter-deck/fonts/berkeley-mono-patched/BerkeleyMonoNerdFontMono-Oblique.otf b/hosts/writter-deck/fonts/berkeley-mono-patched/BerkeleyMonoNerdFontMono-Oblique.otf new file mode 100644 index 0000000..9f7a0cc Binary files /dev/null and b/hosts/writter-deck/fonts/berkeley-mono-patched/BerkeleyMonoNerdFontMono-Oblique.otf differ diff --git a/hosts/writter-deck/fonts/berkeley-mono-patched/BerkeleyMonoNerdFontMono-Regular.otf b/hosts/writter-deck/fonts/berkeley-mono-patched/BerkeleyMonoNerdFontMono-Regular.otf new file mode 100644 index 0000000..3ceaef2 Binary files /dev/null and b/hosts/writter-deck/fonts/berkeley-mono-patched/BerkeleyMonoNerdFontMono-Regular.otf differ diff --git a/hosts/writter-deck/fonts/berkeley-mono-patched/BerkeleyMonoNerdFontMono-SemiBold.otf b/hosts/writter-deck/fonts/berkeley-mono-patched/BerkeleyMonoNerdFontMono-SemiBold.otf new file mode 100644 index 0000000..665f4b5 Binary files /dev/null and b/hosts/writter-deck/fonts/berkeley-mono-patched/BerkeleyMonoNerdFontMono-SemiBold.otf differ diff --git a/hosts/writter-deck/fonts/berkeley-mono-patched/BerkeleyMonoNerdFontMono-SemiBoldOblique.otf b/hosts/writter-deck/fonts/berkeley-mono-patched/BerkeleyMonoNerdFontMono-SemiBoldOblique.otf new file mode 100644 index 0000000..0678794 Binary files /dev/null and b/hosts/writter-deck/fonts/berkeley-mono-patched/BerkeleyMonoNerdFontMono-SemiBoldOblique.otf differ diff --git a/hosts/writter-deck/fonts/berkeley-mono-patched/BerkeleyMonoNerdFontMono-SemiLight.otf b/hosts/writter-deck/fonts/berkeley-mono-patched/BerkeleyMonoNerdFontMono-SemiLight.otf new file mode 100644 index 0000000..0015113 Binary files /dev/null and b/hosts/writter-deck/fonts/berkeley-mono-patched/BerkeleyMonoNerdFontMono-SemiLight.otf differ diff --git a/hosts/writter-deck/fonts/berkeley-mono-patched/BerkeleyMonoNerdFontMono-SemiLightOblique.otf b/hosts/writter-deck/fonts/berkeley-mono-patched/BerkeleyMonoNerdFontMono-SemiLightOblique.otf new file mode 100644 index 0000000..acaf5d9 Binary files /dev/null and b/hosts/writter-deck/fonts/berkeley-mono-patched/BerkeleyMonoNerdFontMono-SemiLightOblique.otf differ diff --git a/hosts/writter-deck/fonts/berkeley-mono-patched/BerkeleyMonoNerdFontMono-Thin.otf b/hosts/writter-deck/fonts/berkeley-mono-patched/BerkeleyMonoNerdFontMono-Thin.otf new file mode 100644 index 0000000..d8d0373 Binary files /dev/null and b/hosts/writter-deck/fonts/berkeley-mono-patched/BerkeleyMonoNerdFontMono-Thin.otf differ diff --git a/hosts/writter-deck/fonts/berkeley-mono-patched/BerkeleyMonoNerdFontMono-ThinOblique.otf b/hosts/writter-deck/fonts/berkeley-mono-patched/BerkeleyMonoNerdFontMono-ThinOblique.otf new file mode 100644 index 0000000..8eeb1cd Binary files /dev/null and b/hosts/writter-deck/fonts/berkeley-mono-patched/BerkeleyMonoNerdFontMono-ThinOblique.otf differ diff --git a/hosts/writter-deck/fonts/berkeley-propo-patched/BerkeleyMonoNerdFontPropo-Black.otf b/hosts/writter-deck/fonts/berkeley-propo-patched/BerkeleyMonoNerdFontPropo-Black.otf new file mode 100644 index 0000000..a8687d6 Binary files /dev/null and b/hosts/writter-deck/fonts/berkeley-propo-patched/BerkeleyMonoNerdFontPropo-Black.otf differ diff --git a/hosts/writter-deck/fonts/berkeley-propo-patched/BerkeleyMonoNerdFontPropo-BlackOblique.otf b/hosts/writter-deck/fonts/berkeley-propo-patched/BerkeleyMonoNerdFontPropo-BlackOblique.otf new file mode 100644 index 0000000..f6bac71 Binary files /dev/null and b/hosts/writter-deck/fonts/berkeley-propo-patched/BerkeleyMonoNerdFontPropo-BlackOblique.otf differ diff --git a/hosts/writter-deck/fonts/berkeley-propo-patched/BerkeleyMonoNerdFontPropo-Bold.otf b/hosts/writter-deck/fonts/berkeley-propo-patched/BerkeleyMonoNerdFontPropo-Bold.otf new file mode 100644 index 0000000..6643cca Binary files /dev/null and b/hosts/writter-deck/fonts/berkeley-propo-patched/BerkeleyMonoNerdFontPropo-Bold.otf differ diff --git a/hosts/writter-deck/fonts/berkeley-propo-patched/BerkeleyMonoNerdFontPropo-BoldOblique.otf b/hosts/writter-deck/fonts/berkeley-propo-patched/BerkeleyMonoNerdFontPropo-BoldOblique.otf new file mode 100644 index 0000000..de4c004 Binary files /dev/null and b/hosts/writter-deck/fonts/berkeley-propo-patched/BerkeleyMonoNerdFontPropo-BoldOblique.otf differ diff --git a/hosts/writter-deck/fonts/berkeley-propo-patched/BerkeleyMonoNerdFontPropo-ExtraBold.otf b/hosts/writter-deck/fonts/berkeley-propo-patched/BerkeleyMonoNerdFontPropo-ExtraBold.otf new file mode 100644 index 0000000..759d563 Binary files /dev/null and b/hosts/writter-deck/fonts/berkeley-propo-patched/BerkeleyMonoNerdFontPropo-ExtraBold.otf differ diff --git a/hosts/writter-deck/fonts/berkeley-propo-patched/BerkeleyMonoNerdFontPropo-ExtraBoldOblique.otf b/hosts/writter-deck/fonts/berkeley-propo-patched/BerkeleyMonoNerdFontPropo-ExtraBoldOblique.otf new file mode 100644 index 0000000..32c2b41 Binary files /dev/null and b/hosts/writter-deck/fonts/berkeley-propo-patched/BerkeleyMonoNerdFontPropo-ExtraBoldOblique.otf differ diff --git a/hosts/writter-deck/fonts/berkeley-propo-patched/BerkeleyMonoNerdFontPropo-ExtraLight.otf b/hosts/writter-deck/fonts/berkeley-propo-patched/BerkeleyMonoNerdFontPropo-ExtraLight.otf new file mode 100644 index 0000000..f0a4d88 Binary files /dev/null and b/hosts/writter-deck/fonts/berkeley-propo-patched/BerkeleyMonoNerdFontPropo-ExtraLight.otf differ diff --git a/hosts/writter-deck/fonts/berkeley-propo-patched/BerkeleyMonoNerdFontPropo-ExtraLightOblique.otf b/hosts/writter-deck/fonts/berkeley-propo-patched/BerkeleyMonoNerdFontPropo-ExtraLightOblique.otf new file mode 100644 index 0000000..13ab8c5 Binary files /dev/null and b/hosts/writter-deck/fonts/berkeley-propo-patched/BerkeleyMonoNerdFontPropo-ExtraLightOblique.otf differ diff --git a/hosts/writter-deck/fonts/berkeley-propo-patched/BerkeleyMonoNerdFontPropo-Light.otf b/hosts/writter-deck/fonts/berkeley-propo-patched/BerkeleyMonoNerdFontPropo-Light.otf new file mode 100644 index 0000000..15e1568 Binary files /dev/null and b/hosts/writter-deck/fonts/berkeley-propo-patched/BerkeleyMonoNerdFontPropo-Light.otf differ diff --git a/hosts/writter-deck/fonts/berkeley-propo-patched/BerkeleyMonoNerdFontPropo-LightOblique.otf b/hosts/writter-deck/fonts/berkeley-propo-patched/BerkeleyMonoNerdFontPropo-LightOblique.otf new file mode 100644 index 0000000..e747476 Binary files /dev/null and b/hosts/writter-deck/fonts/berkeley-propo-patched/BerkeleyMonoNerdFontPropo-LightOblique.otf differ diff --git a/hosts/writter-deck/fonts/berkeley-propo-patched/BerkeleyMonoNerdFontPropo-Medium.otf b/hosts/writter-deck/fonts/berkeley-propo-patched/BerkeleyMonoNerdFontPropo-Medium.otf new file mode 100644 index 0000000..f2ac96d Binary files /dev/null and b/hosts/writter-deck/fonts/berkeley-propo-patched/BerkeleyMonoNerdFontPropo-Medium.otf differ diff --git a/hosts/writter-deck/fonts/berkeley-propo-patched/BerkeleyMonoNerdFontPropo-MediumOblique.otf b/hosts/writter-deck/fonts/berkeley-propo-patched/BerkeleyMonoNerdFontPropo-MediumOblique.otf new file mode 100644 index 0000000..e77e442 Binary files /dev/null and b/hosts/writter-deck/fonts/berkeley-propo-patched/BerkeleyMonoNerdFontPropo-MediumOblique.otf differ diff --git a/hosts/writter-deck/fonts/berkeley-propo-patched/BerkeleyMonoNerdFontPropo-Oblique.otf b/hosts/writter-deck/fonts/berkeley-propo-patched/BerkeleyMonoNerdFontPropo-Oblique.otf new file mode 100644 index 0000000..0215658 Binary files /dev/null and b/hosts/writter-deck/fonts/berkeley-propo-patched/BerkeleyMonoNerdFontPropo-Oblique.otf differ diff --git a/hosts/writter-deck/fonts/berkeley-propo-patched/BerkeleyMonoNerdFontPropo-Regular.otf b/hosts/writter-deck/fonts/berkeley-propo-patched/BerkeleyMonoNerdFontPropo-Regular.otf new file mode 100644 index 0000000..7c5611e Binary files /dev/null and b/hosts/writter-deck/fonts/berkeley-propo-patched/BerkeleyMonoNerdFontPropo-Regular.otf differ diff --git a/hosts/writter-deck/fonts/berkeley-propo-patched/BerkeleyMonoNerdFontPropo-SemiBold.otf b/hosts/writter-deck/fonts/berkeley-propo-patched/BerkeleyMonoNerdFontPropo-SemiBold.otf new file mode 100644 index 0000000..fb78565 Binary files /dev/null and b/hosts/writter-deck/fonts/berkeley-propo-patched/BerkeleyMonoNerdFontPropo-SemiBold.otf differ diff --git a/hosts/writter-deck/fonts/berkeley-propo-patched/BerkeleyMonoNerdFontPropo-SemiBoldOblique.otf b/hosts/writter-deck/fonts/berkeley-propo-patched/BerkeleyMonoNerdFontPropo-SemiBoldOblique.otf new file mode 100644 index 0000000..60e9851 Binary files /dev/null and b/hosts/writter-deck/fonts/berkeley-propo-patched/BerkeleyMonoNerdFontPropo-SemiBoldOblique.otf differ diff --git a/hosts/writter-deck/fonts/berkeley-propo-patched/BerkeleyMonoNerdFontPropo-SemiLight.otf b/hosts/writter-deck/fonts/berkeley-propo-patched/BerkeleyMonoNerdFontPropo-SemiLight.otf new file mode 100644 index 0000000..7b52b98 Binary files /dev/null and b/hosts/writter-deck/fonts/berkeley-propo-patched/BerkeleyMonoNerdFontPropo-SemiLight.otf differ diff --git a/hosts/writter-deck/fonts/berkeley-propo-patched/BerkeleyMonoNerdFontPropo-SemiLightOblique.otf b/hosts/writter-deck/fonts/berkeley-propo-patched/BerkeleyMonoNerdFontPropo-SemiLightOblique.otf new file mode 100644 index 0000000..e365f90 Binary files /dev/null and b/hosts/writter-deck/fonts/berkeley-propo-patched/BerkeleyMonoNerdFontPropo-SemiLightOblique.otf differ diff --git a/hosts/writter-deck/fonts/berkeley-propo-patched/BerkeleyMonoNerdFontPropo-Thin.otf b/hosts/writter-deck/fonts/berkeley-propo-patched/BerkeleyMonoNerdFontPropo-Thin.otf new file mode 100644 index 0000000..4a13196 Binary files /dev/null and b/hosts/writter-deck/fonts/berkeley-propo-patched/BerkeleyMonoNerdFontPropo-Thin.otf differ diff --git a/hosts/writter-deck/fonts/berkeley-propo-patched/BerkeleyMonoNerdFontPropo-ThinOblique.otf b/hosts/writter-deck/fonts/berkeley-propo-patched/BerkeleyMonoNerdFontPropo-ThinOblique.otf new file mode 100644 index 0000000..11117d2 Binary files /dev/null and b/hosts/writter-deck/fonts/berkeley-propo-patched/BerkeleyMonoNerdFontPropo-ThinOblique.otf differ diff --git a/hosts/writter-deck/home.nix b/hosts/writter-deck/home.nix new file mode 100644 index 0000000..5e6bf84 --- /dev/null +++ b/hosts/writter-deck/home.nix @@ -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"; +} diff --git a/modules/home-manager/alacritty/default.nix b/modules/home-manager/alacritty/default.nix new file mode 100644 index 0000000..4af4893 --- /dev/null +++ b/modules/home-manager/alacritty/default.nix @@ -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"; + } + ]; + }; + }; + }; + }; +} diff --git a/modules/home-manager/arch-packages/default.nix b/modules/home-manager/arch-packages/default.nix new file mode 100644 index 0000000..c6e8664 --- /dev/null +++ b/modules/home-manager/arch-packages/default.nix @@ -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 + ]; +} diff --git a/modules/home-manager/awww/default.nix b/modules/home-manager/awww/default.nix new file mode 100644 index 0000000..435ada2 --- /dev/null +++ b/modules/home-manager/awww/default.nix @@ -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 ]; + }; + }; +} diff --git a/modules/home-manager/bat/default.nix b/modules/home-manager/bat/default.nix new file mode 100644 index 0000000..9c78f7d --- /dev/null +++ b/modules/home-manager/bat/default.nix @@ -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"; + }; + }; + }; +} diff --git a/modules/home-manager/calendar/accounts.nix b/modules/home-manager/calendar/accounts.nix new file mode 100644 index 0000000..e5d56d1 --- /dev/null +++ b/modules/home-manager/calendar/accounts.nix @@ -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"; + }; + }; + }; + }; + }; + +} diff --git a/modules/home-manager/calendar/default.nix b/modules/home-manager/calendar/default.nix new file mode 100644 index 0000000..d4a3f26 --- /dev/null +++ b/modules/home-manager/calendar/default.nix @@ -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 + }; + + }; +} diff --git a/modules/home-manager/cedilla/default.nix b/modules/home-manager/cedilla/default.nix new file mode 100644 index 0000000..783cc12 --- /dev/null +++ b/modules/home-manager/cedilla/default.nix @@ -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" + + : "ç" ccedilla + : "Ç" 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" ]; + }; + }; +} diff --git a/modules/home-manager/darkman/default.nix b/modules/home-manager/darkman/default.nix new file mode 100644 index 0000000..d2c6eac --- /dev/null +++ b/modules/home-manager/darkman/default.nix @@ -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 + ''; + }; + }; + }; +} diff --git a/modules/home-manager/dictation/default.nix b/modules/home-manager/dictation/default.nix new file mode 100644 index 0000000..077b5d8 --- /dev/null +++ b/modules/home-manager/dictation/default.nix @@ -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" ]; + }; + }; +} diff --git a/modules/home-manager/fastfetch/default.nix b/modules/home-manager/fastfetch/default.nix new file mode 100644 index 0000000..0b1f58c --- /dev/null +++ b/modules/home-manager/fastfetch/default.nix @@ -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]"; + }; + } + ]; + }; + }; + }; +} diff --git a/modules/home-manager/hypridle/default.nix b/modules/home-manager/hypridle/default.nix new file mode 100644 index 0000000..0f41b81 --- /dev/null +++ b/modules/home-manager/hypridle/default.nix @@ -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"; + } + ]; + }; + }; + }; +} diff --git a/modules/home-manager/hyprland/default.nix b/modules/home-manager/hyprland/default.nix new file mode 100644 index 0000000..7bd115a --- /dev/null +++ b/modules/home-manager/hyprland/default.nix @@ -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") + ''; + }; +} diff --git a/modules/home-manager/hyprlock/default.nix b/modules/home-manager/hyprlock/default.nix new file mode 100644 index 0000000..f30ecc8 --- /dev/null +++ b/modules/home-manager/hyprlock/default.nix @@ -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 = "󰌾 Enter password"; + fail_text = "$FAIL ($ATTEMPTS)"; + + position = "0, -95"; + halign = "center"; + valign = "center"; + }; + }; + }; + }; +} diff --git a/modules/home-manager/hyprpaper/default.nix b/modules/home-manager/hyprpaper/default.nix new file mode 100644 index 0000000..5de9d9d --- /dev/null +++ b/modules/home-manager/hyprpaper/default.nix @@ -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"; + } + ]; + }; + }; + }; +} diff --git a/modules/home-manager/hyprsunset/default.nix b/modules/home-manager/hyprsunset/default.nix new file mode 100644 index 0000000..cd00302 --- /dev/null +++ b/modules/home-manager/hyprsunset/default.nix @@ -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; + # } + # ]; + }; + }; + }; +} diff --git a/modules/home-manager/nvim/default.nix b/modules/home-manager/nvim/default.nix new file mode 100644 index 0000000..d2cb8fc --- /dev/null +++ b/modules/home-manager/nvim/default.nix @@ -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"; + }; +} diff --git a/modules/home-manager/nvim/nvim/init.lua b/modules/home-manager/nvim/nvim/init.lua new file mode 100644 index 0000000..1b63bbb --- /dev/null +++ b/modules/home-manager/nvim/nvim/init.lua @@ -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") diff --git a/modules/home-manager/nvim/nvim/lazy-lock.json b/modules/home-manager/nvim/nvim/lazy-lock.json new file mode 100644 index 0000000..0b1cf98 --- /dev/null +++ b/modules/home-manager/nvim/nvim/lazy-lock.json @@ -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" } +} diff --git a/modules/home-manager/nvim/nvim/lsp/gopls.lua b/modules/home-manager/nvim/nvim/lsp/gopls.lua new file mode 100644 index 0000000..b0dceda --- /dev/null +++ b/modules/home-manager/nvim/nvim/lsp/gopls.lua @@ -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, + }, + } + } +} diff --git a/modules/home-manager/nvim/nvim/lsp/tailwindcss.lua b/modules/home-manager/nvim/nvim/lsp/tailwindcss.lua new file mode 100644 index 0000000..15ff9cd --- /dev/null +++ b/modules/home-manager/nvim/nvim/lsp/tailwindcss.lua @@ -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, +} diff --git a/modules/home-manager/nvim/nvim/lsp/tinymist.lua b/modules/home-manager/nvim/nvim/lsp/tinymist.lua new file mode 100644 index 0000000..e80fbe5 --- /dev/null +++ b/modules/home-manager/nvim/nvim/lsp/tinymist.lua @@ -0,0 +1,7 @@ +return { + cmd = { "tinymist" }, + filetypes = { "typst" }, + settings = { + formatterMode = "typstyle" + } +} diff --git a/modules/home-manager/nvim/nvim/lsp/ts_ls.lua b/modules/home-manager/nvim/nvim/lsp/ts_ls.lua new file mode 100644 index 0000000..4dfea8d --- /dev/null +++ b/modules/home-manager/nvim/nvim/lsp/ts_ls.lua @@ -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, +} diff --git a/modules/home-manager/nvim/nvim/lua/jpporta/autocommands.lua b/modules/home-manager/nvim/nvim/lua/jpporta/autocommands.lua new file mode 100644 index 0000000..a9a12e9 --- /dev/null +++ b/modules/home-manager/nvim/nvim/lua/jpporta/autocommands.lua @@ -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 = "*", +}) diff --git a/modules/home-manager/nvim/nvim/lua/jpporta/icons.lua b/modules/home-manager/nvim/nvim/lua/jpporta/icons.lua new file mode 100644 index 0000000..0097fb9 --- /dev/null +++ b/modules/home-manager/nvim/nvim/lua/jpporta/icons.lua @@ -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 = " " + } +} diff --git a/modules/home-manager/nvim/nvim/lua/jpporta/lsp.lua b/modules/home-manager/nvim/nvim/lua/jpporta/lsp.lua new file mode 100644 index 0000000..40ce002 --- /dev/null +++ b/modules/home-manager/nvim/nvim/lua/jpporta/lsp.lua @@ -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", "", 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, +}) diff --git a/modules/home-manager/nvim/nvim/lua/jpporta/macros.lua b/modules/home-manager/nvim/nvim/lua/jpporta/macros.lua new file mode 100644 index 0000000..f73a580 --- /dev/null +++ b/modules/home-manager/nvim/nvim/lua/jpporta/macros.lua @@ -0,0 +1,4 @@ +local esc = vim.api.nvim_replace_termcodes("", true, true, true) +local ret = vim.api.nvim_replace_termcodes("", true, true, true) + +vim.fn.setreg('o', "jjo - " ..esc.. "p4j0f:llv$hP3j0wv$hP" ..esc.. ":w" ..ret) diff --git a/modules/home-manager/nvim/nvim/lua/jpporta/remaps.lua b/modules/home-manager/nvim/nvim/lua/jpporta/remaps.lua new file mode 100644 index 0000000..22d5d26 --- /dev/null +++ b/modules/home-manager/nvim/nvim/lua/jpporta/remaps.lua @@ -0,0 +1,27 @@ +vim.keymap.set({ "n", "v" }, "", "", { 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", "", "zz") +vim.keymap.set("n", "", "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", "q", vim.diagnostic.setloclist, { desc = "Open diagnostics list" }) + +vim.keymap.set("n", "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", "bo", "%bd|e#", { desc = "Close all buffers but the current one" }) -- https://stackoverflow.com/a/42071865/516188 + +vim.keymap.set("n", "tt", function() + vim.cmd("TransparentToggle") + source_matugen() +end, { desc = "Toggle transparency" }) diff --git a/modules/home-manager/nvim/nvim/lua/jpporta/sets.lua b/modules/home-manager/nvim/nvim/lua/jpporta/sets.lua new file mode 100644 index 0000000..3d230c3 --- /dev/null +++ b/modules/home-manager/nvim/nvim/lua/jpporta/sets.lua @@ -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' diff --git a/modules/home-manager/nvim/nvim/lua/jpporta/snippets.lua b/modules/home-manager/nvim/nvim/lua/jpporta/snippets.lua new file mode 100644 index 0000000..b96cba6 --- /dev/null +++ b/modules/home-manager/nvim/nvim/lua/jpporta/snippets.lua @@ -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" }, "", function() + if ls.expand_or_jumpable() then + ls.expand_or_jump() + end +end, { silent = true }) + +vim.keymap.set({ "i", "s" }, "", 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 }) diff --git a/modules/home-manager/nvim/nvim/lua/jpporta/theme.lua b/modules/home-manager/nvim/nvim/lua/jpporta/theme.lua new file mode 100644 index 0000000..eb0d64a --- /dev/null +++ b/modules/home-manager/nvim/nvim/lua/jpporta/theme.lua @@ -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() diff --git a/modules/home-manager/nvim/nvim/lua/jpporta/themes/ayu-dark.lua b/modules/home-manager/nvim/nvim/lua/jpporta/themes/ayu-dark.lua new file mode 100644 index 0000000..84958ff --- /dev/null +++ b/modules/home-manager/nvim/nvim/lua/jpporta/themes/ayu-dark.lua @@ -0,0 +1,2 @@ +vim.o.background = "dark" +vim.cmd("colorscheme ayu-dark") diff --git a/modules/home-manager/nvim/nvim/lua/jpporta/themes/ayu-light.lua b/modules/home-manager/nvim/nvim/lua/jpporta/themes/ayu-light.lua new file mode 100644 index 0000000..754f766 --- /dev/null +++ b/modules/home-manager/nvim/nvim/lua/jpporta/themes/ayu-light.lua @@ -0,0 +1,2 @@ +vim.o.background = "light" +vim.cmd("colorscheme ayu-light") diff --git a/modules/home-manager/nvim/nvim/lua/jpporta/themes/catppuccin-latte-light.lua b/modules/home-manager/nvim/nvim/lua/jpporta/themes/catppuccin-latte-light.lua new file mode 100644 index 0000000..f08c504 --- /dev/null +++ b/modules/home-manager/nvim/nvim/lua/jpporta/themes/catppuccin-latte-light.lua @@ -0,0 +1,2 @@ +vim.o.background = "light" +vim.cmd("colorscheme catppuccin-latte") diff --git a/modules/home-manager/nvim/nvim/lua/jpporta/themes/catppuccin-mocha-dark.lua b/modules/home-manager/nvim/nvim/lua/jpporta/themes/catppuccin-mocha-dark.lua new file mode 100644 index 0000000..9253c91 --- /dev/null +++ b/modules/home-manager/nvim/nvim/lua/jpporta/themes/catppuccin-mocha-dark.lua @@ -0,0 +1,2 @@ +vim.o.background = "dark" +vim.cmd("colorscheme catppuccin-mocha") diff --git a/modules/home-manager/nvim/nvim/lua/jpporta/themes/cobalt2-dark.lua b/modules/home-manager/nvim/nvim/lua/jpporta/themes/cobalt2-dark.lua new file mode 100644 index 0000000..fa42323 --- /dev/null +++ b/modules/home-manager/nvim/nvim/lua/jpporta/themes/cobalt2-dark.lua @@ -0,0 +1,2 @@ +vim.o.background = "dark" +vim.cmd("colorscheme cobalt2") diff --git a/modules/home-manager/nvim/nvim/lua/jpporta/themes/dracula-dark.lua b/modules/home-manager/nvim/nvim/lua/jpporta/themes/dracula-dark.lua new file mode 100644 index 0000000..76b8662 --- /dev/null +++ b/modules/home-manager/nvim/nvim/lua/jpporta/themes/dracula-dark.lua @@ -0,0 +1,2 @@ +vim.o.background = "dark" +vim.cmd("colorscheme dracula") diff --git a/modules/home-manager/nvim/nvim/lua/jpporta/themes/gruvbox-dark.lua b/modules/home-manager/nvim/nvim/lua/jpporta/themes/gruvbox-dark.lua new file mode 100644 index 0000000..5bb8fd0 --- /dev/null +++ b/modules/home-manager/nvim/nvim/lua/jpporta/themes/gruvbox-dark.lua @@ -0,0 +1,2 @@ +vim.o.background = "dark" +vim.cmd("colorscheme gruvbox") diff --git a/modules/home-manager/nvim/nvim/lua/jpporta/themes/gruvbox-light.lua b/modules/home-manager/nvim/nvim/lua/jpporta/themes/gruvbox-light.lua new file mode 100644 index 0000000..0000415 --- /dev/null +++ b/modules/home-manager/nvim/nvim/lua/jpporta/themes/gruvbox-light.lua @@ -0,0 +1,2 @@ +vim.o.background = "light" +vim.cmd("colorscheme gruvbox") diff --git a/modules/home-manager/nvim/nvim/lua/jpporta/themes/monokai-dark.lua b/modules/home-manager/nvim/nvim/lua/jpporta/themes/monokai-dark.lua new file mode 100644 index 0000000..0f44c9a --- /dev/null +++ b/modules/home-manager/nvim/nvim/lua/jpporta/themes/monokai-dark.lua @@ -0,0 +1,2 @@ +vim.o.background = "dark" +vim.cmd("colorscheme monokai_pro") diff --git a/modules/home-manager/nvim/nvim/lua/jpporta/themes/monokai-light.lua b/modules/home-manager/nvim/nvim/lua/jpporta/themes/monokai-light.lua new file mode 100644 index 0000000..1d66cea --- /dev/null +++ b/modules/home-manager/nvim/nvim/lua/jpporta/themes/monokai-light.lua @@ -0,0 +1,2 @@ +vim.o.background = "light" +vim.cmd("colorscheme monokai_ristretto") diff --git a/modules/home-manager/nvim/nvim/lua/jpporta/themes/rose-pine-dark.lua b/modules/home-manager/nvim/nvim/lua/jpporta/themes/rose-pine-dark.lua new file mode 100644 index 0000000..568169e --- /dev/null +++ b/modules/home-manager/nvim/nvim/lua/jpporta/themes/rose-pine-dark.lua @@ -0,0 +1,2 @@ +vim.o.background = "dark" +vim.cmd("colorscheme rose-pine") diff --git a/modules/home-manager/nvim/nvim/lua/jpporta/themes/rose-pine-light.lua b/modules/home-manager/nvim/nvim/lua/jpporta/themes/rose-pine-light.lua new file mode 100644 index 0000000..3ca8e76 --- /dev/null +++ b/modules/home-manager/nvim/nvim/lua/jpporta/themes/rose-pine-light.lua @@ -0,0 +1,2 @@ +vim.o.background = "light" +vim.cmd("colorscheme rose-pine") diff --git a/modules/home-manager/nvim/nvim/lua/jpporta/themes/snazzy-dark.lua b/modules/home-manager/nvim/nvim/lua/jpporta/themes/snazzy-dark.lua new file mode 100644 index 0000000..0b382fa --- /dev/null +++ b/modules/home-manager/nvim/nvim/lua/jpporta/themes/snazzy-dark.lua @@ -0,0 +1,2 @@ +vim.o.background = "dark" +vim.cmd("colorscheme snazzy") diff --git a/modules/home-manager/nvim/nvim/lua/jpporta/themes/tokyonight-dark.lua b/modules/home-manager/nvim/nvim/lua/jpporta/themes/tokyonight-dark.lua new file mode 100644 index 0000000..c52e536 --- /dev/null +++ b/modules/home-manager/nvim/nvim/lua/jpporta/themes/tokyonight-dark.lua @@ -0,0 +1,2 @@ +vim.o.background = "dark" +vim.cmd("colorscheme tokyonight") diff --git a/modules/home-manager/nvim/nvim/lua/plugin_bkp/better-ts-errors.lua b/modules/home-manager/nvim/nvim/lua/plugin_bkp/better-ts-errors.lua new file mode 100644 index 0000000..67a2d1b --- /dev/null +++ b/modules/home-manager/nvim/nvim/lua/plugin_bkp/better-ts-errors.lua @@ -0,0 +1,10 @@ +return { + "OlegGulevskyy/better-ts-errors.nvim", + dependencies = { "MunifTanjim/nui.nvim" }, + opts = { + keymaps = { + toggle = "dd", + go_to_definition = "dx", + }, + }, +} diff --git a/modules/home-manager/nvim/nvim/lua/plugin_bkp/chill.lua b/modules/home-manager/nvim/nvim/lua/plugin_bkp/chill.lua new file mode 100644 index 0000000..306c38d --- /dev/null +++ b/modules/home-manager/nvim/nvim/lua/plugin_bkp/chill.lua @@ -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 = { + { + "zm", + ":ZenMode", + desc = "Zen Mode", + mode = "n", + }, + }, + cmd = { + "ZenMode", + }, + }, + { + "folke/twilight.nvim", + opts = {}, + cmd = { "Twilight" }, + keys = { + { + "tw", + ":Twilight", + desc = "Twilight", + mode = "n", + }, + }, + }, + { + "preservim/vim-pencil", + cmd = { "Pencil", "NoPencil", "TogglePencil", "SoftPencil", "HardPencil" }, + }, +} diff --git a/modules/home-manager/nvim/nvim/lua/plugin_bkp/dap.lua b/modules/home-manager/nvim/nvim/lua/plugin_bkp/dap.lua new file mode 100644 index 0000000..a76783c --- /dev/null +++ b/modules/home-manager/nvim/nvim/lua/plugin_bkp/dap.lua @@ -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", "db", "DapToggleBreakpoint", { desc = "[D]ap [B]reakpoint" }) + vim.keymap.set("n", "dc", "DapContinue", { desc = "[D]ap [C]ontinue" }) + vim.keymap.set("n", "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, +} diff --git a/modules/home-manager/nvim/nvim/lua/plugin_bkp/dressing.lua b/modules/home-manager/nvim/nvim/lua/plugin_bkp/dressing.lua new file mode 100644 index 0000000..98f56c1 --- /dev/null +++ b/modules/home-manager/nvim/nvim/lua/plugin_bkp/dressing.lua @@ -0,0 +1,4 @@ +return { + "stevearc/dressing.nvim", + event = "VeryLazy", +} diff --git a/modules/home-manager/nvim/nvim/lua/plugin_bkp/flash.lua b/modules/home-manager/nvim/nvim/lua/plugin_bkp/flash.lua new file mode 100644 index 0000000..5e005af --- /dev/null +++ b/modules/home-manager/nvim/nvim/lua/plugin_bkp/flash.lua @@ -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" }, + { "", mode = { "c" }, function() require("flash").toggle() end, desc = "Toggle Flash Search" }, + }, +} diff --git a/modules/home-manager/nvim/nvim/lua/plugin_bkp/format.lua b/modules/home-manager/nvim/nvim/lua/plugin_bkp/format.lua new file mode 100644 index 0000000..5e42cf2 --- /dev/null +++ b/modules/home-manager/nvim/nvim/lua/plugin_bkp/format.lua @@ -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" }, "f", function() + conform.format({ + lsp_fallback = true, + async = false, + timeout_ms = 500, + }) + end, { desc = "Format" }) + end, +} diff --git a/modules/home-manager/nvim/nvim/lua/plugin_bkp/formatter.lua b/modules/home-manager/nvim/nvim/lua/plugin_bkp/formatter.lua new file mode 100644 index 0000000..b23846b --- /dev/null +++ b/modules/home-manager/nvim/nvim/lua/plugin_bkp/formatter.lua @@ -0,0 +1,111 @@ +return { + "mhartington/formatter.nvim", + event = "VeryLazy", + keys = { + { + "f", + ":Format", + 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 = { +-- { +-- "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, +-- } diff --git a/modules/home-manager/nvim/nvim/lua/plugin_bkp/fugitive.lua b/modules/home-manager/nvim/nvim/lua/plugin_bkp/fugitive.lua new file mode 100644 index 0000000..2b2edd0 --- /dev/null +++ b/modules/home-manager/nvim/nvim/lua/plugin_bkp/fugitive.lua @@ -0,0 +1,3 @@ +return { + "tpope/vim-fugitive", +} diff --git a/modules/home-manager/nvim/nvim/lua/plugin_bkp/gleam.lua b/modules/home-manager/nvim/nvim/lua/plugin_bkp/gleam.lua new file mode 100644 index 0000000..289f521 --- /dev/null +++ b/modules/home-manager/nvim/nvim/lua/plugin_bkp/gleam.lua @@ -0,0 +1,4 @@ +return { + "gleam-lang/gleam.vim", + ft = "gleam", +} diff --git a/modules/home-manager/nvim/nvim/lua/plugin_bkp/glow.lua b/modules/home-manager/nvim/nvim/lua/plugin_bkp/glow.lua new file mode 100644 index 0000000..39d28e5 --- /dev/null +++ b/modules/home-manager/nvim/nvim/lua/plugin_bkp/glow.lua @@ -0,0 +1 @@ +return { "ellisonleao/glow.nvim", config = true, cmd = "Glow" } diff --git a/modules/home-manager/nvim/nvim/lua/plugin_bkp/guard.lua b/modules/home-manager/nvim/nvim/lua/plugin_bkp/guard.lua new file mode 100644 index 0000000..c3b63fc --- /dev/null +++ b/modules/home-manager/nvim/nvim/lua/plugin_bkp/guard.lua @@ -0,0 +1,35 @@ +return { + "nvimdev/guard.nvim", + dependencies = { "nvimdev/guard-collection" }, + ft = { + "typescript", + "javascript", + "typescriptreact", + "json", + "markdown", + "lua", + "go", + }, + config = function() + local ft = require("guard.filetype") + local mdformat = { + cmd = "mdformat", + stdin = true, + } + + ft("typescript"):fmt("prettierd"):lint("eslint_d") + ft("javascript"):fmt("prettierd"):lint("eslint_d") + ft("typescriptreact"):fmt("prettierd"):lint("eslint_d") + ft("json"):fmt("prettierd"):lint("eslint_d") + ft("markdown"):fmt(mdformat):lint("eslint_d") + ft("lua"):fmt("stylua") + ft("go"):fmt("gofmt"):lint("golangci_lint") + + vim.keymap.set("n", "f", "Guard fmt", { desc = "Format" }) + + vim.g.guard_config = { + fmt_on_save = true, + save_on_fmt = false, + } + end, +} diff --git a/modules/home-manager/nvim/nvim/lua/plugin_bkp/lint.lua b/modules/home-manager/nvim/nvim/lua/plugin_bkp/lint.lua new file mode 100644 index 0000000..6940a74 --- /dev/null +++ b/modules/home-manager/nvim/nvim/lua/plugin_bkp/lint.lua @@ -0,0 +1,53 @@ +return { + "mfussenegger/nvim-lint", + event = { + "BufReadPre", + "BufNewFile", + }, + + opts = { + -- other config + linters = { + eslint_d = { + args = { + "--no-warn-ignored", -- <-- this is the key argument + "--format", + "json", + "--stdin", + "--stdin-filename", + function() + return vim.api.nvim_buf_get_name(0) + end, + }, + }, + }, + }, + + config = function() + local lint = require("lint") + lint.linters_by_ft = { + javascript = { "eslint" }, + typescript = { "eslint" }, + javascriptreact = { "eslint" }, + typescriptreact = { "eslint" }, + json = { "eslint" }, + lua = { "luac" }, + go = { "golangcilint" }, + templ = { "golangcilint" }, + } + + local lint_autogroup = vim.api.nvim_create_augroup("lint", { clear = true }) + + vim.api.nvim_create_autocmd({ "BufEnter", "BufWritePost", "InsertLeave" }, { + group = lint_autogroup, + callback = function() + lint.try_lint() + lint.try_lint("cspell") + end, + }) + + vim.keymap.set("n", "ll", function() + lint.try_lint() + end, { desc = "Trigger linting for current file" }) + end, +} diff --git a/modules/home-manager/nvim/nvim/lua/plugin_bkp/lintting.lua b/modules/home-manager/nvim/nvim/lua/plugin_bkp/lintting.lua new file mode 100644 index 0000000..d6809bb --- /dev/null +++ b/modules/home-manager/nvim/nvim/lua/plugin_bkp/lintting.lua @@ -0,0 +1,34 @@ +return { + "mfussenegger/nvim-lint", + event = { + "BufReadPre", + "BufNewFile", + }, + config = function() + local lint = require("lint") + + lint.linters_by_ft = { + javascript = { "eslint" }, + typescript = { "eslint" }, + javascriptreact = { "eslint" }, + typescriptreact = { "eslint" }, + json = { "eslint", "jsonlint" }, + go = { "golangcilint" }, + } + + local lint_augroup = vim.api.nvim_create_augroup("lint", { clear = true }) + vim.api.nvim_create_autocmd({ + "BufEnter", + "InsertLeave", + }, { + group = lint_augroup, + callback = function() + lint.try_lint() + end, + }) + + vim.keymap.set("n", "l", function() + lint.try_lint() + end, { desc = "Lint current file" }) + end, +} diff --git a/modules/home-manager/nvim/nvim/lua/plugin_bkp/lsp.lua b/modules/home-manager/nvim/nvim/lua/plugin_bkp/lsp.lua new file mode 100644 index 0000000..30479b7 --- /dev/null +++ b/modules/home-manager/nvim/nvim/lua/plugin_bkp/lsp.lua @@ -0,0 +1,137 @@ +return { + { "williamboman/mason.nvim", lazy = false, config = true }, + { + "williamboman/mason-lspconfig.nvim", + config = function() + require("mason-lspconfig").setup({ + ensure_installed = { + "html", + "ts_ls", + "tailwindcss", + "gopls", + "lua_ls", + "csharp_ls", + }, + automatic_installation = true, + }) + end, + }, + { + "neovim/nvim-lspconfig", + dependencies = { "folke/neodev.nvim", "j-hui/fidget.nvim", "hrsh7th/cmp-nvim-lsp" }, + event = { "BufReadPre", "BufNewFile" }, + config = function() + local keymap = vim.keymap + + local opts = { noremap = true, silent = true } + + local on_attach = function(client, bufnr) + opts.buffer = bufnr + opts.desc = "[G]oto [D]eclaration" + keymap.set("n", "gD", vim.lsp.buf.declaration, opts) + opts.desc = "[C]ode [A]ction" + keymap.set("n", "ca", vim.lsp.buf.code_action, opts) + opts.desc = "[G]oto [D]efinition" + keymap.set("n", "gd", "Telescope lsp_definitions", opts) + opts.desc = "[R]e[n]ame" + keymap.set("n", "rn", vim.lsp.buf.rename, opts) + opts.desc = "Diagnostics" + keymap.set("n", "d", vim.diagnostic.open_float, opts) + opts.desc = "File [D]iagnostics" + keymap.set("n", "D", "Telescope diagnostics bufnr=0", opts) + opts.desc = "Hover Documentation" + keymap.set("n", "K", vim.lsp.buf.hover, opts) + opts.desc = "Type Definitions" + keymap.set("n", "gt", "Telescope lsp_type_definitions", opts) + opts.desc = "[G]oto [I]mplementation" + keymap.set("n", "gI", "Telescope lsp_implementations", opts) + opts.desc = "Signature Documentation" + keymap.set("n", "", vim.lsp.buf.signature_help, opts) + opts.desc = "[W]orkspace [L]ist Folders" + keymap.set("n", "wl", function() + print(vim.inspect(vim.lsp.buf.list_workspace_folders())) + end, opts) + opts.desc = "Restart LSP" + keymap.set("n", "rs", ":LspRestart", opts) + end + + vim.diagnostic.config({ + signs = { + text = { + [vim.diagnostic.severity.ERROR] = " ", + [vim.diagnostic.severity.WARN] = " ", + [vim.diagnostic.severity.INFO] = " ", + [vim.diagnostic.severity.HINT] = "󰠠 ", + }, + linehl = { + [vim.diagnostic.severity.ERROR] = "Error", + [vim.diagnostic.severity.WARN] = "Warn", + [vim.diagnostic.severity.INFO] = "Info", + [vim.diagnostic.severity.HINT] = "Hint", + }, + }, + }) + + local lspconfig = require("lspconfig") + local cmp_nvim_lsp = require("cmp_nvim_lsp") + local capabilities = cmp_nvim_lsp.default_capabilities() + -- local servers = { + -- html = { + -- "emmet-ls", + -- }, + -- ts_ls = { + -- filetypes = { + -- "html", + -- "css", + -- "javascript", + -- "typescript", + -- "typescriptreact", + -- "javascriptreact", + -- }, + -- }, + -- tailwindcss = { + -- filetypes = { + -- "html", + -- "css", + -- "javascript", + -- "typescript", + -- "typescriptreact", + -- "javascriptreact", + -- }, + -- }, + -- gopls = { + -- cmd = { "gopls" }, + -- filetypes = { + -- "go", + -- "gomod", + -- "gowork", + -- "gotmpl", + -- }, + -- }, + -- lua_ls = { + -- Lua = { + -- workspace = { checkThirdParty = false }, + -- telemetry = { enable = false }, + -- diagnostics = { globals = { "vim" } }, + -- }, + -- }, + -- csharp_ls = { + -- cmd = { "csharp-ls" }, + -- filetypes = { + -- "cs", + -- "csproj", + -- }, + -- }, + -- } + -- + -- for server, settings in pairs(servers) do + -- lspconfig[server].setup({ + -- capabilities = capabilities, + -- on_attach = on_attach, + -- settings = settings, + -- filetypes = (settings or {}).filetypes, + -- }) + -- end + end, + }, +} diff --git a/modules/home-manager/nvim/nvim/lua/plugin_bkp/markdown-mermaid.lua b/modules/home-manager/nvim/nvim/lua/plugin_bkp/markdown-mermaid.lua new file mode 100644 index 0000000..7818a71 --- /dev/null +++ b/modules/home-manager/nvim/nvim/lua/plugin_bkp/markdown-mermaid.lua @@ -0,0 +1,6 @@ +return { + { + "mracos/mermaid.vim", + ft = "markdown", + }, +} diff --git a/modules/home-manager/nvim/nvim/lua/plugin_bkp/markdown-preview.lua b/modules/home-manager/nvim/nvim/lua/plugin_bkp/markdown-preview.lua new file mode 100644 index 0000000..93528d3 --- /dev/null +++ b/modules/home-manager/nvim/nvim/lua/plugin_bkp/markdown-preview.lua @@ -0,0 +1,10 @@ +return { + "iamcco/markdown-preview.nvim", + cmd = { + "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" + }, + build = "cd app && yarn install", + init = function() vim.g.mkdp_filetypes = {"markdown"} end, + ft = {"markdown"}, + event="VeryLazy" + } diff --git a/modules/home-manager/nvim/nvim/lua/plugin_bkp/mason.lua b/modules/home-manager/nvim/nvim/lua/plugin_bkp/mason.lua new file mode 100644 index 0000000..48354fc --- /dev/null +++ b/modules/home-manager/nvim/nvim/lua/plugin_bkp/mason.lua @@ -0,0 +1,4 @@ +return { + "williamboman/mason.nvim", + opts = {}, +} diff --git a/modules/home-manager/nvim/nvim/lua/plugin_bkp/neorg.lua b/modules/home-manager/nvim/nvim/lua/plugin_bkp/neorg.lua new file mode 100644 index 0000000..1b571b4 --- /dev/null +++ b/modules/home-manager/nvim/nvim/lua/plugin_bkp/neorg.lua @@ -0,0 +1,22 @@ +return { + "nvim-neorg/neorg", + dependencies = { "vhyrro/luarocks.nvim", "nvim-treesitter" }, + lazy = false, + version = "*", + config = function() + require("neorg").setup({ + load = { + ["core.defaults"] = {}, + ["core.concealer"] = {}, + ["core.dirman"] = { + config = { + workspaces = { + notes = "~/Documents/notes", + }, + default_workspace = "notes", + }, + }, + }, + }) + end, +} diff --git a/modules/home-manager/nvim/nvim/lua/plugin_bkp/none-ls.lua b/modules/home-manager/nvim/nvim/lua/plugin_bkp/none-ls.lua new file mode 100644 index 0000000..a48ddfa --- /dev/null +++ b/modules/home-manager/nvim/nvim/lua/plugin_bkp/none-ls.lua @@ -0,0 +1,53 @@ +return { + "nvimtools/none-ls.nvim", + dependencies = { + "nvimtools/none-ls-extras.nvim", + }, + config = function() + local setup, null_ls = pcall(require, "null-ls") + if not setup then + return + end + + local augroup = vim.api.nvim_create_augroup("LspFormatting", {}) + + null_ls.setup({ + sources = { + -- Completion + null_ls.builtins.completion.spell, + null_ls.builtins.completion.luasnip, + null_ls.builtins.completion.nvim_snippets, + -- Code Actions + require("none-ls.code_actions.eslint_d"), + -- Formatters + null_ls.builtins.formatting.prettierd, + null_ls.builtins.formatting.stylua, + -- Diagnostics + require("none-ls.diagnostics.eslint_d"), + null_ls.builtins.diagnostics.golangci_lint, + }, + -- configure format on save + vim.keymap.set("n", "f", function() + vim.lsp.buf.format({ async = true }) + end, { desc = "Format current buffer" }), + on_attach = function(current_client, bufnr) + if current_client.supports_method("textDocument/formatting") then + vim.api.nvim_clear_autocmds({ group = augroup, buffer = bufnr }) + vim.api.nvim_create_autocmd("BufWritePre", { + group = augroup, + buffer = bufnr, + callback = function() + vim.lsp.buf.format({ + filter = function(client) + -- only use null-ls for formatting instead of lsp server + return client.name == "null-ls" + end, + bufnr = bufnr, + }) + end, + }) + end + end, + }) + end, +} diff --git a/modules/home-manager/nvim/nvim/lua/plugin_bkp/notification.lua b/modules/home-manager/nvim/nvim/lua/plugin_bkp/notification.lua new file mode 100644 index 0000000..b9b4509 --- /dev/null +++ b/modules/home-manager/nvim/nvim/lua/plugin_bkp/notification.lua @@ -0,0 +1,18 @@ +return { + "rcarriga/nvim-notify", + event = "VeryLazy", + opts = { + timeout = 500, + render = "compact", + background_colour = "#000000", + max_height = function() + return math.floor(vim.o.lines * 0.75) + end, + max_width = function() + return math.floor(vim.o.columns * 0.25) + end, + on_open = function(win) + vim.api.nvim_win_set_config(win, { zindex = 100 }) + end, + }, +} diff --git a/modules/home-manager/nvim/nvim/lua/plugin_bkp/obsidian.lua b/modules/home-manager/nvim/nvim/lua/plugin_bkp/obsidian.lua new file mode 100644 index 0000000..d1b68b6 --- /dev/null +++ b/modules/home-manager/nvim/nvim/lua/plugin_bkp/obsidian.lua @@ -0,0 +1,151 @@ +return { + "epwalsh/obsidian.nvim", + version = "*", + lazy = true, + ft = "markdown", + dependencies = { "nvim-lua/plenary.nvim" }, + keys = { + { + "oo", + function() + vim.cmd("ObsidianToday") + end, + desc = "[O]bsidian T[o]day", + }, + { + "os", + function() + vim.cmd("ObsidianSearch") + end, + desc = "[O]bsidian [S]earch", + }, + { + "on", + function() + vim.cmd("ObsidianNew") + end, + desc = "[O]bsidian [N]ew", + }, + { + "oe", + ":ObsidianExtractNote", + desc = "[O]bsidian [E]xtract", + mode = "v", + }, + { + "ot", + ":ObsidianTemplate", + desc = "[O]bsidian [T]emplate", + mode = "n", + }, + }, + opts = { + + mappings = { + -- Overrides the 'gf' mapping to work on markdown/wiki links within your vault. + ["gf"] = { + action = function() + return require("obsidian").util.gf_passthrough() + end, + opts = { noremap = false, expr = true, buffer = true }, + }, + -- Toggle check-boxes. + ["ch"] = { + action = function() + return require("obsidian").util.toggle_checkbox() + end, + opts = { buffer = true }, + }, + }, + templates = { + subdir = "Templates", + date_format = "%Y-%m-%d", + time_format = "%H:%M", + -- A map for custom variables, the key should be the variable and the value a function + substitutions = { + date_format = function() + return os.date("%Y-%m-%d") + end, + date_full = function() + return os.date("%B %-d, %Y") + end, + }, + }, + note_id_func = function(title) + local suffix = "" + if title ~= nil then + -- If title is given, transform it into valid file name. + suffix = title:gsub(" ", "-"):gsub("[^A-Za-z0-9-]", ""):lower() + else + -- If title is nil, just add 4 random uppercase letters to the suffix. + for _ = 1, 4 do + suffix = suffix .. string.char(math.random(65, 90)) + end + end + return os.date("%s", os.time()) + end, + note_frontmatter_func = function(note) + -- This is equivalent to the default frontmatter function. + local out = { + tags = { "#note", "#journal" }, + created = os.date("%Y-%m-%d %H:%M:%S"), + } + -- `note.metadata` contains any manually added fields in the frontmatter. + -- So here we just make sure those fields are kept in the frontmatter. + if note.metadata ~= nil and not vim.tbl_isempty(note.metadata) then + for k, v in pairs(note.metadata) do + out[k] = v + end + end + return out + end, + follow_url_func = function(url) + -- vim.fn.jobstart({"xdg-open", url}) -- linux + vim.ui.open(url) -- need Neovim 0.10.0+ + end, + -- Optional, configure additional syntax highlighting / extmarks. + ui = { + enable = true, -- set to false to disable all additional syntax features + update_debounce = 200, -- update delay after a text change (in milliseconds) + -- Define how various check-boxes are displayed + checkboxes = { + -- NOTE: the 'char' value has to be a single character, and the highlight groups are defined below. + [" "] = { char = "", hl_group = "ObsidianTodo" }, + ["x"] = { char = "", hl_group = "ObsidianDone" }, + [">"] = { char = "", hl_group = "ObsidianRightArrow" }, + ["<"] = { char = "", hl_group = "ObsidianLeftArrow" }, + ["~"] = { char = "", hl_group = "ObsidianTilde" }, + ["v"] = { char = "", hl_group = "ObsidianPlay" }, + ["?"] = { char = "", hl_group = "ObsidianQuestion" }, + ["I"] = { char = "", hl_group = "ObsidianIdea" }, + }, + external_link_icon = { + char = "", + hl_group = "ObsidianExtLinkIcon", + }, + -- Replace the above with this if you don't have a patched font: + -- external_link_icon = { char = "", hl_group = "ObsidianExtLinkIcon" }, + reference_text = { hl_group = "ObsidianRefText" }, + highlight_text = { hl_group = "ObsidianHighlightText" }, + tags = { hl_group = "ObsidianTag" }, + hl_groups = { + -- The options are passed directly to `vim.api.nvim_set_hl()`. See `:help nvim_set_hl`. + ObsidianTodo = { bold = true, fg = "#7f849c" }, + ObsidianDone = { bold = true, fg = "#a6e3a1" }, + ObsidianPlay = { bold = true, fg = "#89b4fa" }, + ObsidianRightArrow = { bold = true, fg = "#fab387" }, + ObsidianLeftArrow = { bold = true, fg = "#f5c2e7" }, + ObsidianTilde = { bold = true, fg = "#f38ba8" }, + ObsidianQuestion = { bold = true, fg = "#b4befe" }, + ObsidianIdea = { bold = true, fg = "#f9e2af" }, + ObsidianRefText = { underline = true, fg = "#c792ea" }, + ObsidianExtLinkIcon = { fg = "#c792ea" }, + ObsidianTag = { italic = true, fg = "#89ddff" }, + ObsidianHighlightText = { bg = "#75662e" }, + }, + }, + dir = "~/Documents/Notes", + new_notes_location = "notes_subdir", + notes_subdir = "", + }, +} diff --git a/modules/home-manager/nvim/nvim/lua/plugin_bkp/prettier.lua b/modules/home-manager/nvim/nvim/lua/plugin_bkp/prettier.lua new file mode 100644 index 0000000..ad8c5ac --- /dev/null +++ b/modules/home-manager/nvim/nvim/lua/plugin_bkp/prettier.lua @@ -0,0 +1,41 @@ +return { + 'prettier/vim-prettier', + ft = { + 'javascript', + 'javascriptreact', + 'javascript.jsx', + 'typescript', + 'typescriptreact', + 'typescript.tsx', + "vue", + "css", + "scss", + "less", + "html", + "json", + "jsonc", + "yaml", + "markdown", + "graphql", + "handlebars", + "svelte", + "astro", + "htmlangular", + }, + config = function() + vim.g["prettier#autoformat"] = 1 + vim.g["prettier#autoformat_require_pragma"] = 0 + vim.g["prettier#quickfix_enabled"] = 0 + -- use prettier with prettierd + vim.b["prettier_exec_cmd"] = "prettierd" + end, + keys = { + { + "f", + function() + vim.cmd("Prettier") + end, + desc = "Format with Prettier", + }, + }, +} diff --git a/modules/home-manager/nvim/nvim/lua/plugin_bkp/trouble.lua b/modules/home-manager/nvim/nvim/lua/plugin_bkp/trouble.lua new file mode 100644 index 0000000..e3e8423 --- /dev/null +++ b/modules/home-manager/nvim/nvim/lua/plugin_bkp/trouble.lua @@ -0,0 +1,5 @@ +return { + "folke/trouble.nvim", + dependencies = { "nvim-tree/nvim-web-devicons" }, + opts = {}, +} diff --git a/modules/home-manager/nvim/nvim/lua/plugin_bkp/ts_ls.lua b/modules/home-manager/nvim/nvim/lua/plugin_bkp/ts_ls.lua new file mode 100644 index 0000000..daac43a --- /dev/null +++ b/modules/home-manager/nvim/nvim/lua/plugin_bkp/ts_ls.lua @@ -0,0 +1,67 @@ +return { + init_options = { hostInfo = "neovim" }, + cmd = { "typescript-language-server", "--stdio" }, + filetypes = { + "javascript", + "javascriptreact", + "typescript", + "typescriptreact", + }, + 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, +} diff --git a/modules/home-manager/nvim/nvim/lua/plugins/calendar.lua b/modules/home-manager/nvim/nvim/lua/plugins/calendar.lua new file mode 100644 index 0000000..9666dd0 --- /dev/null +++ b/modules/home-manager/nvim/nvim/lua/plugins/calendar.lua @@ -0,0 +1,10 @@ +return { + "vim-scripts/icalendar.vim", + setup = function() + vim.filetype.add({ + extension = { + ics = "icalendar", + }, + }) + end, +} diff --git a/modules/home-manager/nvim/nvim/lua/plugins/cmp.lua b/modules/home-manager/nvim/nvim/lua/plugins/cmp.lua new file mode 100644 index 0000000..9799ce7 --- /dev/null +++ b/modules/home-manager/nvim/nvim/lua/plugins/cmp.lua @@ -0,0 +1,72 @@ +return { + "hrsh7th/nvim-cmp", + event = { "InsertEnter", "CmdlineEnter" }, + dependencies = { + "hrsh7th/cmp-buffer", + "hrsh7th/cmp-path", + "L3MON4D3/LuaSnip", + "saadparwaiz1/cmp_luasnip", + "rafamadriz/friendly-snippets", + "onsails/lspkind.nvim", + "roobert/tailwindcss-colorizer-cmp.nvim", + "hrsh7th/cmp-nvim-lsp", + }, + + config = function() + local cmp = require("cmp") + local luasnip = require("luasnip") + local lspkind = require("lspkind") + + require("luasnip.loaders.from_vscode").lazy_load() + + cmp.setup({ + completion = { + autocomplete = { cmp.TriggerEvent.TextChanged }, + completeopt = "menu,menuone,noselect", -- standard Vim option + }, + preselect = cmp.PreselectMode.Item, + snippet = { + expand = function(args) + luasnip.lsp_expand(args.body) + end, + }, + + mapping = cmp.mapping.preset.insert({ + [""] = cmp.mapping.select_prev_item(), + [""] = cmp.mapping.select_next_item(), + [""] = cmp.mapping.scroll_docs(-4), + [""] = cmp.mapping.scroll_docs(4), + [""] = cmp.mapping.complete(), + [""] = cmp.mapping.abort(), + + [""] = cmp.mapping.confirm({ select = false }), + }), + sources = cmp.config.sources({ + -- LSP completions first + { name = "nvim_lsp", priority = 1000 }, + { name = "nvim_lsp_signature_help", priority = 900 }, + -- Snippets below LSP + { name = "luasnip", priority = 700 }, + -- Then none-ls / buffer / path + { name = "buffer", priority = 400 }, + { name = "path", priority = 300 }, + { name = "none-ls", priority = 200 }, + }), + formatting = { + format = function(entry, vim_item) + -- lspkind icons + vim_item.kind = lspkind.symbolic(vim_item.kind, { mode = "symbol_text" }) + + -- tailwindcss-colorizer + if entry.source.name == "nvim_lsp" then + local ok, tw = pcall(require, "tailwindcss-colorizer-cmp") + if ok then + vim_item = tw.formatter(entry, vim_item) + end + end + return vim_item + end, + }, + }) + end, +} diff --git a/modules/home-manager/nvim/nvim/lua/plugins/comment.lua b/modules/home-manager/nvim/nvim/lua/plugins/comment.lua new file mode 100644 index 0000000..fb1ab6e --- /dev/null +++ b/modules/home-manager/nvim/nvim/lua/plugins/comment.lua @@ -0,0 +1,7 @@ +return { + { + "nvim-mini/mini.comment", + version = false, + }, + { "windwp/nvim-autopairs", event = "InsertEnter", opts = {} }, +} diff --git a/modules/home-manager/nvim/nvim/lua/plugins/copilot.lua b/modules/home-manager/nvim/nvim/lua/plugins/copilot.lua new file mode 100644 index 0000000..72f5de2 --- /dev/null +++ b/modules/home-manager/nvim/nvim/lua/plugins/copilot.lua @@ -0,0 +1,13 @@ +return { + "github/copilot.vim", + config = function() + vim.keymap.set("i", "", 'copilot#Accept("\\")', { + expr = true, + replace_keycodes = false, + }) + vim.g.copilot_no_tab_map = true + vim.cmd("Copilot disable") + vim.keymap.set("n", "cd", ":Copilot disable") + vim.keymap.set("n", "ce", ":Copilot enable") + end, +} diff --git a/modules/home-manager/nvim/nvim/lua/plugins/formatter.lua b/modules/home-manager/nvim/nvim/lua/plugins/formatter.lua new file mode 100644 index 0000000..461e2ea --- /dev/null +++ b/modules/home-manager/nvim/nvim/lua/plugins/formatter.lua @@ -0,0 +1,32 @@ +return { + "sbdchd/neoformat", + cmd = { "Neoformat" }, + keys = { + { + "f", + function() + vim.cmd("Neoformat") + end, + desc = "Format", + }, + }, + config = function() + vim.g.neoformat_try_node_exe = 1 + vim.g.neoformat_enabled_go = { "gofmt", "goimports" } -- tries gofmt first, then goimports + + -- Optional: Configure specific formatter options + -- For gofmt (usually no args needed) + vim.g.neoformat_go_gofmt = { + exe = "gofmt", + args = {}, + stdin = 1, -- send buffer data via stdin + } + + -- For goimports (if you want to use it) + vim.g.neoformat_go_goimports = { + exe = "goimports", + args = {}, + stdin = 1, + } + end, +} diff --git a/modules/home-manager/nvim/nvim/lua/plugins/fzf.lua b/modules/home-manager/nvim/nvim/lua/plugins/fzf.lua new file mode 100644 index 0000000..2f1729b --- /dev/null +++ b/modules/home-manager/nvim/nvim/lua/plugins/fzf.lua @@ -0,0 +1 @@ +return {'nvim-telescope/telescope-fzf-native.nvim', build = 'make', lazy=true} diff --git a/modules/home-manager/nvim/nvim/lua/plugins/git-blame.lua b/modules/home-manager/nvim/nvim/lua/plugins/git-blame.lua new file mode 100644 index 0000000..e188fd3 --- /dev/null +++ b/modules/home-manager/nvim/nvim/lua/plugins/git-blame.lua @@ -0,0 +1,18 @@ +return { + { + "f-person/git-blame.nvim", + lazy = true, + cmd = { "GitBlameEnable", "GitBlameDisable", "GitBlameToggle" }, + keys = { + { + "gb", + ":GitBlameToggle", + desc = "Toggle Git Blame", + mode = "n", + }, + }, + }, + { + "sindrets/diffview.nvim", + }, +} diff --git a/modules/home-manager/nvim/nvim/lua/plugins/gitsigns.lua b/modules/home-manager/nvim/nvim/lua/plugins/gitsigns.lua new file mode 100644 index 0000000..eef19b4 --- /dev/null +++ b/modules/home-manager/nvim/nvim/lua/plugins/gitsigns.lua @@ -0,0 +1,13 @@ +return { + 'lewis6991/gitsigns.nvim', + opts = { + signs = { + add = {text = '+'}, + change = {text = '~'}, + delete = {text = '_'}, + topdelete = {text = '‾'}, + changedelete = {text = '~'} + } + }, + event="VeryLazy" +} diff --git a/modules/home-manager/nvim/nvim/lua/plugins/lazygit.lua b/modules/home-manager/nvim/nvim/lua/plugins/lazygit.lua new file mode 100644 index 0000000..45e4ea8 --- /dev/null +++ b/modules/home-manager/nvim/nvim/lua/plugins/lazygit.lua @@ -0,0 +1,9 @@ +return { + 'kdheepak/lazygit.nvim', + config = function() + + vim.keymap.set('n', 'gg', function() vim.cmd('LazyGit') end, + {desc = "LazyGit"}) + end, + event = "VeryLazy" +} diff --git a/modules/home-manager/nvim/nvim/lua/plugins/leetcode.lua b/modules/home-manager/nvim/nvim/lua/plugins/leetcode.lua new file mode 100644 index 0000000..c33f0f5 --- /dev/null +++ b/modules/home-manager/nvim/nvim/lua/plugins/leetcode.lua @@ -0,0 +1,19 @@ +return { + "kawre/leetcode.nvim", + build = ":TSUpdate html", + dependencies = { + "nvim-telescope/telescope.nvim", + "nvim-lua/plenary.nvim", -- required by telescope + "MunifTanjim/nui.nvim", + + -- optional + "nvim-treesitter/nvim-treesitter", + "rcarriga/nvim-notify", + "nvim-tree/nvim-web-devicons", + }, + cmd = "Leet", + opts = { + lang = "golang" + -- configuration goes here + }, +} diff --git a/modules/home-manager/nvim/nvim/lua/plugins/lualine.lua b/modules/home-manager/nvim/nvim/lua/plugins/lualine.lua new file mode 100644 index 0000000..43bf137 --- /dev/null +++ b/modules/home-manager/nvim/nvim/lua/plugins/lualine.lua @@ -0,0 +1,12 @@ +return { + "nvim-lualine/lualine.nvim", + event = "VeryLazy", + opts = { + options = { + icons_enabled = true, + theme = "auto", + component_separators = "|", + section_separators = "", + }, + }, +} diff --git a/modules/home-manager/nvim/nvim/lua/plugins/markdown.lua b/modules/home-manager/nvim/nvim/lua/plugins/markdown.lua new file mode 100644 index 0000000..3dfc1c0 --- /dev/null +++ b/modules/home-manager/nvim/nvim/lua/plugins/markdown.lua @@ -0,0 +1,20 @@ +return { + { + "iamcco/markdown-preview.nvim", + cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" }, + build = "cd app && yarn install", + init = function() + vim.g.mkdp_filetypes = { "markdown" } + end, + ft = { "markdown" }, + }, + { + "MeanderingProgrammer/render-markdown.nvim", + dependencies = { "nvim-treesitter/nvim-treesitter", "nvim-mini/mini.nvim" }, -- if you use the mini.nvim suite + -- dependencies = { 'nvim-treesitter/nvim-treesitter', 'nvim-mini/mini.icons' }, -- if you use standalone mini plugins + -- dependencies = { 'nvim-treesitter/nvim-treesitter', 'nvim-tree/nvim-web-devicons' }, -- if you prefer nvim-web-devicons + ---@module 'render-markdown' + ---@type render.md.UserConfig + opts = {}, + }, +} diff --git a/modules/home-manager/nvim/nvim/lua/plugins/marks.lua b/modules/home-manager/nvim/nvim/lua/plugins/marks.lua new file mode 100644 index 0000000..0407a90 --- /dev/null +++ b/modules/home-manager/nvim/nvim/lua/plugins/marks.lua @@ -0,0 +1 @@ +return {'chentoast/marks.nvim', opts = {}} diff --git a/modules/home-manager/nvim/nvim/lua/plugins/mason.lua b/modules/home-manager/nvim/nvim/lua/plugins/mason.lua new file mode 100644 index 0000000..d034b5c --- /dev/null +++ b/modules/home-manager/nvim/nvim/lua/plugins/mason.lua @@ -0,0 +1,4 @@ +return { + "mason-org/mason.nvim", + opts = {} +} diff --git a/modules/home-manager/nvim/nvim/lua/plugins/neotree.lua b/modules/home-manager/nvim/nvim/lua/plugins/neotree.lua new file mode 100644 index 0000000..09110d0 --- /dev/null +++ b/modules/home-manager/nvim/nvim/lua/plugins/neotree.lua @@ -0,0 +1,15 @@ +return { + { + "nvim-neo-tree/neo-tree.nvim", + branch = "v3.x", + dependencies = { + "nvim-lua/plenary.nvim", + "MunifTanjim/nui.nvim", + "nvim-tree/nvim-web-devicons", -- optional, but recommended + }, + lazy = false, -- neo-tree will lazily load itself + config = function() + vim.keymap.set("n", "e", ":Neotree toggle right", { desc = "Toggle File Explorer" }) + end, + }, +} diff --git a/modules/home-manager/nvim/nvim/lua/plugins/none-ls.lua b/modules/home-manager/nvim/nvim/lua/plugins/none-ls.lua new file mode 100644 index 0000000..f4a54b1 --- /dev/null +++ b/modules/home-manager/nvim/nvim/lua/plugins/none-ls.lua @@ -0,0 +1,53 @@ +return { + { + "nvimtools/none-ls.nvim", + dependencies = { + "nvimtools/none-ls-extras.nvim", + }, + config = function() + local setup, null_ls = pcall(require, "null-ls") + if not setup then + return + end + + local augroup = vim.api.nvim_create_augroup("LspFormatting", {}) + + null_ls.setup({ + sources = { + -- Code Actions + require("none-ls.code_actions.eslint_d"), + null_ls.builtins.code_actions.gitsigns, -- Optional: git-related code actions + null_ls.builtins.code_actions.refactoring, + -- Diagnostics + require("none-ls.diagnostics.eslint_d"), + null_ls.builtins.diagnostics.golangci_lint, + -- Hover documentation (optional) + null_ls.builtins.hover.dictionary, + }, + vim.keymap.set("n", "rn", function() + vim.lsp.buf.rename() + end, { desc = "Rename Variable" }), + }) + end, + }, + { + "mrcjkb/rustaceanvim", + version = "^7", -- Recommended + lazy = false, -- This plugin is already lazy + }, + { + { + "antosha417/nvim-lsp-file-operations", + dependencies = { + "nvim-lua/plenary.nvim", + -- Uncomment whichever supported plugin(s) you use + -- "nvim-tree/nvim-tree.lua", + -- "nvim-neo-tree/neo-tree.nvim", + -- "simonmclean/triptych.nvim" + }, + config = function() + require("lsp-file-operations").setup() + end, + }, + }, +} diff --git a/modules/home-manager/nvim/nvim/lua/plugins/oil.lua b/modules/home-manager/nvim/nvim/lua/plugins/oil.lua new file mode 100644 index 0000000..e231441 --- /dev/null +++ b/modules/home-manager/nvim/nvim/lua/plugins/oil.lua @@ -0,0 +1,32 @@ +return { + "stevearc/oil.nvim", + config = function() + require("oil").setup({ + columns = { "icon" }, + keymaps = { + ["g?"] = "actions.show_help", + ["gs"] = "actions.change_sort", + [""] = "actions.select", + [""] = "actions.preview", + [""] = "actions.close", + [""] = "actions.refresh", + ["-"] = "actions.parent", + ["_"] = "actions.open_cwd", + ["`"] = "actions.cd", + ["~"] = "actions.tcd", + ["g."] = "actions.toggle_hidden", + }, + use_default_keymaps = false, + view_options = { + show_hidden = true, + sort = { { "type", "asc" }, { "name", "asc" } }, + }, + skip_confirm_for_simple_edits = true, + }) + + vim.keymap.set("n", "-", function(dir) + require("oil").open(dir) + end, { desc = "Open parent directory" }) + end, + dependencies = { "nvim-tree/nvim-web-devicons" }, +} diff --git a/modules/home-manager/nvim/nvim/lua/plugins/parinfer.lua b/modules/home-manager/nvim/nvim/lua/plugins/parinfer.lua new file mode 100644 index 0000000..ab71383 --- /dev/null +++ b/modules/home-manager/nvim/nvim/lua/plugins/parinfer.lua @@ -0,0 +1,3 @@ +return { + 'gpanders/nvim-parinfer' +} diff --git a/modules/home-manager/nvim/nvim/lua/plugins/polyglot.lua b/modules/home-manager/nvim/nvim/lua/plugins/polyglot.lua new file mode 100644 index 0000000..279dabb --- /dev/null +++ b/modules/home-manager/nvim/nvim/lua/plugins/polyglot.lua @@ -0,0 +1,3 @@ +return { +'sheerun/vim-polyglot' +} diff --git a/modules/home-manager/nvim/nvim/lua/plugins/quickfix.lua b/modules/home-manager/nvim/nvim/lua/plugins/quickfix.lua new file mode 100644 index 0000000..ac9c02e --- /dev/null +++ b/modules/home-manager/nvim/nvim/lua/plugins/quickfix.lua @@ -0,0 +1,4 @@ +return { 'stevearc/quicker.nvim', + event = "FileType qf", + opts = {}, +} diff --git a/modules/home-manager/nvim/nvim/lua/plugins/silicon.lua b/modules/home-manager/nvim/nvim/lua/plugins/silicon.lua new file mode 100644 index 0000000..87c87d6 --- /dev/null +++ b/modules/home-manager/nvim/nvim/lua/plugins/silicon.lua @@ -0,0 +1,41 @@ +return { + "michaelrommel/nvim-silicon", + lazy = true, + cmd = "Silicon", + config = function() + local get_visual = function() + local curpos = vim.fn.getcurpos() + local one = { row = curpos[2] - 1, col = curpos[3] - 1 } + local two = { row = vim.fn.line("v") - 1, col = vim.fn.col("v") - 1 } + + if one.row == two.row then + if one.col > two.col then + local tmp = one + one = two + two = tmp + end + elseif one.row > two.row then + local tmp = one + one = two + two = tmp + end + + two.col = two.col + 1 + return one.row + end + require("nvim-silicon").setup({ + font = "JetBrainsMono Nerd Font=24", + no_window_controls = true, + no_line_number = false, + line_offset = get_visual() + 1, + to_clipboard = true, + window_title = function() + return vim.fn.fnamemodify(vim.fn.bufname(vim.fn.bufnr()), ":~:.") .. " -  @jpporta" + end, + language = function() + return vim.bo.filetype + end, + }) + vim.keymap.set("v", "cs", "'<,'>Silicon", { desc = "[C]ode [S]elfie" }) + end, +} diff --git a/modules/home-manager/nvim/nvim/lua/plugins/snacks.lua b/modules/home-manager/nvim/nvim/lua/plugins/snacks.lua new file mode 100644 index 0000000..1483f8b --- /dev/null +++ b/modules/home-manager/nvim/nvim/lua/plugins/snacks.lua @@ -0,0 +1,23 @@ +return { + "folke/snacks.nvim", + priority = 1000, + lazy = false, + ---@type snacks.Config + opts = { + -- your configuration comes here + -- or leave it empty to use the default settings + -- refer to the configuration section below + bigfile = { enabled = true }, + dashboard = { enabled = true }, + explorer = { enabled = false }, + indent = { enabled = false }, + input = { enabled = true }, + picker = { enabled = true }, + notifier = { enabled = true }, + quickfile = { enabled = true }, + scope = { enabled = true }, + scroll = { enabled = false }, + statuscolumn = { enabled = true }, + words = { enabled = true }, + }, +} diff --git a/modules/home-manager/nvim/nvim/lua/plugins/tailwind.lua b/modules/home-manager/nvim/nvim/lua/plugins/tailwind.lua new file mode 100644 index 0000000..f9beb3a --- /dev/null +++ b/modules/home-manager/nvim/nvim/lua/plugins/tailwind.lua @@ -0,0 +1,10 @@ +return { + { + "NvChad/nvim-colorizer.lua", + opts = { + user_default_options = { + tailwind = true, + }, + }, + }, +} diff --git a/modules/home-manager/nvim/nvim/lua/plugins/telescope.lua b/modules/home-manager/nvim/nvim/lua/plugins/telescope.lua new file mode 100644 index 0000000..c8a77f8 --- /dev/null +++ b/modules/home-manager/nvim/nvim/lua/plugins/telescope.lua @@ -0,0 +1,72 @@ +return { + "nvim-telescope/telescope.nvim", + version = "*", + dependencies = { + "nvim-lua/plenary.nvim", + "xiyaowong/telescope-emoji", + { "nvim-telescope/telescope-fzf-native.nvim", build = "make" }, + "nvim-tree/nvim-web-devicons", + }, + opts = { + defaults = { mappings = { i = { [""] = false, [""] = false } } }, + extensions = { + fzf = { + fuzzy = true, -- false will only do exact matching + override_generic_sorter = true, -- override the generic sorter + override_file_sorter = true, -- override the file sorter + case_mode = "smart_case", -- or "ignore_case" or "respect_case" + }, + }, + pickers = { colorscheme = { enable_preview = true } }, + }, + config = function() + pcall(require("telescope").load_extension, "fzf") + pcall(require("telescope").load_extension, "emoji") + vim.keymap.set( + "n", + "?", + require("telescope.builtin").oldfiles, + { desc = "[?] Find recently opened files" } + ) + vim.keymap.set("n", "", function() + require("telescope.builtin").buffers({ + sort_mru = true, + ignore_current_buffer = true, + }) + end, { desc = "[ ] Find existing buffers" }) + vim.keymap.set("n", "gr", require("telescope.builtin").lsp_references, { desc = "[G]oto [R]eferences" }) + vim.keymap.set( + "n", + "ds", + require("telescope.builtin").lsp_document_symbols, + { desc = "[D]ocument [S]ymbols" } + ) + vim.keymap.set( + "n", + "ws", + require("telescope.builtin").lsp_dynamic_workspace_symbols, + { desc = "[W]orkspace [S]ymbols" } + ) + vim.keymap.set("n", "/", function() + require("telescope.builtin").current_buffer_fuzzy_find(require("telescope.themes").get_dropdown({ + winblend = 10, + previewer = false, + })) + end, { desc = "[/] Fuzzily search in current buffer" }) + vim.keymap.set("n", "sf", require("telescope.builtin").find_files, { desc = "[S]earch [F]iles" }) + vim.keymap.set("n", "sh", require("telescope.builtin").help_tags, { desc = "[S]earch [H]elp" }) + vim.keymap.set( + "n", + "sw", + require("telescope.builtin").grep_string, + { desc = "[S]earch current [W]ord" } + ) + vim.keymap.set("n", "sg", require("telescope.builtin").live_grep, { desc = "[S]earch by [G]rep" }) + vim.keymap.set("n", "sd", require("telescope.builtin").diagnostics, { desc = "[S]earch [D]iagnostics" }) + vim.keymap.set("n", "ss", require("telescope.builtin").git_files, { desc = "Search Git Files" }) + vim.keymap.set("n", "sb", ":Telescope file_browser", { desc = "File browser" }) + vim.keymap.set("n", "st", ":Telescope colorscheme", { desc = "Switch Theme" }) + vim.keymap.set("n", "se", ":Telescope emoji", { desc = "Search Emoji" }) + end, + event = "VeryLazy", +} diff --git a/modules/home-manager/nvim/nvim/lua/plugins/themes.lua b/modules/home-manager/nvim/nvim/lua/plugins/themes.lua new file mode 100644 index 0000000..c2dfbd9 --- /dev/null +++ b/modules/home-manager/nvim/nvim/lua/plugins/themes.lua @@ -0,0 +1,123 @@ +return { + -- { + -- "rebelot/kanagawa.nvim", -- neorg needs a colorscheme with treesitter support + -- config = function() + -- vim.cmd.colorscheme("kanagawa") + -- end, + -- }, + { + "RRethy/base16-nvim", + priority = 1000, + }, + { + "EdenEast/nightfox.nvim", + priority = 1000, -- Ensure it loads first + }, + { + "shaunsingh/nord.nvim", + priority = 1000, -- Ensure it loads first + }, + { + "Mofiqul/dracula.nvim", + priority = 1000, -- Ensure it loads first + }, + -- { + -- "olimorris/onedarkpro.nvim", + -- priority = 1000, -- Ensure it loads first + -- }, + { + "catppuccin/nvim", + name = "catppuccin", + priority = 1000, + }, + { "sainnhe/everforest", priority = 1000 }, + { "kdheepak/monochrome.nvim", priority = 1000 }, + { "ellisonleao/gruvbox.nvim", priority = 1000 }, + { + "xiyaowong/transparent.nvim", + priority = 1000, + opts = { + groups = { + "Normal", + "NormalNC", + "Comment", + "Constant", + "Special", + "Identifier", + "Statement", + "PreProc", + "Type", + "Underlined", + "Todo", + "String", + "Function", + "Conditional", + "Repeat", + "Operator", + "Structure", + "LineNr", + "NonText", + "SignColumn", + "CursorLine", + "CursorLineNr", + "StatusLine", + "StatusLineNC", + "EndOfBuffer", + }, + extra_groups = { + "NormalFloat", -- plugins which have float panel such as Lazy, Mason, LspInfo + "NvimTreeNormal", -- NvimTree + }, + }, + }, + -- { + -- "fynnfluegge/monet.nvim", + -- name = "monet", + -- opts = { + -- tranparent_background = true, + -- dark_mode = true, + -- }, + -- }, + { + "folke/tokyonight.nvim", + priority = 1000, + opts = {}, + }, + { + "rebelot/kanagawa.nvim", + priority = 1000, + }, + -- { "kepano/flexoki-neovim", priority = 1000, name = "flexoki" }, + -- { "jacoborus/tender.vim", priority = 1000, name = "tender" }, + -- { "bluz71/vim-moonfly-colors", name = "moonfly", lazy = false, priority = 1000 }, + -- { + -- "scottmckendry/cyberdream.nvim", + -- lazy = false, + -- priority = 1000, + -- config = function() + -- require("cyberdream").setup({ + -- -- Recommended - see "Configuring" below for more config options + -- transparent = true, + -- italic_comments = true, + -- hide_fillchars = true, + -- borderless_telescope = true, + -- terminal_colors = true, + -- }) + -- vim.cmd("colorscheme cyberdream") -- set the colorscheme + -- end, + -- }, + { "rose-pine/neovim", as = "rose-pine" }, + { "Shatur/neovim-ayu" }, + { + "lalitmee/cobalt2.nvim", + dependencies = { "tjdevries/colorbuddy.nvim", tag = "v1.0.0" }, + }, + { "tanvirtin/monokai.nvim" }, + + { + "alexwu/nvim-snazzy", + dependencies = { "rktjmp/lush.nvim" }, + lazy = false, + priority = 1000, + }, +} diff --git a/modules/home-manager/nvim/nvim/lua/plugins/todo.lua b/modules/home-manager/nvim/nvim/lua/plugins/todo.lua new file mode 100644 index 0000000..878dc7c --- /dev/null +++ b/modules/home-manager/nvim/nvim/lua/plugins/todo.lua @@ -0,0 +1,6 @@ +return { + "folke/todo-comments.nvim", + dependencies = { "nvim-lua/plenary.nvim" }, + opts = {}, + event = "VeryLazy", +} diff --git a/modules/home-manager/nvim/nvim/lua/plugins/treesitter.lua b/modules/home-manager/nvim/nvim/lua/plugins/treesitter.lua new file mode 100644 index 0000000..36fcec0 --- /dev/null +++ b/modules/home-manager/nvim/nvim/lua/plugins/treesitter.lua @@ -0,0 +1,65 @@ +return { + { + -- Highlight, edit, and navigate code + "nvim-treesitter/nvim-treesitter", + dependencies = { "tpope/vim-markdown" }, + build = ":TSUpdate", + config = function() + ---@diagnostic disable-next-line: missing-fields + require("nvim-treesitter").setup({ + disable = { "markdown" }, + auto_install = true, + highlight = { enable = true }, + indent = { enable = true, disable = { "python" } }, + incremental_selection = { + enable = true, + keymaps = { + init_selection = "", + node_incremental = "", + scope_incremental = "", + node_decremental = "", + }, + }, + textobjects = { + select = { + enable = true, + lookahead = true, + keymaps = { + ["aa"] = "@parameter.outer", + ["ia"] = "@parameter.inner", + ["af"] = "@function.outer", + ["if"] = "@function.inner", + ["ac"] = "@class.outer", + ["ic"] = "@class.inner", + }, + }, + move = { + enable = true, + set_jumps = true, + 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 = { ["sa"] = "@parameter.inner" }, + swap_previous = { ["sA"] = "@parameter.inner" }, + }, + }, + }) + end, + }, +} diff --git a/modules/home-manager/nvim/nvim/lua/plugins/vim-tmux-nav.lua b/modules/home-manager/nvim/nvim/lua/plugins/vim-tmux-nav.lua new file mode 100644 index 0000000..fbab828 --- /dev/null +++ b/modules/home-manager/nvim/nvim/lua/plugins/vim-tmux-nav.lua @@ -0,0 +1,14 @@ +return { + "christoomey/vim-tmux-navigator", + cmd = { + "TmuxNavigateLeft", "TmuxNavigateDown", "TmuxNavigateUp", + "TmuxNavigateRight", "TmuxNavigatePrevious" + }, + keys = { + {"", "TmuxNavigateLeft"}, + {"", "TmuxNavigateDown"}, + {"", "TmuxNavigateUp"}, + {"", "TmuxNavigateRight"}, + {"", "TmuxNavigatePrevious"} + } +} diff --git a/modules/home-manager/nvim/nvim/lua/plugins/whichkey.lua b/modules/home-manager/nvim/nvim/lua/plugins/whichkey.lua new file mode 100644 index 0000000..13179b1 --- /dev/null +++ b/modules/home-manager/nvim/nvim/lua/plugins/whichkey.lua @@ -0,0 +1,5 @@ +return { +'folke/which-key.nvim', + opts = {}, + event="VeryLazy" +} diff --git a/modules/home-manager/nvim/nvim/lua/plugins/wiki.lua b/modules/home-manager/nvim/nvim/lua/plugins/wiki.lua new file mode 100644 index 0000000..c0fa3c8 --- /dev/null +++ b/modules/home-manager/nvim/nvim/lua/plugins/wiki.lua @@ -0,0 +1,9 @@ +return { + "vimwiki/vimwiki", + init = function() + vim.g.vimwiki_path = "~/docs/Wiki/" + vim.g.vimwiki_syntax = "markdown" + vim.g.vimwiki_ext = "md" + vim.g.vimwiki_global_ext = 0 + end, +} diff --git a/modules/home-manager/nvim/nvim/lua/plugins/zk.lua b/modules/home-manager/nvim/nvim/lua/plugins/zk.lua new file mode 100644 index 0000000..15035e2 --- /dev/null +++ b/modules/home-manager/nvim/nvim/lua/plugins/zk.lua @@ -0,0 +1,25 @@ +return { + "zk-org/zk-nvim", + name = "zk", + opts = { + -- Can be "telescope", "fzf", "fzf_lua", "minipick", "snacks_picker", + -- or select" (`vim.ui.select`). + picker = "select", + + lsp = { + -- `config` is passed to `vim.lsp.start(config)` + config = { + name = "zk", + cmd = { "zk", "lsp" }, + filetypes = { "markdown" }, + -- on_attach = ... + -- etc, see `:h vim.lsp.start()` + }, + + -- automatically attach buffers in a zk notebook that match the given filetypes + auto_attach = { + enabled = true, + }, + }, + }, +} diff --git a/modules/home-manager/nvim/nvim/spell/en.utf-8.add b/modules/home-manager/nvim/nvim/spell/en.utf-8.add new file mode 100644 index 0000000..4dd37f7 --- /dev/null +++ b/modules/home-manager/nvim/nvim/spell/en.utf-8.add @@ -0,0 +1,13 @@ +websocket +telehealth +diarization +Veradigm +EMR +cronjob +JSON +Serverless +serverless +colorschemes +Avodah +Gitea +Unescapable diff --git a/modules/home-manager/nvim/nvim/spell/en.utf-8.add.spl b/modules/home-manager/nvim/nvim/spell/en.utf-8.add.spl new file mode 100644 index 0000000..abe7b27 Binary files /dev/null and b/modules/home-manager/nvim/nvim/spell/en.utf-8.add.spl differ diff --git a/modules/home-manager/oh-my-posh/default.nix b/modules/home-manager/oh-my-posh/default.nix new file mode 100644 index 0000000..fce39f6 --- /dev/null +++ b/modules/home-manager/oh-my-posh/default.nix @@ -0,0 +1,23 @@ +{ + inputs, + lib, + config, + pkgs, + ... +}: + +{ + + options.custom = { + oh-my-posh.enable = lib.mkEnableOption "enable oh-my-posh prompt decorator"; + }; + + config = lib.mkIf config.custom.oh-my-posh.enable { + programs.oh-my-posh = { + enable = true; + enableZshIntegration = true; + settings = builtins.fromJSON (builtins.readFile ./oh-my-posh.omp.json); + }; + }; + +} diff --git a/modules/home-manager/oh-my-posh/oh-my-posh.omp.json b/modules/home-manager/oh-my-posh/oh-my-posh.omp.json new file mode 100644 index 0000000..0368e0c --- /dev/null +++ b/modules/home-manager/oh-my-posh/oh-my-posh.omp.json @@ -0,0 +1,87 @@ +{ + "$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json", + "transient_prompt": { + "template": "> " + }, + "blocks": [ + { + "alignment": "left", + "segments": [ + { + "foreground": "#ffbb93", + "style": "plain", + "template": "{{ .UserName }}'s ", + "type": "session" + }, + { + "foreground": "#a75d31", + "options": { + "style": "folder" + }, + "style": "plain", + "template": "{{ .Path }}/ ", + "type": "path" + }, + { + "foreground": "#f3e1da", + "options": { + "fetch_status": true + }, + "style": "plain", + "template": "<#ffffff>on {{ .HEAD }}{{if .BranchStatus }} {{ .BranchStatus }}{{ end }}{{ if .Working.Changed }} \uf044 {{ .Working.String }}{{ end }}{{ if and (.Working.Changed) (.Staging.Changed) }} |{{ end }}{{ if .Staging.Changed }} \uf046 {{ .Staging.String }}{{ end }} ", + "type": "git" + }, + { + "foreground": "#ecc3b0", + "options": { + "fetch_version": true + }, + "style": "plain", + "template": "<#ffffff>via \ue781 {{ if .PackageManagerIcon }}{{ .PackageManagerIcon }} {{ end }}{{ .Full }} ", + "type": "node" + } + ], + "type": "prompt" + }, + { + "alignment": "right", + "segments": [ + { + "foreground": "#d5d096", + "style": "diamond", + "template": "RAM:{{ (div ((sub .PhysicalTotalMemory .PhysicalAvailableMemory)|float64) 1073741824.0) }}/{{ (div .PhysicalTotalMemory 1073741824.0) }}GB ", + "trailing_diamond": " ", + "type": "sysinfo" + }, + { + "foreground": "#ffffff", + "leading_diamond": "\u250b", + "options": { + "style": "roundrock", + "threshold": 0 + }, + "style": "diamond", + "template": " {{ .FormattedMs }} ", + "type": "executiontime" + } + ], + "type": "prompt" + }, + { + "alignment": "left", + "newline": true, + "segments": [ + { + "foreground": "#ffbb93", + "style": "plain", + "template": " ", + "type": "text", + "foreground_templates": ["{{ if gt .Code 0 }}#ffb8af{{ end }}"] + } + ], + "type": "prompt" + } + ], + "final_space": true, + "version": 4 +} diff --git a/modules/home-manager/opencode/default.nix b/modules/home-manager/opencode/default.nix new file mode 100644 index 0000000..ca461b0 --- /dev/null +++ b/modules/home-manager/opencode/default.nix @@ -0,0 +1,18 @@ +{ lib, config, ... }: +{ + + options.custom = { + opencode.enable = lib.mkEnableOption "enable opencode - LLM Harness"; + }; + + config = lib.mkIf config.custom.opencode.enable { + programs.opencode = { + enable = true; + settings = { + plugin = [ + "@dietrichgebert/ponytail" + ]; + }; + }; + }; +} diff --git a/modules/home-manager/pi/default.nix b/modules/home-manager/pi/default.nix new file mode 100644 index 0000000..3c02757 --- /dev/null +++ b/modules/home-manager/pi/default.nix @@ -0,0 +1,18 @@ +{ lib, config, pkgs, ... }: +{ + + options.custom = { + pi.enable = lib.mkEnableOption "enable pi - pi.dev coding agent"; + }; + + config = lib.mkIf config.custom.pi.enable { + home.packages = with pkgs; [ + pi-coding-agent + worktrunk + sesh + sl + ntfy-sh + signal-cli + ]; + }; +} diff --git a/modules/home-manager/swaync/default.nix b/modules/home-manager/swaync/default.nix new file mode 100644 index 0000000..538338c --- /dev/null +++ b/modules/home-manager/swaync/default.nix @@ -0,0 +1,542 @@ +{ lib, config, ... }: +let + background = "#282828"; # bg0 — main dark background + background-alt = "#3c3836"; # bg1 — slightly lighter panels/buttons + background-sec = "#1d2021"; # bg0_h — darker, for mpris/volume contrast + text = "#ebdbb2"; # fg1 — main foreground + selected = "#83a598"; # blue — accent for borders/active states + urgent = "#fb4934"; # bright red — critical notifications + hover = "#504945"; # bg2 — hover highlight +in +{ + options.custom = { + swaync.enable = lib.mkEnableOption "enable swaync - color cat alternative"; + }; + + config = lib.mkIf config.custom.swaync.enable { + services.swaync = { + enable = true; + settings = { + positionX = "right"; + positionY = "top"; + cssPriority = "user"; + + control-center-width = 380; + control-center-height = 860; + control-center-margin-top = 2; + control-center-margin-bottom = 2; + control-center-margin-right = 1; + control-center-margin-left = 0; + + notification-window-width = 400; + notification-icon-size = 48; + notification-body-image-height = 160; + notification-body-image-width = 200; + + timeout = 4; + timeout-low = 2; + timeout-critical = 6; + + fit-to-screen = false; + keyboard-shortcuts = true; + image-visibility = "when-available"; + transition-time = 200; + hide-on-clear = true; + hide-on-action = false; + script-fail-notify = true; + scripts = { + example-script = { + exec = "echo 'Do something...'"; + urgency = "Normal"; + }; + }; + notification-visibility = { + example-name = { + state = "muted"; + urgency = "Low"; + app-name = "Spotify"; + }; + }; + widgets = [ + "mpris" + "title" + "dnd" + "notifications" + ]; + + widget-config = { + title = { + text = "Notifications"; + clear-all-button = true; + button-text = " 󰎟 Clear"; + }; + dnd = { + text = "Do not disturb"; + }; + label = { + max-lines = 1; + text = " "; + }; + mpris = { + image-size = 96; + image-radius = 12; + }; + volume = { + label = "󰕾"; + show-per-app = true; + }; + buttons-grid = { + actions = [ + { + label = " "; + command = "amixer set Master toggle"; + } + { + label = ""; + command = "amixer set Capture toggle"; + } + { + label = " "; + command = "nm-connection-editor"; + } + { + label = "󰂯"; + command = "blueman-manager"; + } + { + label = "󰏘"; + command = "nwg-look"; + } + + ]; + }; + }; + }; + style = '' + * { + color: ${text}; + background-color: ${background} + all: unset; + font-size: 12px; + font-family: "BerkeleyMono Nerd Font Propo"; + transition: 200ms; + } + + .notification-row { + outline: none; + margin: 0; + padding: 0px; + } + + .floating-notifications.background .notification-row .notification-background { + background: alpha(${background}, 0.9); + box-shadow: 0 0 8px 0 rgba(0, 0, 0, 0.6); + border: 1px solid ${selected}; + border-radius: 24px; + margin: 16px; + padding: 0; + } + + .floating-notifications.background + .notification-row + .notification-background + .notification { + padding: 6px; + border-radius: 12px; + } + + .floating-notifications.background + .notification-row + .notification-background + .notification.critical { + border: 2px solid ${urgent}; + } + + .floating-notifications.background + .notification-row + .notification-background + .notification + .notification-content { + margin: 14px; + } + + .floating-notifications.background + .notification-row + .notification-background + .notification + > *:last-child + > * { + min-height: 3.4em; + } + + .floating-notifications.background + .notification-row + .notification-background + .notification + > *:last-child + > * + .notification-action { + border-radius: 8px; + background-color: ${background-alt}}; + margin: 6px; + border: 1px solid transparent; + } + + .floating-notifications.background + .notification-row + .notification-background + .notification + > *:last-child + > * + .notification-action:hover { + background-color: ${hover}; + border: 1px solid ${selected}; + } + + .floating-notifications.background + .notification-row + .notification-background + .notification + > *:last-child + > * + .notification-action:active { + background-color: ${selected}; + color: ${background}; + } + + .image { + margin: 10px 20px 10px 0px; + } + + .summary { + font-weight: 800; + font-size: 1rem; + } + + .body { + font-size: 0.8rem; + } + + .floating-notifications.background + .notification-row + .notification-background + .close-button { + margin: 6px; + padding: 2px; + border-radius: 6px; + background-color: ${background}; + border: 1px solid transparent; + } + + .floating-notifications.background + .notification-row + .notification-background + .close-button:hover { + background-color: ${selected}; + } + + .floating-notifications.background + .notification-row + .notification-background + .close-button:active { + background-color: ${selected}; + color: ${background}; + } + + .notification.critical progress { + background-color: ${selected}; + } + + .notification.low progress, + .notification.normal progress { + background-color: ${selected}; + } + + * { + color: ${text}; + + all: unset; + font-size: 12px; + font-family: "BerkeleyMono Nerd Font Propo"; + transition: 200ms; + } + + /* Avoid 'annoying' backgroud */ + .blank-window { + background: transparent; + } + + /* CONTROL CENTER ------------------------------------------------------------------------ */ + + .control-center { + background: alpha(${background}, 0.7); + border-radius: 24px; + border: 1px solid ${selected}; + box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.6); + margin: 18px; + padding: 12px; + } + + /* Notifications */ + .control-center .notification-row .notification-background, + .control-center + .notification-row + .notification-background + .notification.critical { + background-color: ${background-alt}; + border-radius: 16px; + margin: 4px 0px; + padding: 4px; + } + + .control-center + .notification-row + .notification-background + .notification.critical { + color: ${urgent}; + } + + .control-center + .notification-row + .notification-background + .notification + .notification-content { + margin: 6px; + padding: 8px 6px 2px 2px; + } + + .control-center + .notification-row + .notification-background + .notification + > *:last-child + > * { + min-height: 3.4em; + } + + .control-center + .notification-row + .notification-background + .notification + > *:last-child + > * + .notification-action { + background: alpha(${selected}, 0.6); + color: ${text}; + border-radius: 12px; + margin: 6px; + } + + .control-center + .notification-row + .notification-background + .notification + > *:last-child + > * + .notification-action:hover { + background: ${selected}; + } + + .control-center + .notification-row + .notification-background + .notification + > *:last-child + > * + .notification-action:active { + background-color: ${selected}; + } + + /* Buttons */ + + .control-center .notification-row .notification-background .close-button { + background: transparent; + border-radius: 6px; + color: ${text}; + margin: 0px; + padding: 4px; + } + + .control-center .notification-row .notification-background .close-button:hover { + background-color: ${selected}; + } + + .control-center + .notification-row + .notification-background + .close-button:active { + background-color: ${selected}; + } + + progressbar, + progress, + trough { + border-radius: 12px; + } + + progressbar { + background-color: rgba(255, 255, 255, 0.1); + } + + /* Notifications expanded-group */ + + .notification-group { + margin: 2px 8px 2px 8px; + } + .notification-group-headers { + font-weight: bold; + font-size: 1.25rem; + color: ${text}; + letter-spacing: 2px; + } + + .notification-group-icon { + color: ${text}; + } + + .notification-group-collapse-button, + .notification-group-close-all-button { + background: transparent; + color: ${text}; + margin: 4px; + border-radius: 6px; + padding: 4px; + } + + .notification-group-collapse-button:hover, + .notification-group-close-all-button:hover { + background: ${hover}; + } + + /* WIDGETS --------------------------------------------------------------------------- */ + + /* Notification clear button */ + .widget-title { + font-size: 1.2em; + margin: 6px; + } + + .widget-title button { + background: ${background-alt}; + border-radius: 6px; + padding: 4px 16px; + } + + .widget-title button:hover { + background-color: ${hover}; + } + + .widget-title button:active { + background-color: ${selected}; + } + + /* Do not disturb */ + .widget-dnd { + margin: 6px; + font-size: 1.2rem; + } + + .widget-dnd > switch { + background: ${background-alt}; + font-size: initial; + border-radius: 8px; + box-shadow: none; + padding: 2px; + } + + .widget-dnd > switch:hover { + background: ${hover}; + } + + .widget-dnd > switch:checked { + background: ${selected}; + } + + .widget-dnd > switch:checked:hover { + background: ${hover}; + } + + .widget-dnd > switch slider { + background: ${text}; + border-radius: 6px; + } + + /* Buttons menu */ + .widget-buttons-grid { + font-size: x-large; + padding: 6px 2px; + margin: 6px; + border-radius: 12px; + background: ${background-alt}; + } + + .widget-buttons-grid > flowbox > flowboxchild > button { + margin: 4px 10px; + padding: 6px 12px; + background: transparent; + border-radius: 8px; + } + + .widget-buttons-grid > flowbox > flowboxchild > button:hover { + background: ${hover}; + } + + /* Music player */ + .widget-mpris { + background: ${background-alt}; + border-radius: 16px; + color: ${text}; + margin: 20px 6px; + } + + /* NOTE: Background need *opacity 1* otherwise will turn into the album art blurred */ + .widget-mpris-player { + background-color: ${background-sec}; + border-radius: 22px; + padding: 6px 14px; + margin: 6px; + } + + .widget-mpris > box > button { + color: ${text}; + border-radius: 20px; + } + + .widget-mpris button { + color: alpha(${text}, 0.6); + } + + .widget-mpris button:hover { + color: ${text}; + } + + .widget-mpris-album-art { + border-radius: 16px; + } + + .widget-mpris-title { + font-weight: 700; + font-size: 1rem; + } + + .widget-mpris-subtitle { + font-weight: 500; + font-size: 0.8rem; + } + + picture.mpris-background { + opacity: 0; + } + + /* Volume */ + .widget-volume { + background: ${background-sec}; + color: ${background}; + padding: 4px; + margin: 6px; + border-radius: 6px; + } + ''; + }; + }; +} diff --git a/modules/home-manager/tmux/default.nix b/modules/home-manager/tmux/default.nix new file mode 100644 index 0000000..ce0141f --- /dev/null +++ b/modules/home-manager/tmux/default.nix @@ -0,0 +1,16 @@ + +{ lib, config, pkgs, ... }: +{ + + options.custom = { + tmux.enable = lib.mkEnableOption "enable tmux - terminal multiplexer"; + }; + + config = lib.mkIf config.custom.tmux.enable { + home.packages = with pkgs; [ + tmux + ]; + + xdg.configFile."tmux/tmux.conf".source = config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/nixos-config/modules/home-manager/tmux/tmux.conf"; + }; +} diff --git a/modules/home-manager/tmux/tmux.conf b/modules/home-manager/tmux/tmux.conf new file mode 100644 index 0000000..68adfd8 --- /dev/null +++ b/modules/home-manager/tmux/tmux.conf @@ -0,0 +1,122 @@ +##### Terminal & Color Support ##### + +# Kitty = truecolor +set -g default-terminal "tmux-256color" +set -ga terminal-overrides ",*:Tc" + +# Key line: +set -g pane-border-style "bg=default" +set -g pane-active-border-style "bg=default" +set -g status-style "bg=default" +set -g window-style "bg=default" +set -g window-active-style "bg=default" +set -g default-shell /home/jpporta/.nix-profile/bin/zsh +set -g extended-keys on +set -g extended-keys-format csi-u + +# Reduce escape sequence delay (fixes lag in nvim/zsh) +set -sg escape-time 0 + +# Prefix to C-a +# set -g prefix C-a +# unbind C-b +# bind-key C-a send-prefix + +# Mouse follow +set -g mouse on + +# Split with better keys +# unbind % +# bind | split-window -h -c "#{pane_current_path}" +# unbind '"' +# bind - split-window -v -c "#{pane_current_path}" + +# Easy config eload +unbind r +bind r source-file ~/.config/tmux/tmux.conf + +# Move between panes with tmux-navigator +is_vim="ps -o state= -o comm= -t '#{pane_tty}' \ + | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|l?n?vim?x?|fzf)(diff)?$'" +bind-key -n 'C-h' if-shell "$is_vim" 'send-keys M-h' 'select-pane -L' +bind-key -n 'C-j' if-shell "$is_vim" 'send-keys M-j' 'select-pane -D' +bind-key -n 'C-k' if-shell "$is_vim" 'send-keys M-k' 'select-pane -U' +bind-key -n 'C-l' if-shell "$is_vim" 'send-keys M-l' 'select-pane -R' + +# No automatic window renaming +set-option -g allow-rename off + +# Bell +set -g visual-activity off +set -g visual-bell off +set -g visual-silence off +setw -g monitor-activity off +set -g bell-action none + +# Status bar +set -g status-position top +set -g status-justify left + +# Start index on 1 +set -g base-index 1 +set -g pane-base-index 1 +set-window-option -g pane-base-index 1 +set-option -g renumber-windows on + +# Resize panes +bind -r J resize-pane -D 5 +bind -r K resize-pane -U 5 +bind -r L resize-pane -R 5 +bind -r H resize-pane -L 5 +bind -r m resize-pane -Z +# Resize dragging +unbind -T copy-mode-vi MouseDragEnd1Pane # don't exit copy mode after dragging with mouse + +# Vim motions +set-window-option -g mode-keys vi + +# Selection +bind-key -T copy-mode-vi 'v' send -X begin-selection # start selecting text with "v" +bind-key -T copy-mode-vi 'y' send -X copy-selection # copy text with "y" + +set -g @plugin "dweidner/tmux-theme" +set -g @plugin 'tmux-plugins/tmux-yank' +set -g @plugin 'tmux-plugins/tmux-cpu' +set -g @plugin 'tmux-plugins/tmux-battery' +set -g @plugin 'catppuccin/tmux#v2.1.1' # See https://github.com/catppuccin/tmux/tags for additional tags +set -g @plugin 'b0o/tmux-autoreload' +set -g @plugin 'tmux-plugins/tpm' + +bind-key -T copy-mode-vi v send-keys -X begin-selection +bind-key -T copy-mode-vi C-v send-keys -X rectangle-toggle +bind-key -T copy-mode-vi y send-keys -X copy-selection-and-cancel + +# Catppuccin config +set -g @catppuccin_status_background none +set -g @catppuccin_flavor 'mocha' +set -g @catppuccin_window_status_style "basic" + +set -g status-right-length 100 +set -g status-left "" +set -g status-left-length 200 +set -g status-right "#{E:@catppuccin_status_application}" +set -agF status-right "#{E:@catppuccin_status_cpu}" +set -ag status-right "#{E:@catppuccin_status_session}" +set -ag status-right "#{E:@catppuccin_status_uptime}" +set -agF status-right "#{E:@catppuccin_status_battery}" + + +# Neovim delay fix +set -sg escape-time 0 + +# Tmux keep session +set-option -g detach-on-destroy off + +# Focus envents +set-option -g focus-events on +bind-key z resize-pane -Z \; if-shell "tmux list-panes -F '#F' | grep -q Z" "set -g status off" "set -g status on" + +# Clipboard +set -g set-clipboard on + +run '~/.tmux/plugins/tpm/tpm' diff --git a/modules/home-manager/wlogout/default.nix b/modules/home-manager/wlogout/default.nix new file mode 100644 index 0000000..b26c8ac --- /dev/null +++ b/modules/home-manager/wlogout/default.nix @@ -0,0 +1,102 @@ +{ + config, + lib, + pkgs, + ... +}: +let + font = "BerkeleyMono Nerd Font Mono"; + + bg1 = "#3c3836"; # button fill + bg2 = "#504945"; # button border / hover fill + fg = "#ebdbb2"; # icon + text + orange = "#fe8019"; # accent — matches hyprlock/rofi + + icons = "${config.programs.wlogout.package}/share/wlogout/icons"; +in +{ + options.custom = { + wlogout.enable = lib.mkEnableOption "enable wlogout - logout menu"; + }; + + config = lib.mkIf config.custom.wlogout.enable { + programs.wlogout = { + enable = true; + layout = [ + { + label = "lock"; + action = "loginctl lock-session"; + text = "Lock [l]"; + keybind = "l"; + } + { + label = "logout"; + action = "loginctl terminate-user $USER"; + text = "Logout [e]"; + keybind = "e"; + } + { + label = "shutdown"; + action = "hyprshutdown -t 'Shutting down...' --post-cmd 'shutdown -P 0'"; + text = "Shutdown [s]"; + keybind = "s"; + } + { + label = "suspend"; + action = "systemctl suspend"; + text = "Suspend [u]"; + keybind = "u"; + } + { + label = "reboot"; + action = "hyprshutdown -t 'Restarting...' --post-cmd 'reboot'"; + text = "Reboot [r]"; + keybind = "r"; + } + ]; + style = '' + * { + font-family: "${font}"; + background-image: none; + box-shadow: none; + } + + window { + background-color: rgba(29, 32, 33, 0.6); /* gruvbox bg0_hard @ 60% */ + } + + button { + color: ${fg}; + background-color: ${bg1}; + border: 2px solid ${bg2}; + border-radius: 16px; + margin: 1rem; + font-size: 1.1rem; + + background-repeat: no-repeat; + background-position: center; + background-size: 25%; + + transition: all 0.2s ease-in-out; + } + + button:focus, + button:active, + button:hover { + color: ${orange}; + background-color: ${bg2}; + border-color: ${orange}; + background-size: 30%; + box-shadow: inset 0 0 0 2px ${orange}; /* clean inner ring, no bleed */ + outline: none; + } + + #lock { background-image: url("${icons}/lock.png"); } + #logout { background-image: url("${icons}/logout.png"); } + #shutdown { background-image: url("${icons}/shutdown.png"); } + #suspend { background-image: url("${icons}/suspend.png"); } + #reboot { background-image: url("${icons}/reboot.png"); } + ''; + }; + }; +} diff --git a/modules/home-manager/zshrc/default.nix b/modules/home-manager/zshrc/default.nix new file mode 100644 index 0000000..27cb2f0 --- /dev/null +++ b/modules/home-manager/zshrc/default.nix @@ -0,0 +1,62 @@ +{ + inputs, + lib, + config, + pkgs, + ... +}: + +{ + options.custom = { + zsh = { + enable = lib.mkEnableOption "enable zsh shell"; + fastfetch = lib.mkOption { + type = lib.types.bool; + default = true; + description = '' + Whether to invoke fastfetch on zsh init. + ''; + }; + }; + }; + + config = lib.mkIf config.custom.zsh.enable { + programs.zsh = { + enable = true; + enableCompletion = true; + autosuggestion.enable = true; + syntaxHighlighting.enable = true; + + oh-my-zsh = { + enable = true; + plugins = [ "git" "jj" ]; + theme = ""; + }; + + shellAliases = { + tx = "tmuxinator"; + n = "nvim --listen /tmp/nvim$(echo $RANDOM | md5sum | cut -c1-8).sock"; + ls = "eza --icons --group-directories-first --color=always"; + man = "batman"; + ":q" = "exit"; + so = "source ~/.zshrc"; + opencode = "OPENCODE_ENABLE_EXA=1 opencode"; + zki = "zk edit --interactive --notebook-dir=~/Documents/Notes"; + enc = "openssl enc -aes-256-cbc -md sha512 -pbkdf2 -iter 1000000 -salt"; + backup = "packup && rm ~/Documents/packup* && mv ~/packup* ~/Documents/ && rsync --archive --update --copy-links ~/Documents 192.168.3.200:/home/jpporta/ --info=progress2"; + gn = "git commit -m \"$(date)\""; + nixs = "cd ~/nixos-config && git add . && sudo nixos-rebuild switch --flake ~/nixos-config#jpporta-nixos"; + nix-search = "nix --extra-experimental-features \"nix-command flakes\" search nixpkgs"; + nix-garbage = "sudo nix-collect-garbage -d && sudo nixos-rebuild switch"; + nix-update = "sudo nix-channel --update && sudo nixos-rebuild switch"; + hms = "cd ~/nixos-config && git add . && home-manager switch --flake . "; + s = "sesh connect $(sesh list | fzf)"; + openspec = "npx @fission-ai/openspec@latest"; + }; + + initContent = lib.mkIf config.custom.zsh.fastfetch '' + fastfetch + ''; + }; + }; +} diff --git a/modules/nixos/awsvpn/default.nix b/modules/nixos/awsvpn/default.nix new file mode 100644 index 0000000..0e87edc --- /dev/null +++ b/modules/nixos/awsvpn/default.nix @@ -0,0 +1,21 @@ +{ + config, + lib, + pkgs, + inputs, + ... +}: + +let + cfg = config.programs.awsVpnClient; + awsvpnclientPkg = inputs.awsvpnclient.defaultPackage.${pkgs.system}; +in +{ + options.programs.awsVpnClient = { + enable = lib.mkEnableOption "AWS Client VPN with SAML (ymatsiuk/awsvpnclient flake)"; + }; + + config = lib.mkIf cfg.enable { + environment.systemPackages = [ awsvpnclientPkg ]; + }; +} diff --git a/modules/nixos/hyprland/default.nix b/modules/nixos/hyprland/default.nix new file mode 100644 index 0000000..fa68da8 --- /dev/null +++ b/modules/nixos/hyprland/default.nix @@ -0,0 +1,30 @@ +{ + config, + lib, + pkgs, + ... +}: + +{ + + options.custom = { + hyprland.enable = lib.mkEnableOption "enable hyprland - system window manger and compositor"; + }; + + config = lib.mkIf config.custom.hyprland.enable { + + programs.dconf.enable = true; + + programs.hyprland = { + enable = true; + xwayland.enable = true; + }; + + xdg.portal = { + enable = true; + extraPortals = [ pkgs.xdg-desktop-portal-hyprland ]; + }; + + security.polkit.enable = true; + }; +} diff --git a/modules/nixos/obs/default.nix b/modules/nixos/obs/default.nix new file mode 100644 index 0000000..932e66a --- /dev/null +++ b/modules/nixos/obs/default.nix @@ -0,0 +1,16 @@ + +{ + config, + lib, + pkgs, + ... +}: +{ + options.custom = { + obs.enable = lib.mkEnableOption "enable obs - capture, record and stream software"; + }; + + config = lib.mkIf config.custom.obs.enable { + }; + +} diff --git a/modules/nixos/steam/default.nix b/modules/nixos/steam/default.nix new file mode 100644 index 0000000..d4cb83a --- /dev/null +++ b/modules/nixos/steam/default.nix @@ -0,0 +1,17 @@ +{ + config, + lib, + pkgs, + ... +}: +{ + options.custom = { + steam.enable = lib.mkEnableOption "enable steam - game library and store"; + }; + + config = lib.mkIf config.custom.steam.enable { + programs.steam.enable = true; + programs.gamemode.enable = true; + }; + +}