How to Install Selfoss on nixOS Latest

Selfoss is a web-based RSS reader and multi-source news reader for Linux. In this tutorial, we will walk you through the steps needed to install Selfoss on nixOS Latest.

Before we start, make sure that you have nixOS Latest installed on your system.

Step 1: Update nixOS System

The first step is to update your nixOS system to the latest version. To do that, open the terminal and run the following command:

sudo nix-channel --update && sudo nixos-rebuild switch

This will update your nixOS system to the latest version.

Step 2: Install Selfoss

To install Selfoss, we will create a new .nix file with the Selfoss dependencies and install it using the nix package manager.

  1. Create a new file named selfoss.nix in your home directory using your favorite editor:
nano ~/selfoss.nix
  1. Copy and paste the following code into the file:
{ pkgs ? import <nixpkgs> {} }:

pkgs.dockerTools.buildImage {
  name = "selfoss";
  tag = "latest";
  contents = [
    pkgs.curl
    pkgs.mediainfo
    pkgs.nano
    pkgs.nodejs-12_x
    pkgs.php
    pkgs.phpPackages.php-mcrypt
    pkgs.phpPackages.php-sqlite3
    pkgs.phpPackages.php-xml
    pkgs.phpPackages.php-zip
    pkgs.phpPackages.twig
  ];

  config.Cmd = [ "php" "index.php" "-c" "/etc/php.ini" ];
}
  1. Save and close the file.

  2. To build the Selfoss image, run the following command:

nix-build ~/selfoss.nix -A buildImage
  1. Once the image has been built, you can run it using the following command:
docker run --name selfoss -p 80:80 selfoss:latest

This will start the Selfoss daemon. You can now access the Selfoss web interface by navigating to http://localhost/ on your web browser.

Step 3: Configure Selfoss

Selfoss configuration file is located in the root directory of the Selfoss installation. To access it, run the following command:

docker exec -it selfoss bash

This will take you to the Selfoss container's command line.

Once you're in the container's command line, run the following command to configure the Selfoss settings:

php index.php settings --set base_url http://localhost

This will set the Selfoss base URL to http://localhost. You can customize other settings by running the same command and changing the base_url argument.

Conclusion

In this tutorial, we walked through the steps required to install Selfoss on nixOS Latest. We created a .nix file with the Selfoss dependencies and installed it using the nix package manager. We also showed you how to configure Selfoss settings to set the base URL. If you encounter any errors during the installation process, be sure to check the Selfoss documentation for troubleshooting advice.

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!