This tutorial will guide you through the process of installing GNU FM on a NixOS system. GNU FM is an open-source music player that allows users to create and listen to online radio stations.
Before you begin, you will need the following:
Before installing GNU FM, make sure your system is up to date. Run the following command as root:
sudo nix-channel --update && sudo nixos-rebuild switch
GNU FM requires a few packages to be installed before it can be installed. These packages are php
, php-fpm
, and postgresql
. Run the following command as root to install these packages:
sudo nix-env -iA nixos.php nixos.phpFpm nixos.postgresql
Now that the required packages are installed, you can install GNU FM. Run the following command as root:
sudo nix-env -iA nixos.gnu-fm
GNU FM uses PostgreSQL to store data. You need to create a new user and database for GNU FM.
Run the following command as root to enter the PostgreSQL prompt:
sudo -u postgres psql
Create a new user with the following command:
create user gnumusic with password 'yourpasswordhere';
Create a new database with the following command:
create database gnumusic owner gnumusic;
Finally, exit the PostgreSQL prompt with the following command:
\q
You need to configure GNU FM to use the PostgreSQL database you just created.
Edit the GNU FM configuration file /etc/gnufm/config.inc.php
with your favorite text editor:
sudo nano /etc/gnufm/config.inc.php
Find the following lines:
$db_host = '';
$db_port = '';
$db_name = '';
$db_user = '';
$db_password = '';
And replace them with:
$db_host = 'localhost';
$db_port = '';
$db_name = 'gnumusic';
$db_user = 'gnumusic';
$db_password = 'yourpasswordhere';
Save and exit the file.
Finally, start the GNU FM service with the following command:
sudo systemctl start gnufm
You can now access GNU FM by visiting http://localhost:8000/
in your web browser.
Congratulations! You have successfully installed GNU FM on a NixOS system.
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!
Alternatively, for the best virtual desktop, try Shells!