From d1f011ba1fc622dcac560c92e0aa74d5f85e8911 Mon Sep 17 00:00:00 2001 From: Danilo Reyes Date: Sat, 25 Oct 2025 20:00:10 -0600 Subject: [PATCH] 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. --- pkgs_wip/colordle.nix | 24 +++++++++------- pkgs_wip/dosage.nix | 17 +++++++++-- pkgs_wip/inputs.nix | 38 +++++++++++++++++++++++++ pkgs_wip/protonup-qt.nix | 7 +++-- pkgs_wip/steam-python.nix | 59 ++++++++++++++++++++++++++++++++++++++ pkgs_wip/steam.nix | 60 +++++++++++++++++++++++++++++++++++++++ 6 files changed, 189 insertions(+), 16 deletions(-) create mode 100644 pkgs_wip/inputs.nix create mode 100644 pkgs_wip/steam-python.nix create mode 100644 pkgs_wip/steam.nix diff --git a/pkgs_wip/colordle.nix b/pkgs_wip/colordle.nix index e8dcf2b..255cbe0 100644 --- a/pkgs_wip/colordle.nix +++ b/pkgs_wip/colordle.nix @@ -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 ''; diff --git a/pkgs_wip/dosage.nix b/pkgs_wip/dosage.nix index c7d6eb0..10176f3 100644 --- a/pkgs_wip/dosage.nix +++ b/pkgs_wip/dosage.nix @@ -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; }; } diff --git a/pkgs_wip/inputs.nix b/pkgs_wip/inputs.nix new file mode 100644 index 0000000..79e08be --- /dev/null +++ b/pkgs_wip/inputs.nix @@ -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"; + }; +} diff --git a/pkgs_wip/protonup-qt.nix b/pkgs_wip/protonup-qt.nix index db72a6d..f9f191c 100644 --- a/pkgs_wip/protonup-qt.nix +++ b/pkgs_wip/protonup-qt.nix @@ -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"; }; } diff --git a/pkgs_wip/steam-python.nix b/pkgs_wip/steam-python.nix new file mode 100644 index 0000000..bf4553c --- /dev/null +++ b/pkgs_wip/steam-python.nix @@ -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 ]; + }; +} diff --git a/pkgs_wip/steam.nix b/pkgs_wip/steam.nix new file mode 100644 index 0000000..f1f5836 --- /dev/null +++ b/pkgs_wip/steam.nix @@ -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 ]; + }; +}