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
- A running nixOS system.
- A computer or device to use for media streaming.
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:
Open a terminal on your nixOS system.
Update the package index by running the command:
sudo nix-channel --update
- Install the ReadyMedia package by running the command:
sudo nix-env -iA nixos.ready-media
- 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.
- Create the directory by running the command:
sudo mkdir -p /var/lib/minidlna
- Change the ownership of the directory to the minidlna user by running the command:
sudo chown -R minidlna:minidlna /var/lib/minidlna
- Open the ReadyMedia configuration file by running the command:
sudo vi /etc/nixos/configuration.nix
- 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.
Save the file and exit the editor.
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:
- 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.
- 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.