From 6180f89b7260eab653da1527203078f200cb3c8c Mon Sep 17 00:00:00 2001 From: ItsDrike Date: Sun, 9 Jun 2024 23:08:39 +0200 Subject: [PATCH] Allow specifying monitors from os config --- .../graphical/wms/hyprland/config/input.nix | 7 +++++++ hosts/herugrim/default.nix | 7 ++++++- options/home/wms.nix | 15 ++++++++++++--- 3 files changed, 25 insertions(+), 4 deletions(-) diff --git a/home/programs/graphical/wms/hyprland/config/input.nix b/home/programs/graphical/wms/hyprland/config/input.nix index bac0c6b..e5a49b4 100644 --- a/home/programs/graphical/wms/hyprland/config/input.nix +++ b/home/programs/graphical/wms/hyprland/config/input.nix @@ -1,4 +1,9 @@ { + osConfig, + ... +}: let + cfg = osConfig.myOptions.home-manager.wms.hyprland; +in { wayland.windowManager.hyprland.settings = { input = { # Keyboard layout settings @@ -20,6 +25,8 @@ natural_scroll = false; }; }; + + monitor = cfg.monitor; }; } diff --git a/hosts/herugrim/default.nix b/hosts/herugrim/default.nix index 0364a98..5988f22 100644 --- a/hosts/herugrim/default.nix +++ b/hosts/herugrim/default.nix @@ -85,7 +85,12 @@ key = "FA2745890B7048C0"; }; }; - wms.hyprland.enable = true; + wms.hyprland = { + enable = true; + monitor = [ + "eDP-1, 1920x1080@60, 0x0, 1" + ]; + }; }; }; } diff --git a/options/home/wms.nix b/options/home/wms.nix index 1708710..67407ff 100644 --- a/options/home/wms.nix +++ b/options/home/wms.nix @@ -6,9 +6,18 @@ inherit (lib) mkEnableOption mkOption types; in { options.myOptions.home-manager.wms = { - hyprland.enable = mkEnableOption '' - Hyprland wayland compositor. - ''; + hyprland = { + enable = mkEnableOption '' + Hyprland wayland compositor. + ''; + + + monitor = mkOption { + type = types.listOf types.str; + default = []; + description = "Monitor configuration."; + }; + }; isWayland = mkOption { type = types.bool;