diff --git a/hosts/monolith.nix b/hosts/monolith.nix index b217f73..2e33fd8 100644 --- a/hosts/monolith.nix +++ b/hosts/monolith.nix @@ -40,7 +40,6 @@ in "zenpower" ]; boot.kernelParams = [ - "amdgpu.dcdebugmask=0x10" # amdgpu undervolting bug "video=DP-1:1920x1080@144" # hibernation "resume=LABEL=BTRFS_ROOT" # findmnt -o LABEL --noheadings /swap/ @@ -64,14 +63,6 @@ in rocmPackages.rocm-smi ]; - programs.corectrl = { - enable = true; - gpuOverclock = { - enable = true; - ppfeaturemask = "0xffffffff"; - }; - }; - fileSystems."/" = { device = "/dev/disk/by-label/BTRFS_ROOT"; fsType = "btrfs"; diff --git a/overlays/default.nix b/overlays/default.nix index 14257ba..8d4046b 100644 --- a/overlays/default.nix +++ b/overlays/default.nix @@ -6,7 +6,6 @@ rec { themes new-packages patches - variables lib_extended ]; @@ -80,8 +79,6 @@ rec { } ); - variables = (final: prev: { uservars = import ../user/variables.nix; }); - lib_extended = ( final: prev: { lib = prev.lib // rec { diff --git a/scripts/default.nix b/scripts/default.nix index 12d38d3..1ed6e0c 100644 --- a/scripts/default.nix +++ b/scripts/default.nix @@ -126,6 +126,7 @@ wl-clipboard ]; auto_connect_gamepad = [ bluez ]; + vrr-fullscreen = [ ]; } // lib.mapAttrs import_script { wdmenu = ./wdmenu.nix; diff --git a/scripts/vrr-fullscreen b/scripts/vrr-fullscreen new file mode 100755 index 0000000..8413923 --- /dev/null +++ b/scripts/vrr-fullscreen @@ -0,0 +1,28 @@ +#!/usr/bin/env bash + +# List of supported outputs for VRR +output_vrr_whitelist=( + "DP-1" + "DP-2" +) + +# Toggle VRR for fullscreened apps in prespecified displays to avoid stutters while in desktop +swaymsg -t subscribe -m '[ "window" ]' | while read window_json; do + window_event=$(echo ${window_json} | jq -r '.change') + + # Process only focus change and fullscreen toggle + if [[ $window_event = "focus" || $window_event = "fullscreen_mode" ]]; then + output_json=$(swaymsg -t get_outputs | jq -r '.[] | select(.focused == true)') + output_name=$(echo ${output_json} | jq -r '.name') + + # Use only VRR in whitelisted outputs + if [[ ${output_vrr_whitelist[*]} =~ ${output_name} ]]; then + output_vrr_status=$(echo ${output_json} | jq -r '.adaptive_sync_status') + window_fullscreen_status=$(echo ${window_json} | jq -r '.container.fullscreen_mode') + + # Only update output if nesseccary to avoid flickering + [[ $output_vrr_status = "disabled" && $window_fullscreen_status = "1" ]] && swaymsg output "${output_name}" adaptive_sync 1 + [[ $output_vrr_status = "enabled" && $window_fullscreen_status = "0" ]] && swaymsg output "${output_name}" adaptive_sync 0 + fi + fi +done diff --git a/scripts/wdmenu.nix b/scripts/wdmenu.nix index 85fb6fc..3505781 100644 --- a/scripts/wdmenu.nix +++ b/scripts/wdmenu.nix @@ -1,12 +1,4 @@ { pkgs, ... }: -let - inherit (pkgs.uservars) dmenu; - available_menus = { - bmenu = "bmenu"; - rofi = "rofi -dmenu -sort"; - }; - menu_cmd = available_menus.${dmenu}; -in pkgs.writeShellScriptBin "wdmenu" '' - exec ${menu_cmd} "$@" + exec bmenu "$@" '' diff --git a/scripts/wfile-picker.nix b/scripts/wfile-picker.nix index eb68752..d8ced8a 100644 --- a/scripts/wfile-picker.nix +++ b/scripts/wfile-picker.nix @@ -1,6 +1,6 @@ { pkgs, ... }: let - inherit (pkgs.uservars) dmenu; + inherit (config.my) dmenu; available_menus = { bmenu = "bmenu run"; rofi = "rofi -show drun -sort"; diff --git a/scripts/wlauncher.nix b/scripts/wlauncher.nix index eb68752..d2c2dec 100644 --- a/scripts/wlauncher.nix +++ b/scripts/wlauncher.nix @@ -1,12 +1,4 @@ { pkgs, ... }: -let - inherit (pkgs.uservars) dmenu; - available_menus = { - bmenu = "bmenu run"; - rofi = "rofi -show drun -sort"; - }; - menu_cmd = available_menus.${dmenu}; -in pkgs.writeShellScriptBin "wlauncher" '' - exec ${menu_cmd} "$@" + exec bmenu run "$@" '' diff --git a/settings/default.nix b/settings/default.nix new file mode 100644 index 0000000..2a2ca08 --- /dev/null +++ b/settings/default.nix @@ -0,0 +1,6 @@ +{ lib, ... }: +{ + options = { + my = lib.mkOption { }; + }; +} diff --git a/system/boot.nix b/system/boot.nix index 81d838e..fa1ed8d 100644 --- a/system/boot.nix +++ b/system/boot.nix @@ -43,7 +43,7 @@ }; plymouth = { enable = true; - theme = lib.mkIf (pkgs.uservars.desktop == "sway") "red_loader"; + theme = lib.mkIf (config.my.desktop == "sway") "red_loader"; themePackages = with pkgs; [ (adi1090x-plymouth-themes.override { selected_themes = [ "red_loader" ]; }) ]; diff --git a/system/configuration.nix b/system/configuration.nix index 8054fa9..6661e40 100644 --- a/system/configuration.nix +++ b/system/configuration.nix @@ -22,9 +22,10 @@ ./users.nix ./containers.nix ./network.nix + ../settings ]; - boot.kernelPackages = pkgs.linuxPackages_latest; + my = import ../user/variables.nix; zramSwap.enable = true; diff --git a/system/greetd.nix b/system/greetd.nix index 6bc6297..b152c72 100644 --- a/system/greetd.nix +++ b/system/greetd.nix @@ -5,7 +5,7 @@ ... }: let - inherit (pkgs.uservars) + inherit (config.my) key accent font @@ -71,7 +71,7 @@ in enable = true; settings = { initial_session = { - command = "${pkgs.sway}/bin/sway"; + command = desktop; user = "lelgenio"; }; default_session = { diff --git a/user/alacritty.nix b/user/alacritty.nix index ae2e2fb..91b98c0 100644 --- a/user/alacritty.nix +++ b/user/alacritty.nix @@ -5,7 +5,7 @@ ... }: let - inherit (pkgs.uservars) + inherit (config.my) key theme accent diff --git a/user/bmenu.nix b/user/bmenu.nix index 38c36c6..1543dcf 100644 --- a/user/bmenu.nix +++ b/user/bmenu.nix @@ -6,7 +6,7 @@ ... }: let - inherit (pkgs.uservars) + inherit (config.my) key theme accent diff --git a/user/firefox.nix b/user/firefox.nix index 4c442e3..207ebb6 100644 --- a/user/firefox.nix +++ b/user/firefox.nix @@ -6,7 +6,7 @@ ... }: let - inherit (pkgs.uservars) desktop browser; + inherit (config.my) desktop browser; bugfixedFirefox = pkgs.firefox-esr-unwrapped // { requireSigning = false; allowAddonSideload = true; diff --git a/user/fish/default.nix b/user/fish/default.nix index 07ba4c2..aef7fd5 100644 --- a/user/fish/default.nix +++ b/user/fish/default.nix @@ -5,15 +5,7 @@ ... }: let - inherit (pkgs.uservars) - key - theme - color - accent - font - editor - desktop - ; + inherit (config.my) accent editor desktop; in { config = { diff --git a/user/fzf.nix b/user/fzf.nix index a4113fa..df16adb 100644 --- a/user/fzf.nix +++ b/user/fzf.nix @@ -6,7 +6,7 @@ ... }: let - inherit (pkgs.uservars) + inherit (config.my) key theme accent diff --git a/user/git.nix b/user/git.nix index f50a249..94532f3 100644 --- a/user/git.nix +++ b/user/git.nix @@ -5,7 +5,7 @@ ... }: let - inherit (pkgs.uservars) username mail; + inherit (config.my) username mail; in { config = { diff --git a/user/gnome.nix b/user/gnome.nix index d7282dc..53dd630 100644 --- a/user/gnome.nix +++ b/user/gnome.nix @@ -2,9 +2,10 @@ pkgs, lib, inputs, + config, ... }: -lib.mkIf (pkgs.uservars.desktop == "gnome") { +lib.mkIf (config.my.desktop == "gnome") { home.pointerCursor = { name = "Adwaita"; diff --git a/user/helix.nix b/user/helix.nix index 292cfb0..b711055 100644 --- a/user/helix.nix +++ b/user/helix.nix @@ -1,6 +1,11 @@ -{ pkgs, lib, ... }: +{ + pkgs, + lib, + config, + ... +}: let - inherit (pkgs.uservars) accent theme editor; + inherit (config.my) accent theme editor; inherit (theme) color; in { diff --git a/user/home.nix b/user/home.nix index 8453572..e482406 100644 --- a/user/home.nix +++ b/user/home.nix @@ -44,8 +44,11 @@ ./xdg-dirs.nix inputs.hyprland.homeManagerModules.default inputs.nix-index-database.hmModules.nix-index + ../settings ]; + my = import ./variables.nix; + # Home Manager needs a bit of information about you and the # paths it should manage. home.username = "lelgenio"; diff --git a/user/hyprland.nix b/user/hyprland.nix index e1a632b..721e14b 100644 --- a/user/hyprland.nix +++ b/user/hyprland.nix @@ -5,7 +5,7 @@ ... }: { - config = lib.mkIf (pkgs.uservars.desktop == "hyprland") { + config = lib.mkIf (config.my.desktop == "hyprland") { wayland.windowManager.hyprland = { enable = false; extraConfig = '' diff --git a/user/kakoune/default.nix b/user/kakoune/default.nix index 091fe1b..ebb17f5 100644 --- a/user/kakoune/default.nix +++ b/user/kakoune/default.nix @@ -5,7 +5,7 @@ ... }: let - inherit (pkgs.uservars) + inherit (config.my) key dmenu editor diff --git a/user/man.nix b/user/man.nix index c77607e..cc56089 100644 --- a/user/man.nix +++ b/user/man.nix @@ -6,7 +6,7 @@ ... }: let - inherit (pkgs.uservars) + inherit (config.my) key theme color diff --git a/user/mangohud.nix b/user/mangohud.nix index f43564f..440b750 100644 --- a/user/mangohud.nix +++ b/user/mangohud.nix @@ -6,7 +6,7 @@ ... }: let - inherit (pkgs.uservars) + inherit (config.my) key theme color diff --git a/user/mimeapps.nix b/user/mimeapps.nix index ff39ea4..a5ddae6 100644 --- a/user/mimeapps.nix +++ b/user/mimeapps.nix @@ -6,7 +6,7 @@ ... }: let - inherit (pkgs.uservars) browser; + inherit (config.my) browser; cfg = config.xdg.defaultApplications; in { diff --git a/user/mpd.nix b/user/mpd.nix index 8a4c155..f4cca16 100644 --- a/user/mpd.nix +++ b/user/mpd.nix @@ -5,7 +5,7 @@ ... }: { - config = lib.mkIf (pkgs.uservars.desktop != "gnome") { + config = lib.mkIf (config.my.desktop != "gnome") { services.mpd = { enable = true; musicDirectory = config.home.homeDirectory + "/Música"; diff --git a/user/pqiv.nix b/user/pqiv.nix index 10e6c3d..70cf9de 100644 --- a/user/pqiv.nix +++ b/user/pqiv.nix @@ -6,7 +6,7 @@ ... }: let - inherit (pkgs.uservars) + inherit (config.my) key theme color diff --git a/user/rofi.nix b/user/rofi.nix index 79307eb..c24a0ce 100644 --- a/user/rofi.nix +++ b/user/rofi.nix @@ -6,7 +6,7 @@ ... }: let - inherit (pkgs.uservars) + inherit (config.my) key theme accent diff --git a/user/ssh.nix b/user/ssh.nix index 3193876..60649ba 100644 --- a/user/ssh.nix +++ b/user/ssh.nix @@ -5,7 +5,7 @@ ... }: let - inherit (pkgs.uservars) username mail; + inherit (config.my) username mail; in { config = { diff --git a/user/sway/default.nix b/user/sway/default.nix index d7afafd..d98b0d7 100644 --- a/user/sway/default.nix +++ b/user/sway/default.nix @@ -5,7 +5,7 @@ ... }: let - inherit (pkgs.uservars) + inherit (config.my) key accent font @@ -24,7 +24,7 @@ in ./swaylock.nix ./theme.nix ]; - config = lib.mkIf (pkgs.uservars.desktop == "sway") { + config = lib.mkIf (config.my.desktop == "sway") { services.mako.enable = true; services.swayidle.enable = true; services.kanshi.enable = true; @@ -69,7 +69,7 @@ in }; output = { "*" = { - adaptive_sync = "enabled"; + adaptive_sync = "off"; bg = "${theme.background} fill"; mode = "1920x1080@144.000Hz"; }; @@ -104,7 +104,6 @@ in exec ${pkgs.dbus-sway-environment}/bin/dbus-sway-environment exec swaymsg workspace 2 exec_always systemctl --user restart waybar.service - exec corectrl --minimize-systray ''; }; services.gammastep = { @@ -117,6 +116,21 @@ in indicator = true; }; + systemd.user.services.vrr-fullscreen = { + Unit = { + Description = "Enable VRR for fullscreen windows"; + PartOf = [ "graphical-session.target" ]; + After = [ "graphical-session.target" ]; + }; + Service = { + ExecStart = "${lib.getExe pkgs.vrr-fullscreen}"; + Restart = "on-failure"; + }; + Install = { + WantedBy = [ "sway-session.target" ]; + }; + }; + xdg.configFile."OpenTabletDriver/settings.json".source = ./open-tablet-driver.json; home.packages = with pkgs; [ diff --git a/user/sway/kanshi.nix b/user/sway/kanshi.nix index f35fd4f..c0a584b 100644 --- a/user/sway/kanshi.nix +++ b/user/sway/kanshi.nix @@ -5,7 +5,7 @@ ... }: let - inherit (pkgs.uservars) + inherit (config.my) key accent font diff --git a/user/sway/mako.nix b/user/sway/mako.nix index c8575ab..4f43734 100644 --- a/user/sway/mako.nix +++ b/user/sway/mako.nix @@ -5,7 +5,7 @@ ... }: let - inherit (pkgs.uservars) + inherit (config.my) key accent font diff --git a/user/sway/sway-assigns.nix b/user/sway/sway-assigns.nix index 5ad5473..3822a22 100644 --- a/user/sway/sway-assigns.nix +++ b/user/sway/sway-assigns.nix @@ -1,7 +1,7 @@ { config, pkgs, ... }: let in -# inherit (pkgs.uservars) key accent font theme; +# inherit (config.my) key accent font theme; # inherit (theme) color; # inherit (pkgs) lib; # mod = "Mod4"; diff --git a/user/sway/sway-binds.nix b/user/sway/sway-binds.nix index fe22594..543de59 100644 --- a/user/sway/sway-binds.nix +++ b/user/sway/sway-binds.nix @@ -1,6 +1,6 @@ { config, pkgs, ... }: let - inherit (pkgs.uservars) + inherit (config.my) key accent font diff --git a/user/sway/sway-modes.nix b/user/sway/sway-modes.nix index ea75ca8..cc3efff 100644 --- a/user/sway/sway-modes.nix +++ b/user/sway/sway-modes.nix @@ -1,6 +1,6 @@ { config, pkgs, ... }: let - inherit (pkgs.uservars) + inherit (config.my) key accent font diff --git a/user/sway/swayidle.nix b/user/sway/swayidle.nix index b0bd455..2c5384f 100644 --- a/user/sway/swayidle.nix +++ b/user/sway/swayidle.nix @@ -5,7 +5,7 @@ ... }: let - inherit (pkgs.uservars) + inherit (config.my) key accent font diff --git a/user/sway/swaylock.nix b/user/sway/swaylock.nix index eb6104e..e46b5d9 100644 --- a/user/sway/swaylock.nix +++ b/user/sway/swaylock.nix @@ -5,7 +5,7 @@ ... }: let - inherit (pkgs.uservars) + inherit (config.my) key accent font diff --git a/user/sway/theme.nix b/user/sway/theme.nix index 202eaff..ca4ea76 100644 --- a/user/sway/theme.nix +++ b/user/sway/theme.nix @@ -6,7 +6,7 @@ ... }: let - inherit (pkgs.uservars) theme font desktop; + inherit (config.my) theme font desktop; inherit (theme) color gtk_theme diff --git a/user/vdir.nix b/user/vdir.nix index 80e6145..02aa2b6 100644 --- a/user/vdir.nix +++ b/user/vdir.nix @@ -1,6 +1,11 @@ -{ pkgs, lib, ... }: +{ + pkgs, + lib, + config, + ... +}: let - inherit (pkgs.uservars) nextcloud; + inherit (config.my) nextcloud; pass_cmd = ( pkgs.writeShellScript "get_pass" '' pass "${nextcloud.pass}" | head -n1 diff --git a/user/waybar/default.nix b/user/waybar/default.nix index 95615fa..d2dc661 100644 --- a/user/waybar/default.nix +++ b/user/waybar/default.nix @@ -7,7 +7,7 @@ ... }: let - inherit (pkgs.uservars) + inherit (config.my) key theme accent @@ -137,7 +137,7 @@ in { format = "{stateIcon} {title} - {artist}"; format-paused = "{stateIcon}"; - format-stopped = ""; + format-stopped = "{stateIcon}"; state-icons = { stopped = ""; paused = ""; diff --git a/user/zathura.nix b/user/zathura.nix index ccb4c42..70e1c23 100644 --- a/user/zathura.nix +++ b/user/zathura.nix @@ -6,7 +6,7 @@ ... }: let - inherit (pkgs.uservars) + inherit (config.my) key accent font