From b434885257db89d525a430b1760c190b33fc7e11 Mon Sep 17 00:00:00 2001 From: ChUrl Date: Wed, 26 Apr 2023 20:41:01 +0200 Subject: [PATCH] Make hyprland config system dependent --- home/modules/hyprland/default.nix | 22 ++++++++++++++++++++++ home/modules/hyprland/options.nix | 15 +++++++++++++++ 2 files changed, 37 insertions(+) diff --git a/home/modules/hyprland/default.nix b/home/modules/hyprland/default.nix index 58374ce7..b7d5388b 100644 --- a/home/modules/hyprland/default.nix +++ b/home/modules/hyprland/default.nix @@ -70,6 +70,28 @@ in { # Polkit home.file.".config/hypr/polkit.conf".text = ''exec-once = ${pkgs.libsForQt5.polkit-kde-agent}/libexec/polkit-kde-authentication-agent-1''; + # Monitors for different systems + home.file.".config/hypr/monitors.conf".text = cfg.monitors; + + # Keyboard layout + home.file.".config/hypr/input.conf".text = '' + input { + kb_layout = ${cfg.kb-layout} + kb_variant = ${cfg.kb-variant} + kb_model = pc104 + kb_options = + kb_rules = + + follow_mouse = 1 + + touchpad { + natural_scroll = no + } + + sensitivity = 0 # -1.0 - 1.0, 0 means no modification. + } + ''; + home.file.".config/hypr/waybar-reload.conf".text = let waybar-reload = pkgs.writeScript "waybar-reload" '' #! ${pkgs.bash}/bin/bash diff --git a/home/modules/hyprland/options.nix b/home/modules/hyprland/options.nix index a2b81a09..692a1696 100644 --- a/home/modules/hyprland/options.nix +++ b/home/modules/hyprland/options.nix @@ -7,8 +7,23 @@ with lib; with mylib.modules; { enable = mkEnableOpt "Hyprland Window Manager + Compositor"; + kb-layout = mkOption { + type = types.str; + description = "Keyboard layout to use"; + }; + + kb-variant = mkOption { + type = types.str; + description = "Keyboard layout variant"; + }; + theme = mkOption { type = types.str; description = "Wallpaper and colorscheme to use"; }; + + monitors = mkOption { + type = types.str; + description = "Hyprland monitor configuration"; + }; }