{ pkgs, nix-config, lib, ... }:

{

  imports = with nix-config.homeModules; [
    niri
    waybar
    swaync
    # shikane
    mpv
    gnome
    hyprlock
    hypridle
  ];

  home.packages = lib.mkMerge [
    (with nix-config.packages.x86_64-linux; [
      filen-desktop
    ])

    (with pkgs; [
      appimage-run
      libappimage
      transmission_4-gtk
      wl-clipboard
      clipse
      wayland-utils
      libheif.out
      rpi-imager
      freecad
      flatpak
      # gst_all_1.gstreamer
      prusa-slicer
      via
      vial
      scribus
      pdfarranger
      tdf
      pdfchain
      pdftk
      zathura
      gpu-viewer
      foliate
      wl-mirror
      soundconverter
      wmctrl
      godot_4
      gdtoolkit_4
      sane-airscan
      xsane

      bitwarden-cli
      bitwarden-desktop
      tailscale
      trayscale
      font-manager

      papers
      newsflash

      stirling-pdf
      ripdrag

      sway-launcher-desktop
      swayidle
      thunderbird-latest
      emojify
      smile

      impression
      zoom-us
      nyxt
      ungoogled-chromium
      obsidian
      vlc
      polychromatic
      discord
      slack
      signal-desktop
      libreoffice
      hyphenDicts.en_US
      plex-mpv-shim
      plexamp
      plex-media-player

      switcheroo

      blender
      davinci-resolve-studio
      # steam
      processing
      zotero
      fractal
      handbrake
      krita
      rawtherapee
      inkscape
      gimp
      epsonscan2
      kicad
      turbocase
      openscad-unstable
      openscad-lsp
      picard
      evolutionWithPlugins
      plugdata
      pavucontrol
      qpwgraph
      clapper
      ardour
      oculante
      halloy
      paleta
      wayback
      protonplus
      fstl

      librewolf
      vivaldi

      wl-color-picker

      # screen recording and streaming
      kooha
      obs-studio
      obs-studio-plugins.wlrobs
      obs-studio-plugins.obs-gstreamer

      wineWowPackages.stagingFull
      winetricks

      virt-manager

      nautilus
      nautilus-open-any-terminal
      turtle
      gnome-online-accounts
      gnome-online-accounts-gtk

      wordbook

      protonup
      mangohud
      dualsensectl.out

      wpaperd
    ])
  ];

  home.pointerCursor = {
    name = pkgs.rice.cursor.name;
    package = pkgs.bibata-cursors;
    size = 32;
    gtk.enable = true;
    x11.enable = true;
  };

  gtk = {
    enable = true;
    cursorTheme = {
      name = pkgs.rice.cursor.name;
      package = pkgs.bibata-cursors;
    };
    theme = {
      name = "Colloid";
      package = pkgs.colloid-gtk-theme.override {
        colorVariants = [ "dark" ];
        tweaks = [ "normal" "nord" ];
        themeVariants = [ "grey" ];
      };
    };
    iconTheme = {
      name = "Colloid";
      package = pkgs.colloid-icon-theme;
    };
  };

  qt = {
    enable = true;
    platformTheme = {
      name = "gtk";
    };
    style = {
      package = pkgs.adwaita-qt;
      name = "adwaita-dark";
    };
  };

  fonts = {
    fontconfig = {
      enable = true;
    };
  };

  services = {
    flatpak = {
      enable = true;
      packages = [
        "com.github.tchx84.Flatseal"
        "dev.qwery.AddWater"
        "com.valvesoftware.SteamLink"
      ];
    };
    swayosd = {
      enable = true;
    };
  };

  xdg.configFile."wpaperd/config.toml".source = ../../homes/emenel/dotfiles/dot_config/wpaperd/config.toml;
  home.file.".local/wallpapers".source = ../../homes/emenel/dotfiles/dot_local/wallpapers;

  xdg.desktopEntries = {
    isd = {
      name = "isd (interactive systemd)";
      exec = "/home/emenel/.local/bin/wezapp isd";
      categories = [ "System" ];
    };
    mirror-laptop = {
      name = "mirror laptop";
      exec = "/home/emenel/.local/bin/mirror-laptop";
      categories = [ "System" ];
    };
    btop = {
      name = "btop++";
      exec = "/home/emenel/.local/bin/wezapp btop";
      categories = [ "System" ];
    };
    steam-offload = {
      name = "Steam (nvidia-offload)";
      exec = "nvidia-offload ${pkgs.steam}/bin/steam";
    };
    bluetuith = {
      name = "Bluetuith (bluetooth manager)";
      exec = "/home/emenel/.local/bin/wezapp bluetuith";
    };
    color-picker-clip = {
      name = "wl color picker (clipboard)";
      exec = "${pkgs.wl-color-picker}/bin/wl-color-picker clipboard";
    };
    color-picker = {
      name = "wl color picker";
      exec = "${pkgs.wl-color-picker}/bin/wl-color-picker";
    };
  };

  xdg.configFile."halloy/config.toml".source = ../../homes/emenel/dotfiles/dot_config/halloy/config.toml;
  # xdg.configFile."nyxt/config.lisp".source = ../../homes/emenel/dotfiles/dot_config/nyxt/config.lisp;
}
