{ bevy-julia
, bevy-mandelbrot
, tracer
, fenix
, naersk
, rust-overlay
}:

final: prev:

with final; {
  activity-relay = callPackage ./activity-relay.nix { };

  allcolors = callPackage ./allcolors.nix { };

  inherit (bevy-julia.packages.${system}) bevy_julia;
  inherit (bevy-mandelbrot.packages.${system}) bevy_mandelbrot;

  bmxd = callPackage ./bmxd.nix { };

  ceph_17_2 = assert (lib.versions.majorMinor ceph.version) == "17.2"; prev.ceph;

  dump1090-influxdb = callPackage ./dump1090-influxdb { };

  dump1090_rs = callPackage ./dump1090_rs.nix { };

  chromium = prev.chromium.override {
    # enable hardware accerlation with vaapi, force dark mode, detect kwallet
    commandLineArgs = "--enable-features=VaapiVideoEncoder,VaapiVideoDecoder,CanvasOopRasterization --force-dark-mode --password-store=detect";
  };

  firefox = prev.firefox.override {
    extraPolicies = {
      DisablePocket = true;
      FirefoxHome.Pocket = false;
    };
  };

  # throw illegal instructions in tests
  # TODO: check this on 23.11
  gdal = prev.gdal.override { useTiledb = false; };

  grafana = prev.grafana.overrideAttrs (_: {
    # broken with backports and take a good amount of time
    doCheck = false;
  });

  # hydra flake
  hydra = prev.hydra.overrideAttrs (oldAttrs: {
    patches = oldAttrs.patches or [ ] ++ [
      # gitea webhook support
      (fetchpatch {
        url = "https://github.com/NixOS/hydra/pull/1227/commits/750978a19232583e17620a1bd80435e957e7213a.patch";
        sha256 = "sha256-86Li0YUSVUdnw6lt6kZ56ohDRKPD13SZzukqPU1np8U=";
      })
      # fix github webhook from orgs
      (fetchpatch {
        url = "https://github.com/NixOS/hydra/commit/4d664ecb0faaf51b21673f979b543ea4694c3f1b.patch";
        sha256 = "sha256-lF5Rnz8r9ptyMLhcg/XnjiNhOK1KcLA7hi01ye4KgmI=";
      })
    ];
  });

  # hydra in nixpkgs
  hydra_unstable = prev.hydra_unstable.overrideAttrs (oldAttrs: {
    patches = oldAttrs.patches or [ ] ++ [
      # gitea webhook support
      (fetchpatch {
        url = "https://github.com/NixOS/hydra/pull/1227/commits/750978a19232583e17620a1bd80435e957e7213a.patch";
        sha256 = "sha256-86Li0YUSVUdnw6lt6kZ56ohDRKPD13SZzukqPU1np8U=";
      })
      # fix github webhook from orgs
      (fetchpatch {
        url = "https://github.com/NixOS/hydra/commit/4d664ecb0faaf51b21673f979b543ea4694c3f1b.patch";
        sha256 = "sha256-lF5Rnz8r9ptyMLhcg/XnjiNhOK1KcLA7hi01ye4KgmI=";
      })
    ];
  });

  mlat-client = python3Packages.callPackage ./mlat-client.nix { };

  openssh = prev.openssh.overrideAttrs (_: {
    # takes 30 minutes
    doCheck = false;
  });

  pi-sensors = callPackage ./pi-sensors { };

  plume = callPackage ./plume {
    inherit fenix naersk;
  };

  readsb = callPackage ./readsb.nix { };

  telme10 = callPackage ./telme10.nix { };

  tracer-game =
    if true
    then throw "tracer-game: haddock runs on affection for 10 hours and more"
    else tracer.packages.${system}.tracer-game;

  trainbot = callPackage ./trainbot.nix { };
}
