From 693f313e205b01cc67d4fc15c56dbdacf4471e1d Mon Sep 17 00:00:00 2001 From: Myned Date: Fri, 25 Oct 2024 13:39:46 -0500 Subject: [PATCH] nautilus: enable tracker and partially fix startup delay Signed-off-by: Myned --- options/custom/desktops/hyprland/binds.nix | 2 +- options/custom/programs/nautilus.nix | 37 +++++++++++++++++----- 2 files changed, 30 insertions(+), 9 deletions(-) diff --git a/options/custom/desktops/hyprland/binds.nix b/options/custom/desktops/hyprland/binds.nix index f89ac4a..484bcc1 100644 --- a/options/custom/desktops/hyprland/binds.nix +++ b/options/custom/desktops/hyprland/binds.nix @@ -226,7 +226,7 @@ in { (key "B" "Super" "exec" "[group new lock; tile] ${firefox-esr}") (key "C" "Super" "exec" codium) (key "E" "Super" "exec" gnome-text-editor) - (key "F" "Super" "exec" nautilus) + (key "F" "Super" "exec" "${nautilus} --new-window") (key "G" "Super" "workspace" "name:game") (key "G" "Super+Alt" "workspace" "name:gamescope") (key "G" "Super+Ctrl+Alt" "exec" "${pkill} gamescope") diff --git a/options/custom/programs/nautilus.nix b/options/custom/programs/nautilus.nix index 0f24e70..7e0f128 100644 --- a/options/custom/programs/nautilus.nix +++ b/options/custom/programs/nautilus.nix @@ -5,14 +5,25 @@ ... }: with lib; let + nautilus = "${pkgs.nautilus}/bin/nautilus"; + cfg = config.custom.programs.nautilus; in { options.custom.programs.nautilus.enable = mkOption {default = false;}; config = mkIf cfg.enable { + # TODO: Use module when completed + # https://github.com/NixOS/nixpkgs/pull/319535 + environment.systemPackages = [pkgs.nautilus]; + services = { - gnome.sushi.enable = true; # Quick preview with spacebar gvfs.enable = true; # Trash dependency + + gnome = { + sushi.enable = true; # Quick preview with spacebar + tracker.enable = true; # File indexing + tracker-miners.enable = true; + }; }; # Alternative fix to services.gnome.core-utilities.enable @@ -23,12 +34,22 @@ in { terminal = "kitty"; }; - # TODO: Use module when completed - # https://github.com/NixOS/nixpkgs/pull/319535 - environment.systemPackages = with pkgs; [ - nautilus - nautilus-open-in-blackbox - nautilus-python - ]; + home-manager.users.${config.custom.username} = { + # HACK: Partially fix startup delay with background service until module is available + systemd.user.services = { + nautilus = { + Unit.Description = "GNOME Files Background Service"; + Install.WantedBy = ["graphical-session.target"]; + + Service = { + BusName = "org.gnome.Nautilus"; + ExecStart = "${nautilus} --gapplication-service"; + ExecStop = "${nautilus} --quit"; + Restart = "on-failure"; + Type = "dbus"; + }; + }; + }; + }; }; }