From 5c6b231f56daf685d7647ee3865d45aedd10be5f Mon Sep 17 00:00:00 2001 From: nyxerinys Date: Sun, 11 Oct 2026 00:41:57 -0500 Subject: [PATCH] more readable format --- modules/home/nyxerinys/linux/default.nix | 2 +- modules/home/nyxerinys/linux/hyprland.nix | 117 ------------------ .../home/nyxerinys/linux/hyprland/binds.nix | 62 ++++++++++ .../home/nyxerinys/linux/hyprland/default.nix | 63 ++++++++++ 4 files changed, 126 insertions(+), 118 deletions(-) delete mode 100644 modules/home/nyxerinys/linux/hyprland.nix create mode 100644 modules/home/nyxerinys/linux/hyprland/binds.nix create mode 100644 modules/home/nyxerinys/linux/hyprland/default.nix diff --git a/modules/home/nyxerinys/linux/default.nix b/modules/home/nyxerinys/linux/default.nix index 6a6447a..343b789 100644 --- a/modules/home/nyxerinys/linux/default.nix +++ b/modules/home/nyxerinys/linux/default.nix @@ -2,5 +2,5 @@ { imports = [] - ++ lib.optionals osConfig.programs.hyprland.enable [ ./hyprland.nix ]; + ++ lib.optionals osConfig.programs.hyprland.enable [ ./hyprland ]; } \ No newline at end of file diff --git a/modules/home/nyxerinys/linux/hyprland.nix b/modules/home/nyxerinys/linux/hyprland.nix deleted file mode 100644 index 180ed46..0000000 --- a/modules/home/nyxerinys/linux/hyprland.nix +++ /dev/null @@ -1,117 +0,0 @@ -{ inputs, lib, ... }: - -{ - xdg.configFile."hypr/plugins/split-monitor-workspaces".source = inputs.split-monitor-workspaces; - wayland.windowManager.hyprland = { - enable = true; - # set the Hyprland and XDPH packages to null to use the ones from the NixOS module - package = null; - portalPackage = null; - systemd.variables = ["--all"]; - # extraLuaFiles = { - # smw-setup = { - # content = '' - # local smw = require('plugins.split-monitor-workspaces') - # smw.setup({ - # workspace_count = 5 - # }) - # ''; - # }; - # }; - settings = { - smw = { - _var = (lib.generators.mkLuaInline "require('plugins.split-monitor-workspaces')"); - }; - monitor = [ - { - output = "DP-1"; - mode = "highres@highrr"; - position = "0x0"; - scale = 1; - } - { - output = "DP-2"; - mode = "1680x1050@60"; - position = "auto-center-right"; - scale = 1; - } - { - output = "HDMI-A-1"; - mode = "1920x1080@60"; - position = "-1920x720"; - scale = 1; - } - { - output = "DP-3"; - disabled = true; - } - { - output = ""; - mode = "highres@highrr"; - position = "auto"; - scale = 1; - } - ]; - bind = let - mainMod = "SUPER"; - in [ - { - _args = [ - "${mainMod} + c" - (lib.generators.mkLuaInline ''hl.dsp.exec_cmd("kitty")'') - ]; - } - { - _args = [ - "${mainMod} + e" - (lib.generators.mkLuaInline ''hl.dsp.exec_cmd("nautilus")'') - ]; - } - { - _args = [ - "${mainMod} + q" - (lib.generators.mkLuaInline ''hl.dsp.window.close()'') - { locked = true; } - ]; - } - { - _args = [ - "${mainMod} + s" - (lib.generators.mkLuaInline ''hl.dsp.workspace.toggle_special("special")'') - ]; - } - { - _args = [ - "${mainMod} + SHIFT + s" - (lib.generators.mkLuaInline ''hl.dsp.window.move({ workspace = "special:special", follow = true })'') - ]; - } - { - _args = [ - "${mainMod} + mouse:272" - (lib.generators.mkLuaInline ''hl.dsp.window.drag()'') - { mouse = true; } - ]; - } - { - _args = [ - "${mainMod} + mouse:273" - (lib.generators.mkLuaInline ''hl.dsp.window.resize()'') - { mouse = true; } - ]; - } - { - _args = [ - "${mainMod} + f" - (lib.generators.mkLuaInline ''hl.dsp.window.fullscreen({mode = "fullscreen", action = "toggle"})'') - ]; - } - ]; - }; - extraConfig = '' - smw.setup({ - workspace_count = 5 - }) - ''; - }; -} \ No newline at end of file diff --git a/modules/home/nyxerinys/linux/hyprland/binds.nix b/modules/home/nyxerinys/linux/hyprland/binds.nix new file mode 100644 index 0000000..0bd11bf --- /dev/null +++ b/modules/home/nyxerinys/linux/hyprland/binds.nix @@ -0,0 +1,62 @@ +{ lib, ... }: +let + mainMod = "SUPER"; + appBinds = [ + { + _args = [ + "${mainMod} + c" + (lib.generators.mkLuaInline ''hl.dsp.exec_cmd("kitty")'') + ]; + } + { + _args = [ + "${mainMod} + e" + (lib.generators.mkLuaInline ''hl.dsp.exec_cmd("nautilus")'') + ]; + } + { + _args = [ + "${mainMod} + q" + (lib.generators.mkLuaInline ''hl.dsp.window.close()'') + ]; + } + ]; + windowBinds = [ + { + _args = [ + "${mainMod} + s" + (lib.generators.mkLuaInline ''hl.dsp.workspace.toggle_special("special")'') + ]; + } + { + _args = [ + "${mainMod} + SHIFT + s" + (lib.generators.mkLuaInline ''hl.dsp.window.move({ workspace = "special:special", follow = true })'') + ]; + } + { + _args = [ + "${mainMod} + mouse:272" + (lib.generators.mkLuaInline ''hl.dsp.window.drag()'') + { mouse = true; } + ]; + } + { + _args = [ + "${mainMod} + mouse:273" + (lib.generators.mkLuaInline ''hl.dsp.window.resize()'') + { mouse = true; } + ]; + } + { + _args = [ + "${mainMod} + f" + (lib.generators.mkLuaInline ''hl.dsp.window.fullscreen({mode = "fullscreen", action = "toggle"})'') + ]; + } + ]; +in + builtins.concatLists [ + appBinds + windowBinds + ] \ No newline at end of file diff --git a/modules/home/nyxerinys/linux/hyprland/default.nix b/modules/home/nyxerinys/linux/hyprland/default.nix new file mode 100644 index 0000000..1386db2 --- /dev/null +++ b/modules/home/nyxerinys/linux/hyprland/default.nix @@ -0,0 +1,63 @@ +args@{ inputs, lib, ... }: + +{ + xdg.configFile."hypr/plugins/split-monitor-workspaces".source = inputs.split-monitor-workspaces; + wayland.windowManager.hyprland = { + enable = true; + # set the Hyprland and XDPH packages to null to use the ones from the NixOS module + package = null; + portalPackage = null; + systemd.variables = ["--all"]; + # extraLuaFiles = { + # smw-setup = { + # content = '' + # local smw = require('plugins.split-monitor-workspaces') + # smw.setup({ + # workspace_count = 5 + # }) + # ''; + # }; + # }; + settings = { + smw = { + _var = (lib.generators.mkLuaInline "require('plugins.split-monitor-workspaces')"); + }; + monitor = [ + { + output = "DP-1"; + mode = "highres@highrr"; + position = "0x0"; + scale = 1; + } + { + output = "DP-2"; + mode = "1680x1050@60"; + position = "auto-center-right"; + scale = 1; + } + { + output = "HDMI-A-1"; + mode = "1920x1080@60"; + position = "-1920x720"; + scale = 1; + } + { + output = "DP-3"; + disabled = true; + } + { + output = ""; + mode = "highres@highrr"; + position = "auto"; + scale = 1; + } + ]; + bind = import ./binds.nix args + }; + extraConfig = '' + smw.setup({ + workspace_count = 5 + }) + ''; + }; +} \ No newline at end of file