From 0b930a90fdcb6885f6b812df3ba9fdc8ae13fb0f Mon Sep 17 00:00:00 2001 From: "Alexandre Cavalheiro S. Tiago da Silva" Date: Wed, 14 Aug 2024 10:58:06 -0300 Subject: [PATCH] merge: sync with desktop --- flake.lock | 277 ++++++++++- flake.nix | 2 + home-manager.nix | 15 +- nixos.nix | 54 ++- programs/emacs/default.nix | 43 +- programs/emacs/doom/init.el | 2 +- programs/fish/default.nix | 2 + programs/gamemode.ini | 2 +- programs/hyprland/default.nix | 582 +++++++++++++---------- programs/neovim/default.nix | 4 +- programs/neovim/lua/plugins/astrolsp.lua | 20 +- programs/neovim/lua/plugins/user.lua | 3 + 12 files changed, 694 insertions(+), 312 deletions(-) diff --git a/flake.lock b/flake.lock index 7cdee51..604b7af 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,38 @@ { "nodes": { + "aquamarine": { + "inputs": { + "hyprutils": [ + "hyprland", + "hyprutils" + ], + "hyprwayland-scanner": [ + "hyprland", + "hyprwayland-scanner" + ], + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1723405438, + "narHash": "sha256-bpmC2m7OhlDvqgQZdZ2jBLyeIkq/Jld3X4bqRAxBSp8=", + "owner": "hyprwm", + "repo": "aquamarine", + "rev": "9312aa28271c91e5d67ecb9def527b2bbcff0e66", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "aquamarine", + "type": "github" + } + }, "flake-compat": { "flake": false, "locked": { @@ -23,11 +56,11 @@ ] }, "locked": { - "lastModified": 1721135958, - "narHash": "sha256-H548rpPMsn25LDKn1PCFmPxmWlClJJGnvdzImHkqjuY=", + "lastModified": 1723399884, + "narHash": "sha256-97wn0ihhGqfMb8WcUgzzkM/TuAxce2Gd20A8oiruju4=", "owner": "nix-community", "repo": "home-manager", - "rev": "afd2021bedff2de92dfce0e257a3d03ae65c603d", + "rev": "086f619dd991a4d355c07837448244029fc2d9ab", "type": "github" }, "original": { @@ -36,13 +69,191 @@ "type": "github" } }, + "hyprcursor": { + "inputs": { + "hyprlang": [ + "hyprland", + "hyprlang" + ], + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1722623071, + "narHash": "sha256-sLADpVgebpCBFXkA1FlCXtvEPu1tdEsTfqK1hfeHySE=", + "owner": "hyprwm", + "repo": "hyprcursor", + "rev": "912d56025f03d41b1ad29510c423757b4379eb1c", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprcursor", + "type": "github" + } + }, + "hyprland": { + "inputs": { + "aquamarine": "aquamarine", + "hyprcursor": "hyprcursor", + "hyprlang": "hyprlang", + "hyprutils": "hyprutils", + "hyprwayland-scanner": "hyprwayland-scanner", + "nixpkgs": "nixpkgs", + "systems": "systems", + "xdph": "xdph" + }, + "locked": { + "lastModified": 1723570020, + "narHash": "sha256-+kPQXd+WSXj/wW1hhPre8Nzn6c4XmUJEv5tTNYyDgvU=", + "ref": "refs/heads/main", + "rev": "39df1f4dbfedf97a7f30f9de359f3b3415844380", + "revCount": 5084, + "submodules": true, + "type": "git", + "url": "https://github.com/hyprwm/Hyprland" + }, + "original": { + "submodules": true, + "type": "git", + "url": "https://github.com/hyprwm/Hyprland" + } + }, + "hyprland-protocols": { + "inputs": { + "nixpkgs": [ + "hyprland", + "xdph", + "nixpkgs" + ], + "systems": [ + "hyprland", + "xdph", + "systems" + ] + }, + "locked": { + "lastModified": 1721326555, + "narHash": "sha256-zCu4R0CSHEactW9JqYki26gy8h9f6rHmSwj4XJmlHgg=", + "owner": "hyprwm", + "repo": "hyprland-protocols", + "rev": "5a11232266bf1a1f5952d5b179c3f4b2facaaa84", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprland-protocols", + "type": "github" + } + }, + "hyprlang": { + "inputs": { + "hyprutils": [ + "hyprland", + "hyprutils" + ], + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1721324361, + "narHash": "sha256-BiJKO0IIdnSwHQBSrEJlKlFr753urkLE48wtt0UhNG4=", + "owner": "hyprwm", + "repo": "hyprlang", + "rev": "adbefbf49664a6c2c8bf36b6487fd31e3eb68086", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprlang", + "type": "github" + } + }, + "hyprutils": { + "inputs": { + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1722869141, + "narHash": "sha256-0KU4qhyMp441qfwbirNg3+wbm489KnEjXOz2I/RbeFs=", + "owner": "hyprwm", + "repo": "hyprutils", + "rev": "0252fd13e78e60fb0da512a212e56007515a49f7", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprutils", + "type": "github" + } + }, + "hyprwayland-scanner": { + "inputs": { + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1721324119, + "narHash": "sha256-SOOqIT27/X792+vsLSeFdrNTF+OSRp5qXv6Te+fb2Qg=", + "owner": "hyprwm", + "repo": "hyprwayland-scanner", + "rev": "a048a6cb015340bd82f97c1f40a4b595ca85cc30", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprwayland-scanner", + "type": "github" + } + }, "nixpkgs": { "locked": { - "lastModified": 1720957393, - "narHash": "sha256-oedh2RwpjEa+TNxhg5Je9Ch6d3W1NKi7DbRO1ziHemA=", + "lastModified": 1723175592, + "narHash": "sha256-M0xJ3FbDUc4fRZ84dPGx5VvgFsOzds77KiBMW/mMTnI=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "5e0ca22929f3342b19569b21b2f3462f053e497b", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1723362943, + "narHash": "sha256-dFZRVSgmJkyM0bkPpaYRtG/kRMRTorUIDj8BxoOt1T4=", "owner": "nixos", "repo": "nixpkgs", - "rev": "693bc46d169f5af9c992095736e82c3488bf7dbb", + "rev": "a58bc8ad779655e790115244571758e8de055e3d", "type": "github" }, "original": { @@ -55,7 +266,8 @@ "root": { "inputs": { "home-manager": "home-manager", - "nixpkgs": "nixpkgs", + "hyprland": "hyprland", + "nixpkgs": "nixpkgs_2", "spicetify-nix": "spicetify-nix" } }, @@ -67,11 +279,11 @@ ] }, "locked": { - "lastModified": 1721103144, - "narHash": "sha256-vHGUl/kagv0/QsPXMW+caSPyuvHvMUJSV80cbe+0/2M=", + "lastModified": 1723542043, + "narHash": "sha256-Oq3umTh8Xm7pDkE/GrIqv5CG8laT/AyHKwpenw2kP7w=", "owner": "Gerg-L", "repo": "spicetify-nix", - "rev": "085ddf8abc78a7f1682c99715584e8735f4903cf", + "rev": "d3a7ad3d15ffee841bb8940c0162f3eaa1554598", "type": "github" }, "original": { @@ -79,6 +291,51 @@ "repo": "spicetify-nix", "type": "github" } + }, + "systems": { + "locked": { + "lastModified": 1689347949, + "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", + "owner": "nix-systems", + "repo": "default-linux", + "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default-linux", + "type": "github" + } + }, + "xdph": { + "inputs": { + "hyprland-protocols": "hyprland-protocols", + "hyprlang": [ + "hyprland", + "hyprlang" + ], + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1722365976, + "narHash": "sha256-Khdm+mDzYA//XaU0M+hftod+rKr5q9SSHSEuiQ0/9ow=", + "owner": "hyprwm", + "repo": "xdg-desktop-portal-hyprland", + "rev": "7f2a77ddf60390248e2a3de2261d7102a13e5341", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "xdg-desktop-portal-hyprland", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index 099c64f..b005030 100644 --- a/flake.nix +++ b/flake.nix @@ -13,6 +13,8 @@ url = "github:Gerg-L/spicetify-nix"; inputs.nixpkgs.follows = "nixpkgs"; }; + + hyprland.url = "git+https://github.com/hyprwm/Hyprland?submodules=1"; }; outputs = diff --git a/home-manager.nix b/home-manager.nix index 20f111a..e328f8a 100644 --- a/home-manager.nix +++ b/home-manager.nix @@ -73,22 +73,31 @@ ## Tools # Utilities brightnessctl - discord fastfetch firefox pavucontrol + protonvpn-gui qbittorrent qdirstat speedcrunch - vesktop vlc yt-dlp zathura + # Personal utilities + ledger + vesktop + # Editing - krita libreoffice + + # Creative work + blender + krita + lmms + orca-slicer shotcut + vcv-rack ## Entertainment jellyfin-media-player diff --git a/nixos.nix b/nixos.nix index 898c001..03e2040 100644 --- a/nixos.nix +++ b/nixos.nix @@ -2,8 +2,16 @@ # your system. Help is available in the configuration.nix(5) man page # and in the NixOS manual (accessible by running ‘nixos-help’). -{ config, pkgs, ... }: +{ + config, + pkgs, + hyprland, + ... +}: +let + hyprland-pkgs = hyprland.inputs.nixpkgs.legacyPackages.${pkgs.stdenv.hostPlatform.system}; +in { ## ## NIXOS ## @@ -35,6 +43,12 @@ nix.optimise.automatic = true; nix.settings.auto-optimise-store = true; + # Enable Hyprland's cachix + nix.settings.substituters = [ "https://hyprland.cachix.org" ]; + nix.settings.trusted-public-keys = [ + "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc=" + ]; + # This value determines the NixOS release from which the default # settings for stateful data, like file locations and database versions # on your system were taken. It‘s perfectly fine and recommended to leave @@ -184,10 +198,11 @@ }; # Enable QMK support. - hardware.keyboard.qmk.enable = true; + # hardware.keyboard.qmk.enable = true; + # FIXME: Causing issues with xpadneo :( - # Enable the udev rules Steam recommends for controllers. - hardware.steam-hardware.enable = true; + # enable a better driver for wireless xbox controllers. + hardware.xpadneo.enable = true; # Enable fstrim for better ssd lifespan services.fstrim.enable = true; @@ -200,18 +215,22 @@ services.displayManager.sddm = { enable = true; wayland.enable = true; - theme = "${import ./theming/sddm { inherit pkgs; }}"; + theme = "catppuccin-frappe"; + package = pkgs.kdePackages.sddm; }; # Enable Hyprland - programs.hyprland.enable = true; + programs.hyprland = { + enable = true; + + package = hyprland.packages.${pkgs.stdenv.hostPlatform.system}.hyprland; + portalPackage = hyprland.packages.${pkgs.stdenv.hostPlatform.system}.xdg-desktop-portal-hyprland; + }; # Enable XDG Desktop Portals. xdg.portal = { enable = true; - extraPortals = with pkgs; [ xdg-desktop-portal-hyprland ]; - config = { common = { default = [ "hyprland" ]; @@ -230,6 +249,9 @@ enable = true; enable32Bit = true; + package = hyprland-pkgs.mesa.drivers; + package32 = hyprland-pkgs.pkgsi686Linux.mesa.drivers; + extraPackages = with pkgs; [ rocm-opencl-icd # OpenGL hwa rocm-opencl-runtime @@ -280,6 +302,7 @@ # Enable Steam. programs.steam = { enable = true; + remotePlay.openFirewall = true; localNetworkGameTransfers.openFirewall = true; # ^ Enables so we can transfer games to other computers in the network. @@ -303,6 +326,7 @@ # Enable virt-manager virtualisation.libvirtd.enable = true; programs.virt-manager.enable = true; + virtualisation.spiceUSBRedirection.enable = true; # List packages installed in system profile. To search, run: # $ nix search wget @@ -311,7 +335,9 @@ # Utilities bat duf + fuseiso lm_sensors + p7zip tree unrar unzip @@ -330,6 +356,15 @@ wl-clipboard xclip zoxide + (catppuccin-sddm.override # So SDDM finds the theme files. + { + flavor = "frappe"; + font = "FantasqueSansM Nerd Font"; + fontSize = "12"; + background = "${./theming/sddm/Background.jpg}"; + loginBackground = true; + } + ) # Networking gping @@ -364,7 +399,8 @@ services.flatpak.enable = true; # Enables VIA - services.udev.packages = [ pkgs.via ]; + # services.udev.packages = [ pkgs.via ]; + # FIXME: Causing issues with xpadneo :( # Enable and configure PostgreSQL. services.postgresql = { diff --git a/programs/emacs/default.nix b/programs/emacs/default.nix index 9bc5c1a..02674c6 100644 --- a/programs/emacs/default.nix +++ b/programs/emacs/default.nix @@ -1,9 +1,12 @@ -{ pkgs, lib, ... }: +{ pkgs, ... }: { - programs.emacs.enable = true; - home.packages = with pkgs; [ + # CORE + git + emacs + ripgrep + # Optional for DOOM clang coreutils @@ -16,37 +19,15 @@ pt_BR ] )) # for flyspell - gnuplot # for plotting graphs + gnuplot_qt # for plotting graphs languagetool # for grammar ledger # for accounting and org-ledger + gzip # Otherwise random errors occur from the onChange script ]; # Neatly place the configuration files for doom in their right place. - xdg.configFile."doom" = - let - # What DOOM needs to be able to install/sync. - packagesNeeded = with pkgs; [ - git - emacs - ripgrep - ]; - in - { - source = ./doom; - recursive = true; - - onChange = # sh - '' - # Need to set this so DOOM can find all binaries. - export PATH="${lib.strings.concatMapStrings (x: x + "/bin:") packagesNeeded}$PATH" - - if [ ! -d "$HOME/.emacs.d" ]; then - git clone https://github.com/hlissner/doom-emacs $HOME/.emacs.d - $HOME/.emacs.d/bin/doom install - else - # Needed to apply the configuration changes. - $HOME/.emacs.d/bin/doom sync - fi - ''; - }; + xdg.configFile."doom" = { + source = ./doom; + recursive = true; + }; } diff --git a/programs/emacs/doom/init.el b/programs/emacs/doom/init.el index eefc4d6..20ce4a8 100644 --- a/programs/emacs/doom/init.el +++ b/programs/emacs/doom/init.el @@ -77,7 +77,7 @@ :term ;;eshell ; the elisp shell that works everywhere ;;shell ; simple shell REPL for Emacs - ;;term ; basic terminal emulator for Emacs + term ; basic terminal emulator for Emacs ;;vterm ; the best terminal emulation in Emacs :checkers diff --git a/programs/fish/default.nix b/programs/fish/default.nix index 946bf8f..53ac014 100644 --- a/programs/fish/default.nix +++ b/programs/fish/default.nix @@ -34,6 +34,8 @@ shellAliases = { del = "trash_file"; + dev = "nix develop -c fish"; + doom = "~/.emacs.d/bin/doom"; }; functions = { diff --git a/programs/gamemode.ini b/programs/gamemode.ini index 8f597e4..4b76c17 100644 --- a/programs/gamemode.ini +++ b/programs/gamemode.ini @@ -52,7 +52,7 @@ gpu_device=1 ; See: https://dri.freedesktop.org/docs/drm/gpu/amdgpu.html#gpu-power-thermal-controls-and-monitoring ; It is also highly recommended you use lm-sensors (or other available tools) to verify card temperatures ; This corresponds to power_dpm_force_performance_level, "manual" is not supported for now -amd_performance_level=high +amd_performance_level=auto [supervisor] ; This section controls the new gamemode functions gamemode_request_start_for and gamemode_request_end_for diff --git a/programs/hyprland/default.nix b/programs/hyprland/default.nix index f6dc4c4..f415d89 100644 --- a/programs/hyprland/default.nix +++ b/programs/hyprland/default.nix @@ -1,275 +1,351 @@ { - wayland.windowManager.hyprland = { - enable = true; + xdg.configFile."hypr/frappe.conf".source = builtins.fetchurl { + url = "https://raw.githubusercontent.com/catppuccin/hyprland/main/themes/frappe.conf"; + sha256 = "1clw669i1n3dhawdw4clmjv75fy3smycb5iqk3sanzpr3y0i4vwx"; + }; + # Enable hypridle and hyprlock + services.hypridle = { + enable = true; + settings = { + general = { + after_sleep_cmd = "hyprctl dispatch dpms on"; + ignore_dbus_inhibit = false; + lock_cmd = "hyprlock"; + }; + + listener = [ + { + timeout = 300; + on-timeout = "hyprlock"; + } + { + timeout = 480; + on-timeout = "hyprctl dispatch dpms off"; + on-resume = "hyprctl dispatch dpms on"; + } + ]; + }; + }; + + programs.hyprlock = { + enable = true; extraConfig = # hyprlang '' - # Catppuccin Macchiato - https://github.com/catppuccin/hyprland - $rosewaterAlpha = rgb(f4dbd6) - $flamingoAlpha = rgb(f0c6c6) - $pinkAlpha = rgb(f5bde6) - $mauveAlpha = rgb(c6a0f6) - $redAlpha = rgb(ed8796) - $maroonAlpha = rgb(ee99a0) - $peachAlpha = rgb(f5a97f) - $yellowAlpha = rgb(eed49f) - $greenAlpha = rgb(a6da95) - $tealAlpha = rgb(8bd5ca) - $skyAlpha = rgb(91d7e3) - $sapphireAlpha = rgb(7dc4e4) - $blueAlpha = rgb(8aadf4) - $lavenderAlpha = rgb(b7bdf8) + source = $HOME/.config/hypr/frappe.conf - $textAlpha = rgb(cad3f5) - $subtext1Alpha = rgb(b8c0e0) - $subtext0Alpha = rgb(a5adcb) - - $overlay2Alpha = rgb(939ab7) - $overlay1Alpha = rgb(8087a2) - $overlay0Alpha = rgb(6e738d) - - $surface2Alpha = rgb(5b6078) - $surface1Alpha = rgb(494d64) - $surface0Alpha = rgb(363a4f) - - $baseAlpha = rgb(24273a) - $mantleAlpha = rgb(1e2030) - $crustAlpha = rgb(181926) - - $rosewater = 0xfff5e0dc - $flamingo = 0xfff2cdcd - $pink = 0xfff5c2e7 - $mauve = 0xffcba6f7 - $red = 0xfff38ba8 - $maroon = 0xffeba0ac - $peach = 0xfffab387 - $yellow = 0xfff9e2af - $green = 0xffa6e3a1 - $teal = 0xff94e2d5 - $sky = 0xff89dceb - $sapphire = 0xff74c7ec - $blue = 0xff89b4fa - $lavender = 0xffb4befe - - $text = 0xffcdd6f4 - $subtext1 = 0xffbac2de - $subtext0 = 0xffa6adc8 - - $overlay2 = 0xff9399b2 - $overlay1 = 0xff7f849c - $overlay0 = 0xff6c7086 - - $surface2 = 0xff585b70 - $surface1 = 0xff45475a - $surface0 = 0xff313244 - - $base = 0xff1e1e2e - $mantle = 0xff181825 - $crust = 0xff11111b - - # - # Please note not all available settings / options are set here. - # For a full list, see the wiki - # - - autogenerated = 0 # remove this line to remove the warning - - # See https://wiki.hyprland.org/Configuring/Monitors/ - monitor = eDP-1, 1920x1080@60.00800, 0x0, 1 - - # See https://wiki.hyprland.org/Configuring/Keywords/ for more - - # Inject home-manager session variables - exec-once = /etc/profiles/per-user/wizardlink/etc/profile.d/hm-session-vars.sh - - # Execute your favorite apps at launch - exec-once = ~/.local/share/scripts/hyprland/start_services.sh - - # Source a file (multi-file configs) - # source = ~/.config/hypr/myColors.conf - - # For all categories, see https://wiki.hyprland.org/Configuring/Variables/ - input { - kb_layout = us,br,jp - kb_variant = ,,kana86 - kb_model = - kb_options = grp:alts_toggle - kb_rules = - - follow_mouse = 1 - float_switch_override_focus = 1 - - accel_profile = flat - force_no_accel = true - - sensitivity = 0 # -1.0 - 1.0, 0 means no modification. - - tablet { - output = eDP-1 - } - } + $accent = $mauve + $accentAlpha = $mauveAlpha + $font = JetBrainsMono Nerd Font + # GENERAL general { - # See https://wiki.hyprland.org/Configuring/Variables/ for more - - gaps_in = 6 - gaps_out = 18 - border_size = 2 - col.active_border = $base $surface0 $green 45deg - col.inactive_border = $base $surface0 $blue 45deg - - layout = dwindle + disable_loading_bar = true + hide_cursor = true } - decoration { - # See https://wiki.hyprland.org/Configuring/Variables/ for more - - rounding = 8 - # FIXME: Check these deprecations. - #blur = yes - #blur_size = 3 - #blur_passes = 1 - #blur_new_optimizations = on - - drop_shadow = yes - shadow_range = 4 - shadow_render_power = 3 - col.shadow = $crust + # BACKGROUND + background { + monitor = + path = $HOME/internal/personal/wallpapers/wallhaven-2em8y6.jpg + blur_passes = 0 + color = $base } - animations { - enabled = yes - - # Some default animations, see https://wiki.hyprland.org/Configuring/Animations/ for more - - bezier = myBezier, 0.05, 0.9, 0.1, 1.05 - - animation = windows, 1, 7, myBezier - animation = windowsOut, 1, 7, default, popin 80% - animation = border, 1, 10, default - animation = borderangle, 1, 8, default - animation = fade, 1, 7, default - animation = workspaces, 1, 6, default + # LAYOUT + label { + monitor = + text = Layout: $LAYOUT + color = $text + font_size = 25 + font_family = $font + position = 30, -30 + halign = left + valign = top } - dwindle { - # See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more - pseudotile = yes # master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below - preserve_split = yes # you probably want this + # TIME + label { + monitor = + text = $TIME + color = $text + font_size = 90 + font_family = $font + position = -30, 0 + halign = right + valign = top } - master { - # See https://wiki.hyprland.org/Configuring/Master-Layout/ for more - new_status = slave + # DATE + label { + monitor = + text = cmd[update:43200000] date +"%A, %d %B %Y" + color = $text + font_size = 25 + font_family = $font + position = -30, -150 + halign = right + valign = top } - gestures { - # See https://wiki.hyprland.org/Configuring/Variables/ for more - workspace_swipe = off + # USER AVATAR + image { + monitor = + path = $HOME/.face + size = 100 + border_color = $accent + position = 0, 75 + halign = center + valign = center } - # Example windowrule v1 - # windowrule = float, ^(kitty)$ - # Example windowrule v2 - # windowrulev2 = float,class:^(kitty)$,title:^(kitty)$ - # See https://wiki.hyprland.org/Configuring/Window-Rules/ for more - - # Bind workspaces to specific monitors - workspace = 1, monitor:eDP-1 - workspace = 2, monitor:eDP-1 - workspace = 3, monitor:eDP-1 - workspace = 4, monitor:eDP-1 - workspace = 5, monitor:eDP-1 - workspace = 6, monitor:eDP-1 - workspace = 7, monitor:eDP-1 - workspace = 8, monitor:eDP-1 - workspace = 9, monitor:eDP-1 - workspace = 0, monitor:eDP-1 - - # See https://wiki.hyprland.org/Configuring/Keywords/ for more - $mainMod = SUPER - - # Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more - bind = $mainMod CTRL, F, fakefullscreen - bind = $mainMod CTRL, L, exec, cliphist list | rofi -dmenu | cliphist decode | wl-copy - bind = $mainMod CTRL, P, exec, ~/.local/share/scripts/hyprland/screenshot_area.sh - bind = $mainMod CTRL, V, pin - bind = $mainMod SHIFT, F, fullscreen, 1 - bind = $mainMod SHIFT, P, exec, ~/.local/share/scripts/hyprland/screenshot.sh - bind = $mainMod, C, killactive - bind = $mainMod, E, exec, thunar - bind = $mainMod, F, fullscreen - bind = $mainMod, M, exit - bind = $mainMod, O, togglesplit # dwindle - bind = $mainMod, P, pseudo # dwindle - bind = $mainMod, Q, exec, alacritty - bind = $mainMod, R, exec, rofi -show drun - bind = $mainMod, V, togglefloating - - # Move focus with mainMod + arrow keys - bind = $mainMod, H, movefocus, l - bind = $mainMod, L, movefocus, r - bind = $mainMod, K, movefocus, u - bind = $mainMod, J, movefocus, d - - # Switch workspaces with mainMod + [0-9] - bind = $mainMod, 1, workspace, 1 - bind = $mainMod, 2, workspace, 2 - bind = $mainMod, 3, workspace, 3 - bind = $mainMod, 4, workspace, 4 - bind = $mainMod, 5, workspace, 5 - bind = $mainMod, 6, workspace, 6 - bind = $mainMod, 7, workspace, 7 - bind = $mainMod, 8, workspace, 8 - #bind = $mainMod, 9, workspace, 9 - #bind = $mainMod, 0, workspace, 10 - - # Move active window to a workspace with mainMod + SHIFT + [0-9] - bind = $mainMod SHIFT, 1, movetoworkspace, 1 - bind = $mainMod SHIFT, 2, movetoworkspace, 2 - bind = $mainMod SHIFT, 3, movetoworkspace, 3 - bind = $mainMod SHIFT, 4, movetoworkspace, 4 - bind = $mainMod SHIFT, 5, movetoworkspace, 5 - bind = $mainMod SHIFT, 6, movetoworkspace, 6 - bind = $mainMod SHIFT, 7, movetoworkspace, 7 - bind = $mainMod SHIFT, 8, movetoworkspace, 8 - bind = $mainMod SHIFT, 9, movetoworkspace, 9 - bind = $mainMod SHIFT, 0, movetoworkspace, 10 - - # Scroll through existing workspaces with mainMod + scroll - bind = $mainMod, mouse_down, workspace, e+1 - bind = $mainMod, mouse_up, workspace, e-1 - - # Move/resize windows with mainMod + LMB/RMB and dragging - bind = $mainMod SHIFT, H, movewindow, l - bind = $mainMod SHIFT, L, movewindow, r - bind = $mainMod SHIFT, K, movewindow, u - bind = $mainMod SHIFT, J, movewindow, d - bind = $mainMod ALT, H, resizeactive, -5% 0 - bind = $mainMod ALT, L, resizeactive, 5% 0 - bind = $mainMod ALT, K, resizeactive, 0 -5% - bind = $mainMod ALT, J, resizeactive, 0 5% - bindm = $mainMod, mouse:272, movewindow - bindm = $mainMod, mouse:273, resizewindow - - # Volume changes - binde = , XF86AudioRaiseVolume, exec, wpctl set-volume -l 1.5 @DEFAULT_AUDIO_SINK@ 1%+ - binde = , XF86AudioLowerVolume, exec, wpctl set-volume -l 1.5 @DEFAULT_AUDIO_SINK@ 1%- - bind = , XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle - - # Passthrough binds - bind = SHIFT CTRL, F12, pass, ^(com.obsproject.Studio)$ - - # Window rules - windowrulev2 = opacity 0.0 override 0.0 override,class:^(xwaylandvideobridge)$ - windowrulev2 = noanim,class:^(xwaylandvideobridge)$ - windowrulev2 = nofocus,class:^(xwaylandvideobridge)$ - windowrulev2 = noinitialfocus,class:^(xwaylandvideobridge)$ - - # Rules for windowkill - windowrule = noborder, ^(steam_app_2726450)$ - windowrule = pin, ^(steam_app_2726450)$ - windowrule = opacity 0.9, ^(steam_app_2726450)$ + # INPUT FIELD + input-field { + monitor = + size = 300, 60 + outline_thickness = 4 + dots_size = 0.2 + dots_spacing = 0.2 + dots_center = true + outer_color = $accent + inner_color = $surface0 + font_color = $text + fade_on_empty = false + placeholder_text = 󰌾 Logged in as $USER + hide_input = false + check_color = $accent + fail_color = $red + fail_text = $FAIL ($ATTEMPTS) + capslock_color = $yellow + position = 0, -47 + halign = center + valign = center + } ''; }; + + # Configure hyprland - we enable it in NixOS. + xdg.configFile."hypr/hyprland.conf".text = # hyprlang + '' + source = $HOME/.config/hypr/frappe.conf + + # + # Please note not all available settings / options are set here. + # For a full list, see the wiki + # + + autogenerated = 0 # remove this line to remove the warning + + # See https://wiki.hyprland.org/Configuring/Monitors/ + monitor = DP-3, 1920x1080@74.97, 2561x0, 1 + monitor = DP-2, 2560x1440@165.00, 0x0, 1 + + # See https://wiki.hyprland.org/Configuring/Keywords/ for more + + # Inject home-manager session variables + exec-once = /etc/profiles/per-user/wizardlink/etc/profile.d/hm-session-vars.sh + + # Execute your favorite apps at launch + exec-once = ~/.local/share/scripts/hyprland/start_services.sh + + # Set cursor size. + env = HYPRCURSOR_SIZE, 36 + env = XCURSOR_SIZE, 36 + + # Source a file (multi-file configs) + # source = ~/.config/hypr/myColors.conf + + # For all categories, see https://wiki.hyprland.org/Configuring/Variables/ + input { + kb_layout = us,br,jp + kb_variant = ,,kana86 + kb_model = + kb_options = grp:alts_toggle + kb_rules = + + follow_mouse = 1 + float_switch_override_focus = 1 + + accel_profile = flat + force_no_accel = true + + sensitivity = 0 # -1.0 - 1.0, 0 means no modification. + + tablet { + output = DP-2 + } + } + + general { + # See https://wiki.hyprland.org/Configuring/Variables/ for more + + gaps_in = 6 + gaps_out = 18 + border_size = 2 + col.active_border = $base $surface0 $green 45deg + col.inactive_border = $base $surface0 $blue 45deg + + layout = dwindle + } + + decoration { + # See https://wiki.hyprland.org/Configuring/Variables/ for more + + rounding = 8 + # FIXME: Check these deprecations. + #blur = yes + #blur_size = 3 + #blur_passes = 1 + #blur_new_optimizations = on + + drop_shadow = yes + shadow_range = 4 + shadow_render_power = 3 + col.shadow = $crust + } + + animations { + enabled = yes + + # Some default animations, see https://wiki.hyprland.org/Configuring/Animations/ for more + + bezier = myBezier, 0.05, 0.9, 0.1, 1.05 + + animation = windows, 1, 7, myBezier + animation = windowsOut, 1, 7, default, popin 80% + animation = border, 1, 10, default + animation = borderangle, 1, 8, default + animation = fade, 1, 7, default + animation = workspaces, 1, 6, default + } + + dwindle { + # See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more + pseudotile = yes # master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below + preserve_split = yes # you probably want this + } + + master { + # See https://wiki.hyprland.org/Configuring/Master-Layout/ for more + new_status = slave + } + + gestures { + # See https://wiki.hyprland.org/Configuring/Variables/ for more + workspace_swipe = off + } + + # Example windowrule v1 + # windowrule = float, ^(kitty)$ + # Example windowrule v2 + # windowrulev2 = float,class:^(kitty)$,title:^(kitty)$ + # See https://wiki.hyprland.org/Configuring/Window-Rules/ for more + + # Bind workspaces to specific monitors + workspace = 1, monitor:DP-2 + workspace = 2, monitor:DP-3 + workspace = 3, monitor:DP-2 + workspace = 4, monitor:DP-3 + workspace = 5, monitor:DP-2 + workspace = 6, monitor:DP-3 + workspace = 7, monitor:DP-2 + workspace = 8, monitor:DP-3 + workspace = 9, monitor:DP-2 + workspace = 0, monitor:DP-3 + + # See https://wiki.hyprland.org/Configuring/Keywords/ for more + $mainMod = SUPER + + # Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more + bind = $mainMod CTRL, F, fullscreenstate, -1 2 + bind = $mainMod CTRL, L, exec, cliphist list | rofi -dmenu | cliphist decode | wl-copy + bind = $mainMod CTRL, P, exec, ~/.local/share/scripts/hyprland/screenshot_area.sh + bind = $mainMod CTRL, V, pin + bind = $mainMod SHIFT, F, fullscreen, 1 + bind = $mainMod SHIFT, P, exec, ~/.local/share/scripts/hyprland/screenshot.sh + bind = $mainMod, C, killactive + bind = $mainMod, E, exec, thunar + bind = $mainMod, F, fullscreen + bind = $mainMod, M, exit + bind = $mainMod, O, togglesplit # dwindle + bind = $mainMod, P, pseudo # dwindle + bind = $mainMod, Q, exec, alacritty + bind = $mainMod, R, exec, rofi -show drun + bind = $mainMod, V, togglefloating + + # Move focus with mainMod + arrow keys + bind = $mainMod, H, movefocus, l + bind = $mainMod, L, movefocus, r + bind = $mainMod, K, movefocus, u + bind = $mainMod, J, movefocus, d + + # Switch workspaces with mainMod + [0-9] + bind = $mainMod, 1, workspace, 1 + bind = $mainMod, 2, workspace, 2 + bind = $mainMod, 3, workspace, 3 + bind = $mainMod, 4, workspace, 4 + bind = $mainMod, 5, workspace, 5 + bind = $mainMod, 6, workspace, 6 + bind = $mainMod, 7, workspace, 7 + bind = $mainMod, 8, workspace, 8 + #bind = $mainMod, 9, workspace, 9 + #bind = $mainMod, 0, workspace, 10 + + # Move active window to a workspace with mainMod + SHIFT + [0-9] + bind = $mainMod SHIFT, 1, movetoworkspace, 1 + bind = $mainMod SHIFT, 2, movetoworkspace, 2 + bind = $mainMod SHIFT, 3, movetoworkspace, 3 + bind = $mainMod SHIFT, 4, movetoworkspace, 4 + bind = $mainMod SHIFT, 5, movetoworkspace, 5 + bind = $mainMod SHIFT, 6, movetoworkspace, 6 + bind = $mainMod SHIFT, 7, movetoworkspace, 7 + bind = $mainMod SHIFT, 8, movetoworkspace, 8 + bind = $mainMod SHIFT, 9, movetoworkspace, 9 + bind = $mainMod SHIFT, 0, movetoworkspace, 10 + + # Scroll through existing workspaces with mainMod + scroll + bind = $mainMod, mouse_down, workspace, e+1 + bind = $mainMod, mouse_up, workspace, e-1 + + # Move/resize windows with mainMod + LMB/RMB and dragging + bind = $mainMod SHIFT, H, movewindow, l + bind = $mainMod SHIFT, L, movewindow, r + bind = $mainMod SHIFT, K, movewindow, u + bind = $mainMod SHIFT, J, movewindow, d + bind = $mainMod ALT, H, resizeactive, -5% 0 + bind = $mainMod ALT, L, resizeactive, 5% 0 + bind = $mainMod ALT, K, resizeactive, 0 -5% + bind = $mainMod ALT, J, resizeactive, 0 5% + bindm = $mainMod, mouse:272, movewindow + bindm = $mainMod, mouse:273, resizewindow + + # Volume changes + binde = , XF86AudioRaiseVolume, exec, wpctl set-volume -l 1.5 @DEFAULT_AUDIO_SINK@ 1%+ + binde = , XF86AudioLowerVolume, exec, wpctl set-volume -l 1.5 @DEFAULT_AUDIO_SINK@ 1%- + bind = , XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle + + # Passthrough binds + bind = SHIFT CTRL, F12, pass, ^(com.obsproject.Studio)$ + + # Window rules for xwaylandvideobridge + windowrulev2 = opacity 0.0 override 0.0 override,class:^(xwaylandvideobridge)$ + windowrulev2 = noanim,class:^(xwaylandvideobridge)$ + windowrulev2 = nofocus,class:^(xwaylandvideobridge)$ + windowrulev2 = noinitialfocus,class:^(xwaylandvideobridge)$ + + # Rules for windowkill + windowrule = noborder, ^(steam_app_2726450)$ + windowrule = pin, ^(steam_app_2726450)$ + windowrule = opacity 0.9, ^(steam_app_2726450)$ + + # Rules for Awakened PoE + windowrulev2 = tag +poe, class:^(steam_app_238960)$ + windowrulev2 = allowsinput, tag:poe + + windowrulev2 = tag +apt, class:^(awakened-poe-trade)$ + windowrulev2 = float, tag:apt + windowrulev2 = noblur, tag:apt + windowrulev2 = noborder, tag:apt + windowrulev2 = noshadow, tag:apt + ''; } diff --git a/programs/neovim/default.nix b/programs/neovim/default.nix index 212f6be..c078352 100644 --- a/programs/neovim/default.nix +++ b/programs/neovim/default.nix @@ -34,7 +34,7 @@ nixfmt-rfc-style # TypeScript - (callPackage ../vtsls/package.nix { }) + typescript-language-server # Rust rust-analyzer @@ -42,7 +42,7 @@ vscode-extensions.vadimcn.vscode-lldb.adapter # Vue - vscode-extensions.vue.volar + vue-language-server # Svelte nodePackages.svelte-language-server diff --git a/programs/neovim/lua/plugins/astrolsp.lua b/programs/neovim/lua/plugins/astrolsp.lua index 7c28eb8..91af45e 100644 --- a/programs/neovim/lua/plugins/astrolsp.lua +++ b/programs/neovim/lua/plugins/astrolsp.lua @@ -60,7 +60,7 @@ return { "svelte", "taplo", "volar", - "vtsls", + "tsserver", "yamlls", }, -- customize language server configuration options passed to `lspconfig` @@ -72,7 +72,7 @@ return { nixd = { options = { nixos = { - expr = '(builtins.getFlake ("git+file:///home/wizardlink/.system")).nixosConfigurations.nixos.options', + expr = '(builtins.getFlake ("git+file:///home/wizardlink/.system")).nixosConfigurations.wizdesk.options', }, home_manager = { expr = @@ -82,6 +82,22 @@ return { }, }, }, + tsserver = { + init_options = { + plugins = { + { + name = "@vue/typescript-plugin", + location = {}, -- Means we need @vue/typescript-plugin in node_modules + languages = { "javascript", "typescript", "vue" }, + }, + }, + }, + filetypes = { + "javascript", + "typescript", + "vue", + }, + }, }, -- customize how language servers are attached handlers = { diff --git a/programs/neovim/lua/plugins/user.lua b/programs/neovim/lua/plugins/user.lua index ab4500c..8d2abc1 100644 --- a/programs/neovim/lua/plugins/user.lua +++ b/programs/neovim/lua/plugins/user.lua @@ -42,4 +42,7 @@ return { "nvim-treesitter/nvim-treesitter", }, }, + { + "ledger/vim-ledger", + }, }