scripts/pkgs_wip/colordle.nix

63 lines
1.5 KiB
Nix

{
lib,
stdenv,
fetchFromGitLab,
makeWrapper,
python3,
gtk4,
libadwaita,
wrapGAppsHook4,
}:
stdenv.mkDerivation rec {
pname = "hexcolordle-gtk";
version = "1.0.3";
src = fetchFromGitLab {
owner = "Krafting";
repo = "hexcolordle-gtk";
rev = version;
hash = "sha256-oPGC0D7sh+H25qg2ttRtIMjI+HjZImRieWmYw+I6sQE=";
};
nativeBuildInputs = [
makeWrapper
wrapGAppsHook4
];
buildInputs = [
python3
gtk4
libadwaita
];
# This is likely a Python GTK application
installPhase = ''
runHook preInstall
mkdir -p $out/bin $out/share/hexcolordle-gtk
cp -r * $out/share/hexcolordle-gtk/
# Create a wrapper script if there's a main Python file
if [ -f main.py ]; then
makeWrapper ${python3}/bin/python3 $out/bin/hexcolordle-gtk \
--add-flags "$out/share/hexcolordle-gtk/main.py"
elif [ -f hexcolordle.py ]; then
makeWrapper ${python3}/bin/python3 $out/bin/hexcolordle-gtk \
--add-flags "$out/share/hexcolordle-gtk/hexcolordle.py"
fi
runHook postInstall
'';
meta = {
description = "A game where you need to find a color by guessing its hex code";
homepage = "https://gitlab.com/Krafting/hexcolordle-gtk";
changelog = "https://gitlab.com/Krafting/hexcolordle-gtk/-/blob/${src.rev}/NEWS";
license = lib.licenses.gpl3Only;
maintainers = with lib.maintainers; [ ];
mainProgram = "hexcolordle-gtk";
platforms = lib.platforms.all;
};
}