How to Install Elixir on NixOS Latest

Introduction

Elixir is a functional programming language designed for building scalable and fault-tolerant applications. If you are a NixOS user, it is easy to install Elixir using the Nix package manager. In this tutorial, we will show you how to install Elixir from https://elixi.re on NixOS Latest.

Prerequisites

Before you start, you need to have a running NixOS latest installed on your system with an internet connection to download Elixir.

Step 1: Install Elixir

In order to install Elixir, you will need to add the Elixir package to your NixOS configuration. Open your configuration.nix file using your preferred text editor:

sudo nano /etc/nixos/configuration.nix

Next, add the following code block to your NixOS configuration file:

  environment.systemPackages = with pkgs; [
    elixir
  ];

Save and close the file, then run the following command to update your NixOS environment:

sudo nixos-rebuild switch

This command will install Elixir on your system. After the installation is complete, you can verify that Elixir is correctly installed on your system by running the following command:

elixir --version

You should see output similar to the following:

Elixir x.x.x (compiled with OTP x.x.x)

Step 2: Verify Your Elixir Installation

To verify that Elixir is working correctly, you can run iex, which stands for Interactive Elixir. This command will open the interactive Elixir shell.

iex

You should see output similar to the following:

Erlang/OTP xx [erts-xx.xx] [source] [smp:xx:xx] [xxxxxx] [xxx-bit] [xxx.x.x.x] [xxxxxx]

Interactive Elixir (x.x.x) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)>

Congratulations, you have successfully installed Elixir on NixOS Latest.

Conclusion

In this tutorial, we have shown you how to install Elixir on NixOS Latest. If you have any questions, please feel free to ask in the comments below. We hope you found this tutorial helpful!

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!