How to install ReadyMedia on nixOS

ReadyMedia is an open-source implementation of the DLNA (Digital Living Network Alliance) protocol that allows us to stream media files from one device to another. It was formerly known as MiniDLNA. In this tutorial, we will learn how to install and configure ReadyMedia on nixOS.

Requirements

Installation

There are different ways to install ReadyMedia on nixOS, but we will be using nix, a package manager used by nixOS. Here's how to install the package:

  1. Open a terminal on your nixOS system.

  2. Update the package index by running the command:

sudo nix-channel --update
  1. Install the ReadyMedia package by running the command:
sudo nix-env -iA nixos.ready-media
  1. Once the installation is complete, verify that ReadyMedia is installed by running the command:
which minidlnad

This should return the path of minidlnad, which is a server component of ReadyMedia.

Configuration

By default, ReadyMedia is configured to look for media files in the /var/lib/minidlna directory. However, this directory does not exist by default on nixOS, so we must create it first.

  1. Create the directory by running the command:
sudo mkdir -p /var/lib/minidlna
  1. Change the ownership of the directory to the minidlna user by running the command:
sudo chown -R minidlna:minidlna /var/lib/minidlna
  1. Open the ReadyMedia configuration file by running the command:
sudo vi /etc/nixos/configuration.nix
  1. Add the following lines to the file to configure ReadyMedia:
services.minidlna = {
  enable = true;
  mediaDirs = [ "/var/lib/minidlna" ];
  user = "minidlna";
};

This will enable the service, set the media directory to /var/lib/minidlna, and set the user to minidlna. You can add more directories if you want to include more media files.

  1. Save the file and exit the editor.

  2. Apply the changes by running the following command:

sudo nixos-rebuild switch

This will rebuild your system configuration and start the ReadyMedia service.

Testing

Once everything is set up and running, we can test the installation by streaming media files to a DLNA device. Here's how to test:

  1. Make sure that the ReadyMedia service is running by running the command:
systemctl status minidlna

This should show that the service is active and running.

  1. Use a DLNA-enabled device or software to search for and play media files. The device or software should recognize the ReadyMedia server and display the available files for streaming.

Conclusion

In this tutorial, we have learned how to install and configure ReadyMedia on nixOS. You can now enjoy streaming your media files to DLNA devices in your home network.

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!