Installing Thumbor on NixOS Latest
Thumbor is an open-source image manipulation tool that lets you crop, resize and filter images on the fly. It supports many image formats and can be used with various programming languages.
Here's a step-by-step guide to installing Thumbor on NixOS Latest:
Step 1: Install NixOS Latest
If you haven't already, you need to install NixOS Latest on your machine. Follow the installation guide on https://nixos.org/manual/nixos/stable/index.html.
Step 2: Configure Nixpkgs
Configure Nixpkgs to install Thumbor. Create a new configuration.nix file in /etc/nixos/ and add the following lines:
{ pkgs, ... }: {
environment.systemPackages = with pkgs; [
thumbor
];
}
Save and exit the file.
Step 3: Install Thumbor
Run the following command to install Thumbor:
$ nixos-rebuild switch
This will install Thumbor and all its dependencies.
Step 4: Configure Thumbor
The default configuration file for Thumbor is located at /etc/thumbor.conf. You can customize this file to suit your needs. For example:
ALLOWED_SOURCES = [
"source.com"
]
MAX_WIDTH = 1000
MAX_HEIGHT = 1000
QUALITY = 85
This configuration allows only image sources from source.com, sets a maximum width and height of 1000 pixels, and sets the image quality to 85%.
Step 5: Start Thumbor
To start Thumbor, run the following command:
$ sudo systemctl enable thumbor && sudo systemctl start thumbor
This will start the Thumbor service and enable it to start automatically on boot.
Conclusion
That's it! You have successfully installed and configured Thumbor on NixOS Latest. You can now start serving images with Thumbor.