How to Install Socialhome on NixOS Latest
Socialhome is a free and open-source, decentralized social network server. This tutorial will guide you on how to install Socialhome on NixOS Latest.
Prerequisites
Before you start the installation process, ensure you have the following:
- A virtual or dedicated server running NixOS Latest
- A user account with root privileges
Step 1: Enable NixOS UNSTABLE channel
By default, NixOS Latest comes with the latest stable version of Socialhome. For the latest version, you need to enable the NixOS UNSTABLE channel. Run the following command in your terminal:
sudo nix-channel --add https://nixos.org/channels/nixos-unstable nixos-unstable
sudo nix-channel --update
Step 2: Install Socialhome
To install Socialhome, execute the following command:
sudo nix-env -iA nixos-unstable.socialhome
Step 3: Configure Socialhome
Next, we need to create a configuration file for Socialhome. Create a new file /etc/socialhome/configuration.nix or edit the existing one and add the following lines:
{ config, pkgs, ... }:
{
services.socialhome = {
enable = true;
httpConfig.forceSSL = true; # Enable SSL (recommended)
# A list of domains that your Socialhome instance should respond to
# This should be your domain name or IP
domains = ["example.com"];
# The database configuration
database = {
enablePostgresql = true; # Use PostgreSQL as the backend
passwordFile = "/run/secrets/socialhome-postgres-pass"; # Set a password file
};
# Configure the SMTP server for outgoing mail
mail = {
# Enable SMTP
enable = true;
addresses = ["smtp.gmail.com"]; # Your SMTP server
port = 587;
authentication = "login";
username = "[email protected]";
passwordFile = "/run/secrets/socialhome-mail-pass"; # Set your own password file
fromAddress = "[email protected]"; # Your email address
fromName = "Your Name";
};
# The URL prefix for the Socialhome instance
baseurl = "/socialhome/";
# Socialhome authentication configuration
authentication = {
enableEmailSignIn = true;
};
};
}
Please remember to replace the values with your own SMTP server, email address, domain name, and password file.
Step 4: Restart the NixOS service
Finally, restart the NixOS service with the following command:
sudo systemctl restart nixos.service
Step 5: Access Socialhome
Once the installation and configuration process is complete, you can access the Socialhome web interface by visiting http://<IP_address>:8000/socialhome/ or https://<your_domain_name>/socialhome/ if you enabled SSL.
That's it! You have successfully installed Socialhome on NixOS Latest.