nix-configs

Personal NixOS and home-manager configuration files
Log | Files | Refs

commit 3e115e785b9bf8dc58681b69719896152cfdc010
parent 28425bb024544c8b8dcc2ec5558a48b754962113
Author: breadcat <breadcat@users.noreply.github.com>
Date:   Thu,  2 Jul 2026 13:54:37 +0100

Initial hyprlang to lua config switch

Merge numlock code into hyprland.nix

Diffstat:
Mhome/clipse.nix | 21+++++++++++----------
Dhome/hyprland-numlock.nix | 8--------
Mhome/hyprland.nix | 281+++++++++++++++++++++++++++++--------------------------------------------------
Mhome/kodi.nix | 10+++++-----
Mmachines/atlas.nix | 3+--
5 files changed, 119 insertions(+), 204 deletions(-)

diff --git a/home/clipse.nix b/home/clipse.nix @@ -4,15 +4,16 @@ enable = true; }; - wayland.windowManager.hyprland.settings = { - bind = [ - "SUPER, V, exec, alacritty --class clipse -e 'clipse'" - ]; - - windowrulev2 = [ - "float,class:(clipse)" - "size 622 652,class:(clipse)" - ]; - }; +# wayland.windowManager.hyprland.settings = { +# bind = [ +# "SUPER, V, exec, alacritty --class clipse -e 'clipse'" +# ]; +# +# windowrule = [ +# "match:class ^(clipse)$, float 1" +# "match:class ^(clipse)$, size 622 652" +# ]; +# +# }; } diff --git a/home/hyprland-numlock.nix b/home/hyprland-numlock.nix @@ -1,8 +0,0 @@ -{ lib, ... }: -{ - wayland.windowManager.hyprland.settings.input = lib.mkMerge [ - { - numlock_by_default = true; - } - ]; -} diff --git a/home/hyprland.nix b/home/hyprland.nix @@ -1,186 +1,109 @@ -{ ... }: +{ lib, machine, vars, ... }: +let + numlockMachines = [ "atlas" ]; numlockEnabled = builtins.elem machine numlockMachines; +in { wayland.windowManager.hyprland = { enable = true; - configType = "hyprlang"; - settings = { - - ecosystem = { - "no_update_news" = true; - "no_donation_nag" = true; - }; - - monitor = ",preferred,auto,auto"; - env = [ - "XCURSOR_SIZE,24" - "HYPRCURSOR_SIZE,24" - ]; - - general = { - gaps_in = 5; - gaps_out = 20; - border_size = 2; - "col.active_border" = "rgba(33ccffee) rgba(00ff99ee) 45deg"; - "col.inactive_border" = "rgba(595959aa)"; - resize_on_border = false; - allow_tearing = false; - layout = "dwindle"; - }; - - cursor = { - inactive_timeout = 3; - }; - - decoration = { - rounding = 5; - active_opacity = 1.0; - inactive_opacity = 1.0; - shadow = { - enabled = true; - range = 4; - render_power = 3; - color = "rgba(1a1a1aee)"; - }; - blur = { - enabled = true; - size = 3; - passes = 1; - vibrancy = 0.1696; - }; - }; - - animations = { - enabled = true; - bezier = [ - "easeOutQuint,0.23,1,0.32,1" - "easeInOutCubic,0.65,0.05,0.36,1" - "linear,0,0,1,1" - "almostLinear,0.5,0.5,0.75,1.0" - "quick,0.15,0,0.1,1" - ]; - animation = [ - "global, 1, 10, default" - "border, 1, 5.39, easeOutQuint" - "windows, 1, 4.79, easeOutQuint" - "windowsIn, 1, 4.1, easeOutQuint, popin 87%" - "windowsOut, 1, 1.49, linear, popin 87%" - "fadeIn, 1, 1.73, almostLinear" - "fadeOut, 1, 1.46, almostLinear" - "fade, 1, 3.03, quick" - "layers, 1, 3.81, easeOutQuint" - "layersIn, 1, 4, easeOutQuint, fade" - "layersOut, 1, 1.5, linear, fade" - "fadeLayersIn, 1, 1.79, almostLinear" - "fadeLayersOut, 1, 1.39, almostLinear" - "workspaces, 1, 1.94, almostLinear, fade" - "workspacesIn, 1, 1.21, almostLinear, fade" - "workspacesOut, 1, 1.94, almostLinear, fade" - ]; - }; - - dwindle = { - pseudotile = true; - preserve_split = true; - workspace = [ - "w[tv1], gapsout:0, gapsin:0" - "f[1], gapsout:0, gapsin:0" - ]; - windowrulev2 = [ - "bordersize 0, floating:0, onworkspace:w[tv1]" - "rounding 0, floating:0, onworkspace:w[tv1]" - "bordersize 0, floating:0, onworkspace:f[1]" - "rounding 0, floating:0, onworkspace:f[1]" - ]; - }; - - master = { - new_status = "master"; - }; - - misc = { - force_default_wallpaper = 0; - disable_hyprland_logo = true; - }; - - input = { - kb_layout = "gb"; - kb_options = "caps:backspace"; - follow_mouse = 1; - sensitivity = 0; - touchpad = { - natural_scroll = false; - }; - }; - - bind = [ - "SUPER, R, exec, tofi-run | xargs hyprctl dispatch exec --" - "SUPER, W, exec, chromium" - "SUPER, T, exec, alacritty" - "SUPER_SHIFT, W, exec, chromium --incognito" - "ALT, Tab, cyclenext" - "ALT SHIFT, Tab, cyclenext, prev" - "SUPER, RETURN, exec, alacritty" - "SUPER_SHIFT, Q, killactive," - "SUPER, X, exit," - "SUPER, E, exec, alacritty -e lf" - "SUPER, Space, togglefloating," - "SUPER, F, fullscreen," - "SUPER, P, pseudo," - "SUPER, J, togglesplit," - "SUPER, left, movefocus, l" - "SUPER, right, movefocus, r" - "SUPER, up, movefocus, u" - "SUPER, down, movefocus, d" - "SUPER, mouse_down, workspace, e+1" - "SUPER, mouse_up, workspace, e-1" - ", Print, exec, grim" - "ALT, Print, exec, grim -g ''\"$(slurp)\"" - ] ++ ( builtins.concatLists (builtins.genList (i: - let ws = i + 1; in [ - "SUPER, code:1${toString i}, workspace, ${toString ws}" - "SUPER SHIFT, code:1${toString i}, movetoworkspace, ${toString ws}" - ] ) 9) - ); - - bindm = [ - "ALT, mouse:272, movewindow" - "ALT, mouse:273, resizewindow" - ]; - - bindel = [ - ",XF86AudioRaiseVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+" - ",XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-" - ",XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle" - ",XF86AudioMicMute, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle" - ",XF86MonBrightnessUp, exec, brightnessctl s 10%+" - ",XF86MonBrightnessDown, exec, brightnessctl s 10%-" - "CONTROL_ALT, equal, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+" - "CONTROL_ALT, minus, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-" - ]; - - bindl = [ - ", XF86AudioNext, exec, playerctl next" - ", XF86AudioPause, exec, playerctl play-pause" - ", XF86AudioPlay, exec, playerctl play-pause" - ", XF86AudioPrev, exec, playerctl previous" - ]; - - windowrulev2 = [ - "suppressevent maximize, class:.*" - "nofocus,class:^$,title:^$,xwayland:1,floating:1,fullscreen:0,pinned:0" - ]; - }; + configType = "lua"; + extraConfig = '' + -- General + hl.config({ + general={gaps_in=5,gaps_out=20,border_size=2,col={active_border={colors={"rgba(33ccffee)","rgba(00ff99ee)"},angle=45},inactive_border="rgba(595959aa)"},resize_on_border=false,allow_tearing=false,layout="dwindle"}, + decoration={rounding=10,rounding_power=2,active_opacity=1.0,inactive_opacity=1.0,shadow={enabled=true,range=4,render_power=3,color=0xee1a1a1a},blur={enabled=true,size=3,passes=1,vibrancy=0.1696}}, + animations={enabled=true} + }) + -- Animations + 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} } }) + hl.curve("easy", { type = "spring", mass = 1, stiffness = 71.2633, dampening = 15.8273644 }) + 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, spring = "easy" }) + hl.animation({ leaf = "windowsIn", enabled = true, speed = 4.1, spring = "easy", style = "popin 87%" }) + hl.animation({ leaf = "windowsOut", enabled = true, speed = 1.49, bezier = "linear", style = "popin 87%" }) + 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 = "fade" }) + hl.animation({ leaf = "workspacesIn", enabled = true, speed = 1.21, bezier = "almostLinear", style = "fade" }) + hl.animation({ leaf = "workspacesOut", enabled = true, speed = 1.94, bezier = "almostLinear", style = "fade" }) + hl.animation({ leaf = "zoomFactor", enabled = true, speed = 7, bezier = "quick" }) + -- Monitors + hl.monitor({output="",mode="preferred",position="auto",scale="auto"}) + -- Environment + hl.env("XCURSOR_SIZE", "24") + hl.env("HYPRCURSOR_SIZE", "24") + -- Layouts + hl.config({dwindle={preserve_split=true}}) + hl.config({master={new_status="master"}}) + hl.config({scrolling={fullscreen_on_one_column=true}}) + -- Misc + hl.config({misc={force_default_wallpaper=0,disable_hyprland_logo=true,disable_splash_rendering=true}}) + -- Input + hl.config({input={numlock_by_default=${lib.boolToString numlockEnabled},kb_layout="gb",kb_options="caps:backspace",follow_mouse=1,sensitivity=0,touchpad={natural_scroll=false}}}) + -- Launch binds + hl.bind("SUPER + RETURN", hl.dsp.exec_cmd("alacritty")) + hl.bind("SUPER + W", hl.dsp.exec_cmd("chromium")) + hl.bind("SUPER + SHIFT + W", hl.dsp.exec_cmd("chromium --incognito")) + hl.bind("SUPER + R", hl.dsp.exec_cmd("tofi-run | xargs -I{} sh -c '{}'")) + hl.bind("ALT + Tab", hl.dsp.window.cycle_next()) + hl.bind("ALT + SHIFT + Tab", hl.dsp.window.cycle_next({ next = false })) + hl.bind("SUPER + SHIFT + Q", hl.dsp.window.close()) + hl.bind("SUPER + E", hl.dsp.exec_cmd("alacritty -e lf")) + -- WM controls + hl.bind("SUPER + Space", hl.dsp.window.float({ action = "toggle" })) + hl.bind("SUPER + F", hl.dsp.window.fullscreen()) + hl.bind("SUPER + P", hl.dsp.window.pseudo()) + hl.bind("SUPER + J", hl.dsp.layout("togglesplit")) -- dwindle only + hl.bind("SUPER + left", hl.dsp.focus({ direction = "left" })) + hl.bind("SUPER + right", hl.dsp.focus({ direction = "right" })) + hl.bind("SUPER + up", hl.dsp.focus({ direction = "up" })) + hl.bind("SUPER + down", hl.dsp.focus({ direction = "down" })) + for a=1,10 do local b=a%10; + hl.bind("SUPER + "..b,hl.dsp.focus({workspace=a})) + hl.bind("SUPER + SHIFT + "..b,hl.dsp.window.move({workspace=a})) + end + hl.bind("ALT + mouse:272", hl.dsp.window.drag(), { mouse = true }) + hl.bind("ALT + mouse:273", hl.dsp.window.resize(), { mouse = true }) + -- Media binds + hl.bind("XF86AudioRaiseVolume", hl.dsp.exec_cmd("wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 5%+"), { locked = true, repeating = true }) + hl.bind("XF86AudioLowerVolume", hl.dsp.exec_cmd("wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"), { locked = true, repeating = true }) + hl.bind("XF86AudioMute", hl.dsp.exec_cmd("wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"), { locked = true, repeating = true }) + hl.bind("XF86AudioMicMute", hl.dsp.exec_cmd("wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle"), { locked = true, repeating = true }) + hl.bind("XF86MonBrightnessUp", hl.dsp.exec_cmd("brightnessctl -e4 -n2 set 5%+"), { locked = true, repeating = true }) + hl.bind("XF86MonBrightnessDown",hl.dsp.exec_cmd("brightnessctl -e4 -n2 set 5%-"), { locked = true, repeating = true }) + hl.bind("XF86AudioNext", hl.dsp.exec_cmd("playerctl next"), { locked = true }) + hl.bind("XF86AudioPause", hl.dsp.exec_cmd("playerctl play-pause"), { locked = true }) + hl.bind("XF86AudioPlay", hl.dsp.exec_cmd("playerctl play-pause"), { locked = true }) + hl.bind("XF86AudioPrev", hl.dsp.exec_cmd("playerctl previous"), { locked = true }) + -- Smart gaps + hl.workspace_rule({ workspace = "w[tv1]", gaps_out = 0, gaps_in = 0 }) + hl.workspace_rule({ workspace = "f[1]", gaps_out = 0, gaps_in = 0 }) + hl.window_rule({ match = { float = false, workspace = "w[tv1]" }, border_size = 0 }) + hl.window_rule({ match = { float = false, workspace = "w[tv1]" }, rounding = 0 }) + hl.window_rule({ match = { float = false, workspace = "f[1]" }, border_size = 0 }) + hl.window_rule({ match = { float = false, workspace = "f[1]" }, rounding = 0 }) + -- Ignore maximize requests from all apps + hl.window_rule({name="suppress-maximize-events",match={class=".*"},suppress_event="maximize"}) + -- Fix XWayland dragging issues + hl.window_rule({name="fix-xwayland-drags",match={class="^$",title="^$",xwayland=true,float=true,fullscreen=false,pin=false},no_focus=true}) + ''; }; - programs.fish = { - interactiveShellInit = '' - set -gx HYPRPATH (whereis Hyprland | awk '{print $NF}') - if test (tty) = "/dev/tty1"; exec $HYPRPATH; end - ''; - }; + dconf.enable = true; - dconf = { - enable = true; - }; - } + programs.fish.interactiveShellInit = '' + if test (tty) = "/dev/tty1"; exec start-hyprland; end + ''; + +} diff --git a/home/kodi.nix b/home/kodi.nix @@ -58,9 +58,9 @@ }; }; # Launch Kodi via Hyprland - wayland.windowManager.hyprland = { - settings = { - "exec-once" = "${pkgs.kodi-wayland}/bin/kodi-standalone -fullscreen"; - }; - }; +# wayland.windowManager.hyprland = { +# settings = { +# "exec-once" = "${pkgs.kodi-wayland}/bin/kodi-standalone -fullscreen"; +# }; +# }; } diff --git a/machines/atlas.nix b/machines/atlas.nix @@ -2,7 +2,7 @@ { config, pkgs, lib, vars, ... }: -let machine = "atlas"; in { +{ imports = [ ../common/audio.nix @@ -45,7 +45,6 @@ let machine = "atlas"; in { ../home/github-desktop.nix ../home/htop.nix ../home/hypridle.nix - ../home/hyprland-numlock.nix ../home/hyprland.nix ../home/iamb.nix ../home/lf.nix