Enhance Nix package definitions by adding new packages for inputs and steam-python, updating build inputs for colordle and dosage, and improving installation scripts. Notable changes include the addition of desktop and metainfo files for colordle, and ensuring proper GResource handling in dosage.

This commit is contained in:
Danilo Reyes 2025-10-25 20:00:10 -06:00
parent a8e7517e9a
commit d1f011ba1f
6 changed files with 189 additions and 16 deletions

View File

@ -26,26 +26,28 @@ stdenv.mkDerivation rec {
];
buildInputs = [
python3
gtk4
libadwaita
(python3.withPackages (ps: with ps; [
pygobject3
pycairo
]))
];
# This is likely a Python GTK application
installPhase = ''
runHook preInstall
mkdir -p $out/bin $out/share/hexcolordle-gtk
mkdir -p $out/bin $out/share/hexcolordle-gtk $out/share/applications $out/share/metainfo
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
# Install desktop file and metainfo
cp net.krafting.HexColordle.desktop $out/share/applications/
cp net.krafting.HexColordle.metainfo.xml $out/share/metainfo/
# Create wrapper for the main Python file
makeWrapper ${python3.withPackages (ps: with ps; [pygobject3 pycairo])}/bin/python3 $out/bin/hexcolordle-gtk \
--add-flags "$out/share/hexcolordle-gtk/HexColordle.py" \
--prefix PYTHONPATH : "$out/share/hexcolordle-gtk"
runHook postInstall
'';

View File

@ -15,6 +15,7 @@
gtk4,
libadwaita,
wrapGAppsHook4,
makeWrapper,
}:
stdenv.mkDerivation rec {
@ -38,18 +39,30 @@ stdenv.mkDerivation rec {
glib
appstream-glib
appstream
wrapGAppsHook4
];
buildInputs = [
gjs
gtk4
libadwaita
wrapGAppsHook4
glib
];
# Ensure GResource files are properly accessible
postInstall = ''
# The GResource files should be automatically handled by wrapGAppsHook4
# but let's make sure the GResource path is correct
wrapProgram $out/bin/io.github.diegopvlk.Dosage \
--prefix XDG_DATA_DIRS : "$out/share:$GSETTINGS_SCHEMAS_PATH"
'';
meta = {
description = "Medication tracker for Linux";
homepage = "https://github.com/diegopvlk/Dosage";
license = lib.licenses.gpl3Only;
maintainers = with lib.maintainers; [ ];
mainProgram = "dosage";
mainProgram = "io.github.diegopvlk.Dosage";
platforms = lib.platforms.all;
};
}

38
pkgs_wip/inputs.nix Normal file
View File

@ -0,0 +1,38 @@
{
lib,
fetchFromGitHub,
buildPythonPackage,
setuptools,
wheel,
}:
buildPythonPackage rec {
pname = "inputs";
version = "0.5";
pyproject = true;
src = fetchFromGitHub {
owner = "zeth";
repo = "inputs";
rev = "v${version}";
hash = "sha256-tU1R6lhSMZj3Y6XdrT/Yfbte/BdLDvo6TzvLbnr+1vo=";
};
build-system = [
setuptools
wheel
];
pythonImportsCheck = [
"inputs"
];
meta = {
description = "Cross-platform Python support for keyboards, mice and gamepads";
homepage = "https://github.com/zeth/inputs";
changelog = "https://github.com/zeth/inputs/blob/${src.rev}/CHANGELOG.rst";
license = lib.licenses.bsd3;
maintainers = with lib.maintainers; [ CaptainJawZ ];
mainProgram = "inputs";
};
}

View File

@ -2,6 +2,7 @@
lib,
buildPythonApplication,
fetchFromGitHub,
callPackage,
setuptools,
pyside6,
pyxdg,
@ -41,8 +42,8 @@ buildPythonApplication rec {
requests
vdf
zstandard
# Note: inputs and steam dependencies removed as they're not in nixpkgs
# May need to add them back if they become available in nixpkgs
(callPackage ./inputs.nix { })
(callPackage ./steam-python.nix { })
];
meta = {
@ -50,6 +51,6 @@ buildPythonApplication rec {
homepage = "https://github.com/DavidoTek/ProtonUp-Qt";
license = lib.licenses.gpl3Only;
maintainers = with lib.maintainers; [ CaptainJawZ ];
mainProgram = "proton-up-qt";
mainProgram = "protonup-qt";
};
}

59
pkgs_wip/steam-python.nix Normal file
View File

@ -0,0 +1,59 @@
{
lib,
buildPythonPackage,
fetchFromGitHub,
callPackage,
setuptools,
wheel,
six,
pycryptodomex,
requests,
urllib3,
vdf,
gevent,
protobuf,
cachetools,
cryptography,
}:
buildPythonPackage rec {
pname = "steam-python";
version = "1.4.4";
pyproject = true;
src = fetchFromGitHub {
owner = "ValvePython";
repo = "steam";
rev = version;
hash = "sha256-OY04GsX3KMPvpsQl8sUurzFyJu+JKpES8B0iD6Z5uyw=";
};
build-system = [
setuptools
wheel
];
dependencies = [
six
pycryptodomex
requests
urllib3
vdf
gevent
protobuf
cachetools
cryptography
(callPackage ../pkgs_pr/gevent-eventemitter.nix { })
];
pythonImportsCheck = [
"steam"
];
meta = {
description = "Python package for interacting with Steam";
homepage = "https://github.com/ValvePython/steam";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ CaptainJawZ ];
};
}

60
pkgs_wip/steam.nix Normal file
View File

@ -0,0 +1,60 @@
{
lib,
buildPythonPackage,
fetchFromGitHub,
callPackage,
setuptools,
wheel,
six,
pycryptodomex,
requests,
urllib3,
vdf,
gevent,
protobuf,
cachetools,
cryptography,
gevent-eventemitter,
}:
buildPythonPackage rec {
pname = "steam-python";
version = "1.4.4";
pyproject = true;
src = fetchFromGitHub {
owner = "ValvePython";
repo = "steam";
rev = version;
hash = "sha256-OY04GsX3KMPvpsQl8sUurzFyJu+JKpES8B0iD6Z5uyw=";
};
build-system = [
setuptools
wheel
];
dependencies = [
six
pycryptodomex
requests
urllib3
vdf
gevent
protobuf
cachetools
cryptography
gevent-eventemitter
];
pythonImportsCheck = [
"steam"
];
meta = {
description = "Python package for interacting with Steam";
homepage = "https://github.com/ValvePython/steam";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ CaptainJawZ ];
};
}