#
# Packages we want in our environment.
#
# vim: et:ts=2:sw=2:
#
{
  deprekages,
  pkgs,
  agenix,
  nil,
  attic,
  is-hm-standalone,
  is-droid,
  ...
}:
with pkgs;
[

  # Core.
  (if is-droid then coreutils else coreutils-full)
  neovim
  nix-index
  rsync
  tree-sitter
  deprekages.kak-tree-sitter
  tmux
  deprekages._7zz

  # Backup things.
  keepassxc

  # Task & time management.
  khal
  vit
  tasksh
  taskwarrior-tui
  taskwarrior3
  taskjuggler
  deprekages.hrvst-cli

  # Always keep sqlite around, since it's necessary to fix our DB sometimes.
  sqlite

  # Nix enhancements.
  nurl
  nix-init
  nix-index
  nix-diff
  nix-direnv
  nix-direnv-flakes
  nix-info
  nix-query-tree-viewer
  nix-update
  patchelf
  niv

  # Utils.
  _1password-cli
  age
  agenix.agenix
  atool
  bat
  bitwarden-cli
  bzip2
  cardpeek
  cpio
  cyberchef
  dasel
  delta
  deprekages.age-plugin-yubikey
  deprekages.avbroot
  deprekages.mergiraf
  difftastic
  dmidecode
  dterm
  edir
  editorconfig-core-c
  editorconfig-checker
  efibootmgr
  eza
  fd
  ffmpeg-full
  file
  findutils
  gettext
  ghostscript
  git
  git-lfs
  grc
  hexyl
  htop
  imagemagick
  jq
  jre
  jmtpfs
  killall
  libimobiledevice
  libsecret
  lz4
  minipro
  moreutils
  mosquitto
  mpc-cli
  nmap
  jmtpfs
  netcat
  nil.nil
  nixfmt-rfc-style
  ntfsprogs
  openocd
  openssl
  openssh
  python3
  python3Packages.matplotlib
  pv
  qpdf
  rclone
  ripgrep
  rr
  unzip
  unar
  unrar
  wget
  zstd
  zip

  # Scripting languages
  (ruby.withPackages (
    pkgs: with pkgs // deprekages.rubyPackages; [
      pry
      sinatra
      nokogiri
      chronic
    ]
  ))

  # Office.
  sc-im

  # For editors.
  fish
  lazygit
  lua-language-server
  stylua
  solargraph
  (aspellWithDicts (
    dicts: with dicts; [
      de
      en
      en-computers
      en-science
      nl
    ]
  ))

  # Reversing.
  binwalk

  # Development.
  colmena
  rustfmt
  cargo
  clang
  clang-tools
  rust-analyzer
  flatbuffers
  nextpnr
  yosys
  trellis
  poetry
  maven
  xxd

  # Typesetting.
  typst
  tinymist

  # USB hub control.
  deprekages.ykush

  # Temporary, until we pull CoC into our config?
  nodejs
  yarn
]

# Linux-only packages.
++ (
  if pkgs.stdenv.isLinux then
    [
      # Core
      pciutils
      usbutils
      linuxPackages.usbip
      deprekages.oxfs

      # Utilities.
      wev
      i2c-tools
      pcsc-tools
      davfs2

    ]
  else
    [ ]
)

# Mac-only packages.
++ (
  if pkgs.stdenv.isDarwin then
    [

      # Utils
      mas
      plistwatch

      # Development.
      libiconv # Required for Rust on mac.

    ]
  else
    [ ]
)

# x86_64 only packages
++ (
  if pkgs.stdenv.isx86_64 then
    [

      # Utils.
      dig
      magic-wormhole

      jadx

      steam-run
      attic.attic

    ]
  else
    [ ]
)

++ (
  if (!is-hm-standalone && !is-droid) then
    [
      kakoune
    ]
  else
    [ ]
)
