version "1.2.0"
default-hash-algorithm BLAKE3

patches {
  adios "./patches/adios.patch"
  kservice_fix "./patches/kservice_fix.patch"
  mpv_buffers_fix "https://patch-diff.githubusercontent.com/raw/mpv-player/mpv/pull/17303.patch" // TODO: Remove this and mpv from manifest when mpv 0.42 is released
  //nix_odysseus "https://patch-diff.githubusercontent.com/raw/pewdiepie-archdaemon/odysseus/pull/2568.patch" // See 2567 also
}

inputs {
  nixpkgs {
    archive {
      url "https://github.com/NixOS/nixpkgs/archive/{{fresh_value}}.tar.gz"
    }
    fresh-cmd {
      $ git ls-remote --branches "https://github.com/NixOS/nixpkgs.git" --refs "refs/heads/nixpkgs-unstable"
      | cut -f1
    }
  }

  home-manager {
    archive {
      url "https://github.com/nix-community/home-manager/archive/{{fresh_value}}.tar.gz"
    }
    fresh-cmd {
      $ git ls-remote --branches "https://github.com/nix-community/home-manager.git" --refs "refs/heads/master"
      | cut -f1
    }
  }

  catppuccin {
    archive {
      url "https://github.com/catppuccin/nix/archive/{{fresh_value}}.tar.gz"
    }
    fresh-cmd {
      $ git ls-remote --branches "https://github.com/catppuccin/nix.git" --refs "refs/heads/main"
      | cut -f1
    }
  }

  nix-cachyos-kernel {
    archive {
      url "https://github.com/xddxdd/nix-cachyos-kernel/archive/{{fresh_value}}.tar.gz"
    }
    fresh-cmd {
      $ git ls-remote --branches "https://github.com/xddxdd/nix-cachyos-kernel.git" --refs "refs/heads/release"
      | cut -f1
    }
  }

  nix-cachyos-settings {
    archive {
      url "https://github.com/Daaboulex/cachyos-settings-nix/archive/{{fresh_value}}.tar.gz"
    }
    patches adios
    fresh-cmd {
      $ git ls-remote --branches "https://github.com/Daaboulex/cachyos-settings-nix.git" --refs "refs/heads/main"
      | cut -f1
    }
  }

  dolphin-overlay {
    archive {
      url "https://github.com/rumboon/dolphin-overlay/archive/{{fresh_value}}.tar.gz"
    }
    patches kservice_fix
    fresh-cmd {
      $ git ls-remote --branches "https://github.com/rumboon/dolphin-overlay.git" --refs "refs/heads/main"
      | cut -f1
    }
  }

  nix-citizen {
    archive {
      url "https://github.com/LovingMelody/nix-citizen/archive/{{fresh_value}}.tar.gz"
    }
    fresh-cmd {
      $ git ls-remote --branches "https://github.com/LovingMelody/nix-citizen.git" --refs "refs/heads/main"
      | cut -f1
    }
  }

  nix-gaming {
    archive {
      url "https://github.com/fufexan/nix-gaming/archive/{{fresh_value}}.tar.gz"
    }
    fresh-cmd {
      $ git ls-remote --branches "https://github.com/fufexan/nix-gaming.git" --refs "refs/heads/master"
      | cut -f1
    }
  }

  nix-spicetify {
    archive {
      url "https://github.com/Gerg-L/spicetify-nix/archive/{{fresh_value}}.tar.gz"
    }
    fresh-cmd {
      $ git ls-remote --branches "https://github.com/Gerg-L/spicetify-nix.git" --refs "refs/heads/master"
      | cut -f1
    }
  }
  spotneotify {
    archive {
      url "https://github.com/0lswitcher/spotneotify/archive/{{fresh_value}}.tar.gz"
    }
    fresh-cmd {
      $ git ls-remote --branches "https://github.com/0lswitcher/spotneotify.git" --refs "refs/heads/main"
      | cut -f1
    }
  }
/*
  odysseus {
    archive {
      url "https://github.com/pewdiepie-archdaemon/odysseus/archive/{{fresh_value}}.tar.gz"
    }
    patches nix_odysseus
    fresh-cmd {
      $ git ls-remote --branches "https://github.com/pewdiepie-archdaemon/odysseus.git" --refs "refs/heads/dev"
      | cut -f1
    }
  }
*/
  // Packages
  ani-cli-git {
    archive {
      url "https://github.com/pystardust/ani-cli/archive/{{fresh_value}}.tar.gz"
    }
    fresh-cmd {
      $ git ls-remote --branches "https://github.com/pystardust/ani-cli.git" --refs "refs/heads/master"
      | cut -f1
    }
  }
  mpv {
    archive {
      url "https://github.com/mpv-player/mpv/archive/refs/tags/v0.41.0.tar.gz"
    }
    patches mpv_buffers_fix
  }
  mesa-git {
    archive {
      url "https://gitlab.freedesktop.org/mesa/mesa/-/archive/{{fresh_value}}/mesa-{{fresh_value}}.tar.gz"
    }
    // This uses the last commit of last month
    fresh-cmd {
      $ curl -s "https://gitlab.freedesktop.org/api/v4/projects/mesa%2Fmesa/repository/commits" \
      -G --data-urlencode "ref_name=main" \
      --data-urlencode "until=$(date -d \"$(date +%Y-%m-01)\" +%Y-%m-%dT%H:%M:%S%z)" \
      --data-urlencode "per_page=1"
      | jq -r ".[0].id"
    }
  }
  low_latency_layer-git {
    archive {
      url "https://github.com/Korthos-Software/low_latency_layer/archive/{{fresh_value}}.tar.gz"
    }
    fresh-cmd {
      $ git ls-remote --branches "https://github.com/Korthos-Software/low_latency_layer.git" --refs "refs/heads/main"
      | cut -f1
    }
  }
  lsfg-vk-git {
    archive {
      url "https://github.com/PancakeTAS/lsfg-vk/archive/{{fresh_value}}.tar.gz"
    }
    fresh-cmd {
      $ git ls-remote --branches "https://github.com/PancakeTAS/lsfg-vk.git" --refs "refs/heads/develop"
      | cut -f1
    }
  }
  // Patches
  lact-patch { // TODO: Remove this when upstream releases a new version
    file {
      url "https://patch-diff.githubusercontent.com/raw/ilya-zlobintsev/LACT/pull/1080.patch"
    }
  }

  // Others
  catppuccin-godot {
    file {
      url "https://raw.githubusercontent.com/catppuccin/godot/{{fresh_value}}/themes/Catppuccin Mocha.tet"
    }
    fresh-cmd {
      $ git ls-remote --branches "https://github.com/catppuccin/godot.git" --refs "refs/heads/main"
      | cut -f1
    }
  }
}
