How to Install Tania on NixOS

Tania is an open-source farming management system that allows users to manage their farms and crops from a single platform. In this tutorial, we will show you how to install Tania on NixOS latest.

Prerequisites

Before we proceed with the installation, ensure you have the following:

Step 1: Update Your System

The first step is to update your system to ensure all packages are up-to-date. Run the following command:

sudo nixos-rebuild switch --upgrade

This command will download the latest version of Nixpkgs and update your system packages.

Step 2: Install Tania's Dependencies

Tania requires PHP 7.3+, Composer, and MySQL as its dependencies. To install these dependencies, run the following command:

sudo nix-env -iA nixos.php \
nixos.composer \
nixos.mysql

This command will install PHP, Composer, and MySQL on your system.

Step 3: Install Tania

To install Tania, you need to clone the repository from GitHub and pull the latest version. Run the following commands:

git clone https://github.com/Tanibox/tania-core.git
cd tania-core
sudo git pull

After pulling the latest version, run the following command to install the required dependencies:

sudo composer install

This command will install all the dependencies and required packages.

Step 4: Configure Tania

Next, you need to configure Tania by creating the .env file. Copy the .env.sample file and rename it to .env. Run the following:

sudo cp .env.sample .env

Then, open the file with your preferred editor and modify the following values:

APP_NAME
APP_URL
DB_DATABASE
DB_USERNAME
DB_PASSWORD

Ensure you replace the default values with appropriate values for your server.

Step 5: Create the Tania Database

To create the Tania database, run the following command:

echo "CREATE DATABASE tania CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;" | sudo mysql -uroot

This command will create a MySQL database named tania.

Step 6: Run the Migration

Next, you need to execute the migration to set up the tables in the database. Run the following command:

sudo php artisan migrate

This command will create all the necessary tables in the database.

Step 7: Start the Tania Server

Finally, start the Tania server by running the following command:

sudo php artisan serve --host 0.0.0.0 --port 80

This command will start the Tania server and make it accessible via your server's IP address.

Conclusion

In this tutorial, we have shown you how to install Tania on NixOS. You can now access Tania's web interface and manage your farm operations.

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!