Add Nix packaging#1018
Conversation
|
Hello, It's hard for me to review this PR in any significant way, as I'm not really a linux person, and don't really know what dangers this change may bring to the repository. If someone with more knowledge would review this one, that'd be great. One thing for sure though - patching any Python files, in any way, is never a good solution to a problem, and this PR won't be accepted until that's either removed or refactored. If you need a way to detect a specific situation and change some values accordingly, this needs to be done from within the Python file itself, not from an external install script. Lastly, since |
|
I use Linux, but I'm not familiar with Nix packaging, so I'm afraid I won't be useful to review the actual packaging steps.
Well, glibc pretty much guarantees forwards-compatibility, so this should only be an issue if the glibc on your system is older than the one we use to create the PyInstaller binary - glibc 2.35 currently, from Ubuntu 22.04, released in 2022. As for I worked on adding Linux support in the beginning, and back then my goal was to have the Linux version behaving exactly the same as the Windows version, and that meant having a portable executable with config files saved next to that executable, instead of And I honestly think it's too late to change that behavior to something else. And while I understand this PR only changes this behavior for Nix, in my opinion TwitchDropsMiner is not meant to be "installed" (in the traditional Linux sense). |
Hello! This PR adds Nix packaging to make it easy for NixOS and Nix package manager users to install and run the application.
Currently, the pre-compiled Linux PyInstaller binaries can conflict with system libraries (like
glibcandlibmount) on NixOS. This allows users to build and run the app natively from the source with all dependencies correctly isolated.What's included:
flake.nix&nix/package.nix: The Nix derivation that builds the Python app, wraps GTK for the system tray to work properly, and creates a.desktopshortcut with the app icon.CI check: Added a smallnix buildstep to.github/workflows/ci.ymlto ensure the flake package doesn't accidentally break on future commits.README.md: Added a short, collapsible example showing Nix users how to run or install it.Note on the Nix patch:
Because Nix installs applications into a globally read-only directory (
/nix/store), the app would crash when trying to writelock.fileorsettings.jsonnext tomain.py. To fix this, the Nix build dynamically patchesconstants.pyduring installation to setWORKING_DIRto~/.config/twitch-drops-miner/(viaXDG_CONFIG_HOME). This ensures all user data is safely written to their home directory.Let me know if you have any questions or need any changes!