Gitlist is an open source web application that provides a user interface to view repositories hosted on Git servers. In this tutorial, we will go through the steps to install Gitlist on NixOS Latest.
Before you begin, ensure that you have the following prerequisites:
Gitlist requires a webserver to function, in this tutorial, we will use Nginx. To install Nginx, execute the following command:
$ sudo nix-env -i nginx
Gitlist is written in PHP, and thus requires PHP to be installed on the system. To install PHP, execute the following command:
$ sudo nix-env -i php
Gitlist is hosted on Github, and thus, we'll download the archive from Github and extract it on the system. Execute the following command to download and extract Gitlist:
$ sudo su
$ cd /var/www
$ wget https://github.com/klaussilveira/gitlist/releases/download/1.0.2/gitlist-1.0.2.tar.gz
$ tar -xzvf gitlist-1.0.2.tar.gz
Note: You can replace 1.0.2
with the preferred version number.
To configure Gitlist, we need to make several changes to the config.ini
file. Execute the following command to edit the file:
$ nano /var/www/gitlist/config.ini
Modify the following fields:
[git]
client = '/usr/bin/git'
[app]
baseurl = '/git'
/usr/bin/git
to the path of Git installed on your system./git
to any URL path that you want to use to access Gitlist.To serve Gitlist using Nginx, we need to create an Nginx configuration file. Execute the following command to edit the file:
$ nano /etc/nginx/sites-available/gitlist
Paste the following configuration:
server {
listen 80;
server_name git.example.com;
root /var/www/gitlist/public;
index index.php;
location /git {
try_files $uri $uri/ /git/index.php?$query_string;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_pass unix:/var/run/php-fpm.socket;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_script_name;
include fastcgi_params;
}
}
Modify server_name
, root
, and location
fields according to your configurations.
Execute the following commands to enable Nginx and PHP FPM:
$ sudo nixos-rebuild switch
$ sudo systemctl enable nginx
$ sudo systemctl start nginx
$ sudo systemctl enable php-fpm
$ sudo systemctl start php-fpm
Visit your preferred browser and type ip-address/git
or domain-name/git
to access Gitlist. You should be able to see the repositories listed in Gitlist's web interface.
Congratulations, you've successfully installed Gitlist 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!