Swift is a highly available, distributed, and eventually consistent object/blob store. It is open source and part of the OpenStack project. In this tutorial, we will go through the steps to install Swift on NixOS Latest.
If NixOS is not installed on your system, you can download the latest image from the official website and follow the installation instructions.
Before we can install Swift, we need to install its dependencies. Open the terminal and run the following command:
$ sudo nix-env -iA nixos.openstack-swift
This command will install all the necessary packages for Swift to run on NixOS.
After installing the Swift dependencies, we need to configure Swift. Open the /etc/swift/proxy-server.conf file:
$ sudo nano /etc/swift/proxy-server.conf
Add the following configuration:
[DEFAULT]
bind_port = 8080
workers = 2
[pipeline:main]
pipeline = catch_errors gatekeeper healthcheck proxy-logging cache container_sync bulk tempurl ratelimit authtoken keystoneauth copy container_quotas account_quotas slo dlo versioned_writes proxy-logging proxy-server
[app:proxy-server]
use = egg:swift#proxy
account_autocreate = true
allow_account_management = true
account_listing_limit = 10000
Save and close the file.
After configuring Swift, we can start the server. Run the following command to start the Swift proxy server:
$ sudo swift-init proxy start
This will start the Swift proxy server with the configuration we specified in the previous step.
To verify the Swift installation, we can use the Swift command line interface. Run the following command to see if Swift is working:
$ swift stat
This command should return information about the Swift installation.
Congratulations! You have successfully installed and configured Swift on NixOS Latest.
If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!