Open pbek opened 1 month ago
I had not any luck yet with https://github.com/pbek/nixcfg/blob/main/apps/jimmy/default.nix, is there maybe a python application that you know that is built similarly and that is present on https://search.nixos.org/packages?channel=unstable?
I have no knowledge of python packaging (I didn't even know about PyInstaller) and no experience in nix python packaging. 😅
I'm not really familiar with the NixOS build system. I will check for similar applications (but probably only tomorrow).
There are two ways to distribute the script/app:
pip install -r requirements/requirements.txt
and running the script python src/jimmy_cli.py
.As far as I read, is buildPythonApplication
using pyinstaller
.
Btw. yesterday, I installed nix on an Ubuntu system. 😉 https://nixos.org/download/
I also installed https://github.com/direnv/direnv.
In combination, you can use it to get a specific set of tools in a certain directory. When you leave the directory, those packages are gone again. So you can use different versions of node, ruby, php, python, ... in different projects without complications. 😉
https://wiki.nixos.org/wiki/Packaging/Python could help with the packaging.
I tried to read around a bit, but didn't get a clue. A similar project could be https://github.com/NixOS/nixpkgs/blob/nixos-unstable/pkgs/applications/office/zim/default.nix. But not sure if it's really similar in terms of packaging. I guess the problem is that the pyproject.toml
is not used for packaging this project, but just for some configuration.
The idea behind building a single binary was to not mess around with any OS or distribution specific things and having to maintain a single release path only. Is it possible to simply execute or wrap a binary in NixOS?
The idea behind building a single binary was to not mess around with any OS or distribution specific things and having to maintain a single release path only. Is it possible to simply execute or wrap a binary in NixOS?
Those binaries still depend on e.g. static glibc paths, which doesn't work on NixOS. With nix everything is built depending on patch in the nix-store, thus every e.g. application can depend on even different version of a library.
Usually, python applications are built directly for nixpkgs. I don't know if a wrapper like for e.g. packages that directly download a .deb
file would be acceptable. Nix is also present on macOS!
It would be great to have a package for jimmy in https://github.com/NixOS/nixpkgs (the largest package repository).