From d28f12650db1c8c47f1a5f38a447ac827786da1b Mon Sep 17 00:00:00 2001
From: Julian Mutter <julian.mutter@comumail.de>
Date: Mon, 17 Jun 2024 21:02:55 +0200
Subject: [PATCH] Fix thunar installation, some config cleanup

---
 homes/x86_64-linux/julian@aspi/packages.nix |  1 -
 modules/home/hyprland/default.nix           |  2 +-
 systems/x86_64-linux/aspi/default.nix       | 19 ++++++++++++++++---
 3 files changed, 17 insertions(+), 5 deletions(-)

diff --git a/homes/x86_64-linux/julian@aspi/packages.nix b/homes/x86_64-linux/julian@aspi/packages.nix
index ac4355a..8811f4d 100644
--- a/homes/x86_64-linux/julian@aspi/packages.nix
+++ b/homes/x86_64-linux/julian@aspi/packages.nix
@@ -39,7 +39,6 @@ with pkgs;
 
   xournalpp
 
-  xfce.thunar-archive-plugin
   zip
   p7zip # unzip 7zip archives
   imagemagick
diff --git a/modules/home/hyprland/default.nix b/modules/home/hyprland/default.nix
index 3e29c82..c4c4c89 100644
--- a/modules/home/hyprland/default.nix
+++ b/modules/home/hyprland/default.nix
@@ -43,7 +43,6 @@ in
     };
 
     home.packages = with pkgs; [
-      xfce.thunar
       # hyprpicker # TODO
       # hyprcursor # TODO
       brightnessctl
@@ -160,6 +159,7 @@ in
         input = {
           kb_layout = "de";
           natural_scroll = false;
+          follow_mouse = 1;
         };
 
         # Window rules
diff --git a/systems/x86_64-linux/aspi/default.nix b/systems/x86_64-linux/aspi/default.nix
index f903a9c..b4dce43 100644
--- a/systems/x86_64-linux/aspi/default.nix
+++ b/systems/x86_64-linux/aspi/default.nix
@@ -105,7 +105,6 @@
   };
 
   # Enable the XFCE Desktop Environment.
-  services.xserver.displayManager.gdm.enable = true;
   security.pam.services.gdm.enableGnomeKeyring = true;
   security.pam.services.gtklock = { };
 
@@ -123,17 +122,21 @@
   # services.xserver.windowManager.i3.package = pkgs.i3-gaps;
 
   programs.hyprland.enable = true;
+  programs.hyprland.package = inputs.hyprland.packages.${pkgs.system}.hyprland;
   programs.hyprland.xwayland.enable = true;
 
   # Configure keymap in X11
   services.xserver = {
     enable = true;
+    displayManager.gdm.enable = true;
     xkb.layout = "de";
     xkb.variant = "";
   };
 
   # Configure console keymap
   console.keyMap = "de";
+  # or use this
+  # console.useXkbConfig = true;
 
   # Enable sound with pipewire.
   sound.enable = true;
@@ -169,7 +172,7 @@
   };
 
   # Enable touchpad support (enabled default in most desktopManager).
-  services.xserver.libinput.enable = true;
+  # services.xserver.libinput.enable = true;
 
   # Define a user account. Don't forget to set a password with ‘passwd’.
   users.users.julian = {
@@ -261,7 +264,7 @@
   xdg.portal.enable = true;
   xdg.portal.extraPortals = [
     pkgs.xdg-desktop-portal-gtk
-    pkgs.xdg-desktop-portal-hyprland
+    # pkgs.xdg-desktop-portal-hyprland
   ];
 
   # services.emacs.enable = true;
@@ -285,6 +288,16 @@
     xclip
   ];
 
+  programs.thunar.enable = true;
+  programs.xfconf.enable = true; # Persist saved preferences
+  programs.thunar.plugins = with pkgs.xfce; [
+    thunar-archive-plugin
+    thunar-volman
+    thunar-media-tags-plugin
+  ];
+  services.gvfs.enable = true; # Mount, trash, and other functionalities
+  services.tumbler.enable = true; # Thumbnail support for images
+
   virtualisation.docker.enable = true;
 
   virtualisation.virtualbox.host.enable = true;