Lmod is a modern replacement for the Environment Modules package that was first developed at the Texas Advanced Computing Center (TACC). It is a tool that helps manage your Linux environment by streamlining the exporting of environment variables, switching between different versions of installed software, and organizing dependencies. In this tutorial, we will explain how to install Lmod on NixOS Latest.
Before you begin this tutorial, you need to ensure that you have the following:
You should always update your system before installing anything; this ensures that you have the latest packages available.
Use the following command:
sudo nixos-rebuild switch --upgrade
Use the following command to install Lmod:
sudo nix-env -iA nixpkgs.environment-modules
Create a directory for the Lmod configuration file:
sudo mkdir -p /etc/lmod.d
Create an Lmod configuration file:
sudo touch /etc/lmod.d/lmod.conf
Open the file in your text editor and add the following lines:
### /etc/lmod.d/lmod.conf
module_style lmod
prepend_path("MODULEPATH", "/usr/share/Modules/modulefiles")
Save and close the file.
Use the module
command to load and unload modules. For example,
module load python
will load Python along with any dependencies it requires.
module unload python
will unload Python and its dependencies.
Lmod is a valuable tool for environment management, providing streamlined methods for managing dependencies and software versioning. By following this tutorial, you have successfully installed and configured Lmod on NixOS Latest.
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!