# shell.nix
{ pkgs ? import <nixpkgs> {} }:

pkgs.mkShell {
  packages = with pkgs; [
    gcc
    pkg-config
    meson
    ninja
    gtk4
    gtkmm4
    sqlite
    openssl
    tinyxml-2
    libzip
    poppler 
    flatpak-builder

    # runtime data GTK needs
    adwaita-icon-theme
    hicolor-icon-theme
    gsettings-desktop-schemas
    shared-mime-info
    librsvg
  ];

  shellHook = ''
    # GSettings schemas
    export GSETTINGS_SCHEMA_DIR=${pkgs.gsettings-desktop-schemas}/share/glib-2.0/schemas

    # Prepend icon/theme/mime dirs; note the Nix-escaped Bash expansion: ''${...}
    export XDG_DATA_DIRS=${pkgs.adwaita-icon-theme}/share:${pkgs.hicolor-icon-theme}/share:${pkgs.gsettings-desktop-schemas}/share:${pkgs.shared-mime-info}/share''${XDG_DATA_DIRS:+:}$XDG_DATA_DIRS
  '';
}
