{ config, pkgs, ... }:

let
  settings = import ../settings.nix;
in
{
  # Enable unfree globally
  nixpkgs.config.allowUnfree = true;

  environment.variables.BROWSER = "librewolf";
  environment.variables.SSH_AUTH_SOCK = "/home/${settings.username}/.bitwarden-ssh-agent.sock";

  environment.systemPackages =
    with pkgs; [
      # Browsers and comms
      discord
      signal-desktop
      librewolf

      # Development tools
      go
      cargo
      gnumake
      rustc
      rust-analyzer
      rustfmt
      nodejs_24
      openssh
      nodePackages."pnpm"
      openssl
      killall
      ffmpeg
      zed-editor
      vscodium
      usbutils
      qmk-udev-rules
      qmk
      ghostty
      neofetch
      deepfilternet
      pavucontrol
      texliveFull

      # Desktop applications
      bitwarden-desktop
      vlc
      streamrip
      cider-2
      zotero
      prismlauncher
      lrcget
      impression
      streamcontroller
      onlyoffice-desktopeditors
    ];

  # Programs with extra configuration
  programs.steam = {
    enable = true;
    remotePlay.openFirewall = true;
    dedicatedServer.openFirewall = true;
    localNetworkGameTransfers.openFirewall = true;
  };

  programs.java.enable = true;
  programs.steam.extraPackages = [ pkgs.jdk ];

  programs.obs-studio.enable = true;

  programs.git = {
    enable = true;
    config = {
      user = {
        name = "${settings.gitName}";
        email = "${settings.gitEmail}";
        signingkey = "${settings.gitKey}";
      };
      gpg.format = "ssh";
      commit.gpgsign = true;
    };
  };
}
