Run/install php application (shaarli)

I would like to try to run shaarli, that is available as php package but it is not available as nixos option: do I need to manage the configuration of nginx manually or there is some trick that I’m missing (and I was not able to find)


you will need to manage the configuration yourself, possibly creating your own NixOS module. here is a fairly through example.

worth noting is that you will need to pass an environment variable to the php-fpm service that points to your configuration file, as outlined here

before doing this, though, you might want to ping the package maintainer… surely they already have some NixOS configuration making this package usable, otherwise they wouldn’t have packaged it

maybe the two of you can collaborate and publish a flake with the module you come up with, or add the module to nixpkgs

if you get stuck on any of the above points please don’t hesitate to post back here. it’s a helpful community and while sometimes a post gets missed there are many people who are happy to help when you’re in stuck

1 Like

as info for someone else that it wants to try to run shaarli, the application can be installed with a manual configuration, but the thumbnails generation won’t work, as the path configured is hardcoded to cache/ that it has to be both the filepath to save the image and the url used to load the image via http. So if it is changed to /var/lib/shaarli/cache/ to save the images not in the nix store, then the browser will try to read the file from the absolute path /var/lib/shaarli/cache/something.png, instead of http://hostname/cache.
The behavious is part of a dependency, GitHub - ArthurHoaro/web-thumbnailer: PHP library which will retrieve a thumbnail for any given URL, and the key of the configuration is path.cache