{
  config,
  pkgs,
  lib,
  ...
}: let
  waybar_peek = pkgs.stdenv.mkDerivation {
    pname = "waybar-peek";
    version = "main";

    src = pkgs.fetchFromGitHub {
      owner = "waliori";
      repo = "waybar_peek";
      rev = "main"; # You can pin a specific commit hash here for stability
      hash = "sha256-Vd462KxLPqBeSJZ/1A0MChG8Q2XQMiubiKlpdGtZZhw="; # Nix will error on first build and give you the correct hash to paste here
    };

    buildInputs = [pkgs.python3];

    installPhase = ''
      mkdir -p $out/bin
      # Copies the script to the bin directory and ensures it is executable
      cp waybar_peek.py $out/bin/waybar_peek
      chmod +x $out/bin/waybar_peek
    '';
  };
in {
  home.packages = [waybar_peek];
  wayland.windowManager.hyprland.settings = {
    exec-once = ["waybar_peek"];
  };
}
