#
# GUI packages we want in our environment.
# For machines that have GUI support.
#
# vim: et:ts=2:sw=2:
#
{
  pkgs,
  deprekages,
  niri,
  config,
  ...
}@args:
{
  #
  # Systemwide environment packages, for GUI.
  #
  nixpkgs.config.android_sdk.accept_license = true;
  environment.systemPackages = (import ./gui.pkgs.nix) args;

  # Enable tridactyl and firefox-webserial on NixOS.
  programs.firefox.enable = true;
  programs.firefox.nativeMessagingHosts.packages = [
    pkgs.tridactyl-native
    deprekages.firefox-webserial
  ];

  home-manager.users.deprekated = {
    home.file.".mozilla/native-messaging-hosts" = {
      recursive = true;
      source = pkgs.runCommandLocal "native-messaging-hosts" { } ''
        mkdir $out
        for ext in ${toString config.programs.firefox.nativeMessagingHosts.packages}; do
            ln -sLt $out $ext/lib/mozilla/native-messaging-hosts/*
        done
      '';
    };
  };
}
