Install xdg-open

This is mostly to allow clicking on urls, in future patches we can add
URL associations via xdg.mimeApps.added.<...> but for now Firefox is
able to open URLs which we pass to xdg-open out-of-the-box

Change-Id: Ia1c66508c2253d2b2c90599d121dbab6df82439a
Reviewed-on: https://git.clicks.codes/c/Chimera/NixFiles/+/532
Reviewed-by: Samuel Shuert <coded@clicks.codes>
Tested-by: Skyler Grey <minion@clicks.codes>
diff --git a/modules/nixos/hyprland/default.nix b/modules/nixos/hyprland/default.nix
index 2d22b20..80a7733 100644
--- a/modules/nixos/hyprland/default.nix
+++ b/modules/nixos/hyprland/default.nix
@@ -1,4 +1,6 @@
-{ ... }:
+{ pkgs, lib, ... }:
 {
   programs.hyprland.enable = true;
+  xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-gtk ];
+  chimera.xdg-open.enable = lib.mkDefault true;
 }
diff --git a/modules/nixos/xdg-open/default.nix b/modules/nixos/xdg-open/default.nix
new file mode 100644
index 0000000..bec1a6b
--- /dev/null
+++ b/modules/nixos/xdg-open/default.nix
@@ -0,0 +1,16 @@
+{ config, lib, pkgs, ... }: {
+  options = {
+    chimera.xdg-open.enable = lib.mkOption {
+      type = lib.types.bool;
+      description = "Whether to enable xdg-open";
+      default = false;
+      example = true;
+    };
+  };
+
+  config = lib.mkIf config.chimera.xdg-open.enable {
+    xdg.portal.enable = true;
+    xdg.portal.xdgOpenUsePortal = true;
+    environment.systemPackages = [ pkgs.xdg-utils ];
+  };
+}