From 4987add501aa22c19a900286f03b98a7ad4d7111 Mon Sep 17 00:00:00 2001 From: Henry Sipp Date: Sat, 28 Jun 2025 18:13:08 -0500 Subject: [PATCH] Normalize options naming and add option to customize hyprland apps --- config.nix | 17 +++++++++++++++-- modules/home-manager/hyprland/bindings.nix | 2 +- modules/home-manager/hyprland/configuration.nix | 11 +++-------- 3 files changed, 19 insertions(+), 11 deletions(-) diff --git a/config.nix b/config.nix index aaab9ea..fca270d 100644 --- a/config.nix +++ b/config.nix @@ -21,11 +21,24 @@ lib: { type = lib.types.attrs; default = {}; }; - quickAppBindings = lib.mkOption { + + hyprland_assignments = lib.mkOption { + type = lib.types.attrs; + description = "A list of Hyprland assignments to set up window rules."; + default = { + "$terminal" = "alacritty"; + "$fileManager" = "nautilus --new-window"; + "$browser" = "chromium --new-window --ozone-platform=wayland"; + "$music" = "spotify"; + "$passwordManager" = "1password"; + "$messenger" = "signal-desktop"; + "$webapp" = "$browser --app"; + }; + }; + quick_app_bindings = lib.mkOption { type = lib.types.listOf lib.types.str; description = "A list of single keystroke key bindings to launch common apps."; default = [ - "SUPER, A, exec, $webapp=https://chatgpt.com" "SUPER SHIFT, A, exec, $webapp=https://grok.com" "SUPER, C, exec, $webapp=https://app.hey.com/calendar/weeks/" diff --git a/modules/home-manager/hyprland/bindings.nix b/modules/home-manager/hyprland/bindings.nix index cb86624..dc30744 100644 --- a/modules/home-manager/hyprland/bindings.nix +++ b/modules/home-manager/hyprland/bindings.nix @@ -7,7 +7,7 @@ in { wayland.windowManager.hyprland.settings = { bind = - cfg.quickAppBindings + cfg.quick_app_bindings ++ [ # Start default apps diff --git a/modules/home-manager/hyprland/configuration.nix b/modules/home-manager/hyprland/configuration.nix index 8b395a6..fdc525d 100644 --- a/modules/home-manager/hyprland/configuration.nix +++ b/modules/home-manager/hyprland/configuration.nix @@ -2,7 +2,9 @@ config, pkgs, ... -}: { +}: let + cfg = config.omarchy; +in { imports = [ ./autostart.nix ./bindings.nix @@ -12,13 +14,6 @@ ]; wayland.windowManager.hyprland.settings = { # Default applications - "$terminal" = "alacritty"; - "$fileManager" = "nautilus --new-window"; - "$browser" = "chromium --new-window --ozone-platform=wayland"; - "$music" = "spotify"; - "$passwordManager" = "1password"; - "$messenger" = "signal-desktop"; - "$webapp" = "$browser --app"; # Environment variables env = [