{ pkgs, ... }:

{
  services.ananicy = {
    enable = true;
    package = pkgs.ananicy-cpp;
    rulesProvider = pkgs.ananicy-rules-cachyos;

    extraTypes = [
      { type = "Compiler"; nice = 19; latency_nice = 19; }
    ];

    extraRules = [
      # C/C++ etc
      { name = "clang";     type = "Compiler"; }
      { name = "clang++";   type = "Compiler"; }
      { name = "cmake";     type = "Compiler"; }
      { name = "gcc";       type = "Compiler"; }
      { name = "g++";       type = "Compiler"; }
      { name = "make";      type = "Compiler"; }

      # Go
      { name = "go";        type = "Compiler"; }

      # Java
      { name = "java";      type = "Compiler"; }
      { name = "javac";     type = "Compiler"; }

      # Rust
      { name = "cargo";         type = "Compiler"; }
      { name = "rustc";         type = "Compiler"; }
      { name = "rust-analyzer"; type = "Compiler"; }

      # Linkers
      { name = "lld";          type = "Compiler"; }
      { name = "mold";         type = "Compiler"; }
      { name = "ld";           type = "Compiler"; }
      { name = "ld.bfd";       type = "Compiler"; }
      { name = "ld.mold";      type = "Compiler"; }
      { name = "ld.lld";       type = "Compiler"; }
      { name = "lto1-ltrans";  type = "Compiler"; }

      # Build systems
      { name = "bazel";  type = "Compiler"; }
      { name = "ninja";  type = "Compiler"; }
      { name = "meson";  type = "Compiler"; }
    ];
  };
}