Add Nix support with Nix flake
Is your feature request related to a problem? Please describe. Currently, the app is not available in Nixpkgs. This means that it is not easily accessible for people using Nix (NixOS, nix-darwin, Home Manager, or just Nix package manager).
Of course, as a Python app, it can still be installed with uv, pipx, pip, etc., but it is not fully declarative and reproducible, which is a main selling point for using Nix.
Also, it might require external non-Python dependencies such as exiftool and poppler-utils. These dependencies must be installed separately, which is not ideal.
Describe the solution you'd like
The repository could be converted to Nix flake by adding flake.nix in the root directory. This flake would expose a Nix package (derivation) for the organize app. The package definition could be placed directly in flake.nix or in a separate file (e.g., package.nix) for better readability.
This would allow Nix folks to run the app directly from a repo URL:
nix run github:tfeldmann/organize -- run
Or to create a shell where the organize executable is available:
nix shell github:tfeldmann/organize
Or to include it in a NixOS / nix-darwin / Home Manager configuration.
Additionally, the default package provided by the flake would include exiftool and poppler-utils. These tools would be only available for the organize package (not in the global namespace).
The flake could also expose the second package (e.g., minimal) without exiftool and poplar-utils. It would be called as follows:
nix run github:tfeldmann/organize#minimal -- run
Describe alternatives you've considered
- Building the Nix package locally by myself.
This is what I am doing right now, and what probably most people who want to install this app in a Nix way are doing.
For reference, here is my package definition for organize.
This works, but it was not super straightforward (at least for me). Mainly because besides the organize app itself, some dependencies are also not available in Nixpkgs and must be built first. This includes:
mdfind-wrapper(required bymacos-tags)macos-tagssimplematch
Additionally, there were issues with versions of dependencies due to the upper bounds being too restrictive for newer versions in Nixpkgs.
I would still consider myself a Nix noob and it was the first app I packed, but I managed to work it out eventually. I would be happy to contribute so that it would be easier for other people to use it with Nix.
- Publishing as an official package to Nixpkgs.
This is an option, but it would require publishing multiple packages, because of the required dependencies that are not in Nixpkgs (described above). Some of these dependencies look quite dated (5-6 years), and I am not sure they are still maintained. Also, these dependencies aren't super popular, so I am not sure if they would be accepted for Nixpkgs.
Additional context I will provide a PR for this if the described approach is accepted. @tfeldmann let me know what you think!
@tfeldmann any thoughts on this? Are you interested in a PR or should we close the issue?