I use thumbsup to manage my gallery site. Since the site is entirely static, I use exiftool to store the description and tags as metadata in the images themselves. To simplify managing the metadata I wrote a small Symfony application that writes and updates the metadata from CSV files.
The workflow is straightforward enough, but the code deployment on my laptop looked like a messy bedroom. The Symfony application lived in one directory. My fork of thumbsup, supporting custom album covers, was hanging out within .nvm
, tied to given versions of NodeJS. My customization of the cards theme lived in a separate directory, passed by argument to the Symfony application. This was messy and unsustainable.
I’ve used Nix for several other projects, and this felt like a good use case for getting everything in once place. In this case, I would centralize in the Symfony directory. First step: adding all the relevant packages:
1 | outputs = { self, nixpkgs, flake-utils, phps }: |
Next, I create a stub package.json to define the dependencies for thumbsup and the cards theme:
1 | { |
Finally, I modified the Symfony application to use the locally-installed thumbsup instead of the globally-installed thumbsup:
1 | $command = "npx thumbsup"; |
Now, when I run nix develop
, it will set up PHP, NodeJS, yarn, exiftool, and GraphicsMagick, and clone my custom respositories locally. Next step is getting on to a higher version of PHP and Symfony, but it’ll be in a clean environment.