How to Install DOMJudge on NixOS Latest

DOMJudge is an open-source programming contest judging system used by many universities and organizations for running programming contests. NixOS Latest is a Linux distribution that provides a declarative approach to configuration management.

This tutorial will guide you through the steps to install DOMJudge on NixOS Latest.

Prerequisites

Before we begin, make sure you have access to a NixOS Latest server or virtual machine, and that you have root privileges to install packages.

Step 1: Install Required Dependencies

DOMJudge requires certain dependencies to function correctly. Run the following command to install them:

$ sudo nix-env -i gcc make cmake automake autoconf libtool zlib zlib-dev openssl openssl-dev mariadb mariadb-dev php

Step 2: Install DOMJudge

DOMJudge can be installed from the official Nixpkgs repository using the following command:

$ sudo nix-env -iA nixos.domjudge

Step 3: Configure DOMJudge

After installation, we need to configure DOMJudge. Create a file /etc/domjudge/domserver.secret that contains a randomly generated secret passphrase, which should be used to authenticate the DOMJudge clients.

$ sudo mkdir -p /etc/domjudge/
$ sudo dd if=/dev/urandom bs=32 count=1 | base64 > /etc/domjudge/domserver.secret

Now we need to create the default configuration file. Run the following command to generate the default configuration file:

$ sudo domjudge-config setup-domserver

The configuration file will be created at /etc/domjudge/domserver.domjudge-config.inc.php. Note that this file should not be edited directly; instead, changes should be made to the appropriate configuration files in the /etc/domjudge directory.

Finally, start the domserver service:

$ sudo systemctl enable domserver
$ sudo systemctl start domserver

Step 4: Test DOMJudge

Open the web browser and navigate to http://localhost/domjudge/jury, where you should see the DOMJudge login page. Login to the DOMJudge interface with the credentials:

Username: admin
Password: password

After a successful login, you should see the jury interface, where you can create new programming contests, problems, teams, and more.

Conclusion

Congratulations! You have successfully installed DOMJudge on NixOS and configured it for use. Use this tutorial as a starting point for exploring the features and functionality of DOMJudge.