How to Install ntfy on NixOS Latest

ntfy is a command-line notification tool for Linux and macOS that can be used to monitor long-running commands and display desktop notifications upon completion or failure. In this tutorial, we will provide you with step-by-step instructions on how to install ntfy on NixOS Latest.

Prerequisites

Before we begin, you should have a user account with sudo privileges on your NixOS system.

Step 1: Update your System

First, update your system's package database:

sudo nix-channel --update
sudo nix-env -iA nixpkgs.nix
sudo nixos-rebuild switch

Step 2: Install ntfy

Run the following command to install ntfy:

sudo nix-env -iA nixpkgs.ntfy

Step 3: Verify the Installation

After installing ntfy, you can verify the installation by running the ntfy command:

ntfy -h

This command will display ntfy's help menu. If the installation was successful, you should see the help information printed in your terminal.

Step 4: Configure ntfy

ntfy needs to be configured before you can use it. You can create a configuration file at ~/.config/ntfy/config.yml by running the following command:

mkdir -p ~/.config/ntfy
echo 'engine: auto' > ~/.config/ntfy/config.yml

This will create a configuration file with the default settings and specify the engine to use for notifications.

Step 5: Test ntfy

You can test ntfy by running a command that takes a long time to complete, such as sleep. For example:

sleep 10 && ntfy send "Completed"

This command will sleep for ten seconds and then notify you when it is complete.

Congratulations! You have successfully installed and configured ntfy on NixOS Latest. You can now use ntfy to monitor your long-running commands and receive desktop notifications upon completion or failure.

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!