2024-09-09 00:22:14 +00:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
pkgs,
|
|
|
|
...
|
|
|
|
}:
|
2024-09-13 01:50:53 +00:00
|
|
|
with lib; let
|
2024-09-09 00:22:14 +00:00
|
|
|
cfg = config.custom.programs.nautilus;
|
2024-09-13 01:50:53 +00:00
|
|
|
in {
|
2024-11-06 18:06:38 +00:00
|
|
|
options.custom.programs.nautilus = {
|
|
|
|
enable = mkOption {default = false;};
|
|
|
|
git = mkOption {default = false;};
|
|
|
|
index = mkOption {default = true;};
|
|
|
|
service = mkOption {default = false;};
|
|
|
|
terminal = mkOption {default = "kitty";};
|
|
|
|
};
|
2024-09-09 00:22:14 +00:00
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
2024-10-25 18:39:46 +00:00
|
|
|
# TODO: Use module when completed
|
|
|
|
# https://github.com/NixOS/nixpkgs/pull/319535
|
2024-11-04 17:11:02 +00:00
|
|
|
environment.systemPackages = with pkgs; [nautilus];
|
2024-10-25 18:39:46 +00:00
|
|
|
|
2024-10-20 14:10:49 +00:00
|
|
|
services = {
|
|
|
|
gvfs.enable = true; # Trash dependency
|
2024-10-25 18:39:46 +00:00
|
|
|
|
|
|
|
gnome = {
|
|
|
|
sushi.enable = true; # Quick preview with spacebar
|
2024-11-06 18:06:38 +00:00
|
|
|
tracker.enable = cfg.index; # File indexing
|
|
|
|
tracker-miners.enable = cfg.index;
|
2024-10-25 18:39:46 +00:00
|
|
|
};
|
2024-10-20 14:10:49 +00:00
|
|
|
};
|
2024-09-09 00:22:14 +00:00
|
|
|
|
2024-10-20 14:10:49 +00:00
|
|
|
# Alternative fix to services.gnome.core-utilities.enable
|
2024-09-09 00:22:14 +00:00
|
|
|
# https://github.com/NixOS/nixpkgs/pull/240780
|
|
|
|
#?? echo $NAUTILUS_4_EXTENSION_DIR
|
2024-10-20 14:10:49 +00:00
|
|
|
programs.nautilus-open-any-terminal = {
|
|
|
|
enable = true;
|
2024-11-06 18:06:38 +00:00
|
|
|
terminal = cfg.terminal;
|
2024-09-09 00:22:14 +00:00
|
|
|
};
|
|
|
|
|
2024-10-25 18:39:46 +00:00
|
|
|
home-manager.users.${config.custom.username} = {
|
|
|
|
# HACK: Partially fix startup delay with background service until module is available
|
2024-11-04 17:11:02 +00:00
|
|
|
systemd.user.services = let
|
|
|
|
nautilus = "${pkgs.nautilus}/bin/nautilus";
|
|
|
|
turtle_service = "${pkgs.turtle}/bin/turtle_service";
|
|
|
|
in {
|
2024-11-06 18:06:38 +00:00
|
|
|
nautilus = mkIf cfg.service {
|
2024-10-25 18:39:46 +00:00
|
|
|
Unit.Description = "GNOME Files Background Service";
|
|
|
|
Install.WantedBy = ["graphical-session.target"];
|
|
|
|
|
|
|
|
Service = {
|
|
|
|
BusName = "org.gnome.Nautilus";
|
|
|
|
ExecStart = "${nautilus} --gapplication-service";
|
|
|
|
ExecStop = "${nautilus} --quit";
|
2024-11-04 18:06:34 +00:00
|
|
|
Restart = "always"; #!! Benign exceptions cause nautilus to exit
|
2024-10-25 18:39:46 +00:00
|
|
|
Type = "dbus";
|
|
|
|
};
|
|
|
|
};
|
2024-11-04 17:11:02 +00:00
|
|
|
|
2024-11-06 18:06:38 +00:00
|
|
|
# TODO: Check for module
|
2024-11-04 18:06:34 +00:00
|
|
|
# BUG: Benign AttributeError when scanning on nautilus launch
|
2024-11-04 17:11:02 +00:00
|
|
|
# Git integration dependency
|
2024-11-06 18:06:38 +00:00
|
|
|
turtle = mkIf cfg.git {
|
2024-11-04 17:11:02 +00:00
|
|
|
Unit.Description = "Turtle Background Service";
|
|
|
|
Install.WantedBy = ["graphical-session.target"];
|
|
|
|
|
|
|
|
Service = {
|
|
|
|
BusName = "de.philippun1.turtle";
|
|
|
|
ExecStart = turtle_service;
|
2024-11-04 18:06:34 +00:00
|
|
|
Restart = "always";
|
2024-11-04 17:11:02 +00:00
|
|
|
Type = "dbus";
|
|
|
|
};
|
|
|
|
};
|
2024-10-25 18:39:46 +00:00
|
|
|
};
|
|
|
|
};
|
2024-09-09 00:22:14 +00:00
|
|
|
};
|
|
|
|
}
|