# This file does not contain only niri configurations, but also related tools needed for my niri rice
{ config, pkgs, ... }:

{

# Niri is enabled in configuration.nix
home.file.".config/niri".source = config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/nixos/dotfiles/niri";
home.file.".config/rofi".source = config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/nixos/dotfiles/rofi";
home.file.".config/foot".source = config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/nixos/dotfiles/foot";
home.file.".config/kitty".source = config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/nixos/dotfiles/kitty";
home.file.".config/swaylock".source = config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/nixos/dotfiles/swaylock";
home.file.".config/swayidle".source = config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/nixos/dotfiles/swayidle";
home.file.".config/gkt-3.0/settings.ini".source = config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/nixos/dotfiles/gtk/gtk-3.0/settings.ini";
home.file.".config/gkt-4.0/settings.ini".source = config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/nixos/dotfiles/gtk/gtk-4.0/settings.ini";


# Gtk theme
gtk = {
    enable = true;
    colorScheme = "dark";
    gtk3.extraConfig.Settings = ''gtk-application-prefer-dark-themes=1'';
    gtk4.extraConfig.Settings = ''gtk-application-prefer-dark-themes=1'';
};
home.file.".themes/Catppuccin-Macchiato-Dark".source = config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/nixos/dotfiles/gtk/Catppuccin-Macchiato-Dark";

# Polkit
systemd.user.services.polkit-gnome-authentication-agent-1 = {
  Unit = {
    Description = "polkit-gnome-authentication-agent-1";
    Wants = [ "graphical-session.target" ];
    After = [ "graphical-session.target" ];
  };
  Install = {
    WantedBy = [ "graphical-session.target" ];
  };
  Service = {
    Type = "simple";
    ExecStart = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1";
    Restart = "on-failure";
    RestartSec = 1;
    TimeoutStopSec = 10;
  };
};

# Catppuccin
catppuccin.cursors = {
    enable = true;
    flavor = "mocha";
    accent = "dark";
};
catppuccin.gtk.icon = {
    enable = true;
    flavor = "mocha";
    accent = "lavender";
};

home.packages = with pkgs; [
    xdg-desktop-portal-gtk
    xdg-desktop-portal-gnome
    gnome-keyring
    xwayland-satellite
    polkit_gnome
    brightnessctl
    kitty
    swaybg
    swaylock-effects
    swayidle
    rofi
    pwvucontrol
    udiskie
    quickshell
    nautilus
    overskride
    gnome-text-editor
    wl-clipboard
    eog
    pfetch
];

}
