{ pkgs }:

pkgs.stdenv.mkDerivation {
  pname = "hakase-plymouth-theme";
  version = "1.0";

  src = ./themes/hakase;

  installPhase = ''
    mkdir -p $out/share/plymouth/themes/hakase
    cp * $out/share/plymouth/themes/hakase/
    
    # Patch the .plymouth file to point to the store path
    sed -i "s@ImageDir=.*@ImageDir=$out/share/plymouth/themes/hakase@" $out/share/plymouth/themes/hakase/hakase.plymouth
    sed -i "s@ScriptFile=.*@ScriptFile=$out/share/plymouth/themes/hakase/hakase.script@" $out/share/plymouth/themes/hakase/hakase.plymouth
  '';
}
