From c77271a74dd073d86455c02ea8862f09ef0f382d Mon Sep 17 00:00:00 2001
From: Zynh Ludwig <Zynh0722@gmail.com>
Date: Wed, 5 Mar 2025 05:53:32 -0800
Subject: [PATCH] hyprland: module init

---
 modules/hyprland.nix | 79 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 79 insertions(+)
 create mode 100644 modules/hyprland.nix

diff --git a/modules/hyprland.nix b/modules/hyprland.nix
new file mode 100644
index 0000000..88cc132
--- /dev/null
+++ b/modules/hyprland.nix
@@ -0,0 +1,79 @@
+{ lib, config, pkgs, ... }:
+
+let
+  cfg = config.snowhawk.hyprland;
+in
+{
+  options.snowhawk.hyprland = {
+    enable = lib.mkEnableOption "hyprland";
+  };
+
+  config = lib.mkIf cfg.enable {
+    services.graphical-desktop.enable = lib.mkDefault true;
+
+    services.displayManager = {
+      enable = true;
+      # sessionPackages = [ pkgs.hyprland ];
+      sddm = {
+        enable = lib.mkDefault true;
+        wayland.enable = lib.mkDefault true;
+        theme = pkgs.sddm-astronaut.override { embeddedTheme = "pixel_sakura"; };
+      };
+    };
+
+    security = {
+      polkit.enable = lib.mkDefault true;
+    };
+
+    programs = {
+      dconf.enable = lib.mkDefault true;
+      xwayland.enable = lib.mkDefault true;
+    };
+
+    xdg.portal = {
+      enable = true;
+      extraPortals = [
+        pkgs.xdg-desktop-portal-gtk
+      ];
+    };
+
+    programs.hyprland = {
+      enable = true;
+      withUWSM = true;
+      xwayland.enable = true;
+    };
+
+    # programs.hyprlock.enable = true;
+
+    # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1050913
+    xdg.portal.config.hyprland.default = lib.mkDefault [ "wlr" "gtk" ];
+
+    services.xserver.desktopManager.runXdgAutostartIfNone = lib.mkDefault true;
+
+    environment.variables = {
+      QT_QPA_PLATFORM = "wayland;xcb";
+      MOZ_ENABLE_WAYLAND = 1;
+      SDL_VIDEODRIVEWR = "wayland,x11";
+      _JAVA_AWT_WM_NONREPARENTING = 1;
+    };
+
+    environment.systemPackages = with pkgs; [
+      grim
+      slurp
+      satty
+
+      wofi
+      brightnessctl
+
+      wdisplays
+      xorg.xlsclients
+
+      wl-clipboard
+      kitty
+
+      pipewire-controller
+    ];
+
+    home-manager.sharedModules = [ ];
+  };
+}