Merge with Coded's config

As we're working on similar things, it makes sense to make a single
config with all our stuff together. We've named our coalition "chimera"
as Coded's devices are named after cat breeds and mine are named after
bird species. We'll be using NixOS options to enable us to have
different configurations anywhere we want that

Co-Authored-By: Samuel Shuert <coded@clicks.codes>
Change-Id: Idb102526d84e76edb0bfe7153bd18dfe8566516b
Reviewed-on: https://git.clicks.codes/c/Chimera/NixFiles/+/382
Reviewed-by: Samuel Shuert <coded@clicks.codes>
Tested-by: Skyler Grey <minion@clicks.codes>
diff --git a/modules/home/hyprland/default.nix b/modules/home/hyprland/default.nix
index a2f8b88..ce1a300 100644
--- a/modules/home/hyprland/default.nix
+++ b/modules/home/hyprland/default.nix
@@ -1,93 +1,164 @@
-{ pkgs, config, inputs, system, ... }: let
+{
+  pkgs,
+  config,
+  inputs,
+  system,
+  lib,
+  ...
+}:
+let
   lock = "${pkgs.waylock}/bin/waylock";
-in {
+in
+{
+  options.chimera.hyprland = {
+    enable = lib.mkEnableOption "Use hyprland as your window manager";
+
+    monitors = lib.mkOption {
+      type = lib.types.listOf lib.types.str;
+      description = "List of default monitors to set";
+      default = [ ];
+    };
+  };
+
+  /* general = {
+       gaps_in = 5;
+       gaps_out = 20;
+
+       border_size = 1;
+       "col.active_border" = "rgba(71AEF5EE)";
+       "col.inactive_border" = "rgba(C4C4C4EE)";
+
+       layout = "dwindle";
+     };
+
+     dwindle = {
+       pseudotile = true;
+       smart_split = true;
+     };
+
+     master = {
+       allow_small_split = true;
+       new_is_master = true;
+     };
+
+     decoration = {
+       rounding = 7;
+
+       drop_shadow = true;
+       shadow_range = 4;
+       shadow_render_power = 3;
+       "col.shadow" = "rgba(1a1a1aee)";
+     };
+  */
 
   # TODO: Eww, SwayNC, hyprland-per-window-layout, waylock, hy3, anyrun, hypr-empty
 
-  home.packages = [ pkgs.hyprpicker ];
+  config = lib.mkIf config.chimera.hyprland.enable {
+    home.packages = [ pkgs.hyprpicker ];
 
-  minion.touchpadGestures.enable = true;
+    services.fusuma.settings.swipe = lib.mkIf config.chimera.touchpad.enable (
+      let
+        hyprctl = "${config.wayland.windowManager.hyprland.package}/bin/hyprctl";
+        jq = "${pkgs.jq}/bin/jq";
+        awk = "${pkgs.gawk}/bin/awk";
+      in
+      {
+        "3".up.command = "${hyprctl} dispatch fullscreen 0";
+        "3".down.command = "${hyprctl} dispatch fullscreen 0";
+        "4".down.command = lock;
+        "3".left.command = "${hyprctl} dispatch workspace $(${hyprctl} activeworkspace -j | ${jq} .id | ${awk} '{print $1+1}')";
+        "3".right.command = "${hyprctl} dispatch workspace $(${hyprctl} activeworkspace -j | ${jq} .id | ${awk} '{print $1-1}')";
+      }
+    );
 
-  services.fusuma.settings.swipe = let 
-    hyprctl = "${config.wayland.windowManager.hyprland.package}/bin/hyprctl";
-    jq = "${pkgs.jq}/bin/jq";
-    awk = "${pkgs.gawk}/bin/awk";
-  in {
-    "3".up.command = "${hyprctl} dispatch fullscreen 0";
-    "3".down.command = "${hyprctl} dispatch fullscreen 0";
-    "4".down.command = lock;
-    "3".left.command = "${hyprctl} dispatch workspace $(${hyprctl} activeworkspace -j | ${jq} .id | ${awk} '{print $1+1}')";
-    "3".right.command = "${hyprctl} dispatch workspace $(${hyprctl} activeworkspace -j | ${jq} .id | ${awk} '{print $1-1}')";
-  };
+    wayland.windowManager.hyprland = {
+      enable = true;
 
-  wayland.windowManager.hyprland = {
-    enable = true;
+      xwayland.enable = true;
+      systemd.enable = true;
 
-    xwayland.enable = true;
-    systemd.enable = true;
+      settings =
+        let
+          mod = "SUPER";
+          terminal = "${pkgs.kitty}/bin/kitty";
+          menu = "${inputs.anyrun.packages.${system}.anyrun}/bin/anyrun";
+        in
+        {
+          misc = {
+            disable_hyprland_logo = true;
+            disable_splash_rendering = true;
+          };
 
-    settings = let
-      mod = "SUPER";
-      terminal = "${pkgs.kitty}/bin/kitty";
-      menu = "${inputs.anyrun.packages.${system}.anyrun}/bin/anyrun";
-    in {
-      misc = {
-        disable_hyprland_logo = true;
-        disable_splash_rendering = true;
-      };
+          exec-once = "${pkgs.hyprpaper}/bin/hyprpaper";
 
-      exec-once = "${pkgs.hyprpaper}/bin/hyprpaper";
+          monitor = config.chimera.hyprland.monitors ++ [ ",preferred,auto,1" ];
 
-      monitor = [
-        "eDP-1,preferred,0x0,1"
-        "desc:Dell Inc. DELL P2715Q V7WP95AV914L,preferred,2256x-1956,1,transform,1"
-        "desc:AOC 2460G5 0x00023C3F,preferred,336x-1080,1"
-        ",preferred,auto,1" # https://wiki.hyprland.org/Configuring/Monitors/
-      ];
+          decoration = {
+            rounding = 7;
+          };
 
-      input = {
-        kb_layout = "us";
-        kb_variant = "dvorak";
-        natural_scroll = true;
+          input = {
+            kb_layout = "us";
+            kb_variant = "dvorak";
+            natural_scroll = true;
 
-        touchpad = {
-          natural_scroll = true;
-        };
-      };
+            touchpad = {
+              natural_scroll = true;
+            };
+          };
 
-      xwayland = {
-        force_zero_scaling = true;
-      };
+          xwayland = {
+            force_zero_scaling = true;
+          };
 
-      bind = [
-        "${mod}, Q, killactive"
-        "${mod}, SPACE, togglefloating"
-        "${mod}, RETURN, exec, ${terminal}"
-        "${mod}, down, movefocus, d"
-        "${mod}, up, movefocus, u"
-        "${mod}, right, movefocus, r"
-        "${mod}, left, movefocus, l"
-        "${mod}, L, exec, ${lock}"
-        "${mod}, D, exec, ${menu}"
-      ] ++ (
-        builtins.concatLists (builtins.genList (
-            x: let
-              ws = let
-                c = (x + 1) / 10;
-              in
-                builtins.toString (x + 1 - (c * 10));
-            in [
-              "${mod}, ${ws}, workspace, ${toString (x + 1)}"
-              "${mod} SHIFT, ${ws}, movetoworkspace, ${toString (x + 1)}"
+          dwindle = {
+            pseudotile = true;
+            smart_split = true;
+          };
+
+          master = {
+            allow_small_split = true;
+            new_is_master = true;
+          };
+
+          windowrulev2 = [ "opacity 1.0 0.85,title:(.*)" ];
+
+          bind =
+            [
+              "${mod}, Q, killactive"
+              "${mod}, SPACE, togglefloating"
+              "${mod}, RETURN, exec, ${terminal}"
+              "${mod}, down, movefocus, d"
+              "${mod}, up, movefocus, u"
+              "${mod}, right, movefocus, r"
+              "${mod}, left, movefocus, l"
+              "${mod}, L, exec, ${lock}"
+              "${mod}, D, exec, ${menu}"
             ]
-          )
-          10)
-      );
+            ++ (builtins.concatLists (
+              builtins.genList
+                (
+                  x:
+                  let
+                    ws =
+                      let
+                        c = (x + 1) / 10;
+                      in
+                      builtins.toString (x + 1 - (c * 10));
+                  in
+                  [
+                    "${mod}, ${ws}, workspace, ${toString (x + 1)}"
+                    "${mod} SHIFT, ${ws}, movetoworkspace, ${toString (x + 1)}"
+                  ]
+                )
+                10
+            ));
 
-      bindm = [
-        "${mod}, mouse:272, movewindow"
-        "${mod}, mouse:273, resizewindow"
-      ];
+          bindm = [
+            "${mod}, mouse:272, movewindow"
+            "${mod}, mouse:273, resizewindow"
+          ];
+        };
     };
   };
-}
\ No newline at end of file
+}