Installing Concourse on nixOS Latest

Concourse is an open-source continuous integration and delivery system that utilizes a pipeline-based workflow to automate the building, testing, and deploying of software applications. In this tutorial, we will discuss the steps to install Concourse on nixOS Latest.

Prerequisites

Installation

  1. Open a terminal window.

  2. Update your system by running the following command:

sudo nix-channel --update
sudo nixos-rebuild switch
  1. Install Concourse by running the following command:
sudo nix-env -i concourse
  1. Create a Concourse initialization file (concourse-web.service) in the /etc/systemd/system directory by running the following command:
sudo nano /etc/systemd/system/concourse-web.service
  1. In the file, paste the following code block:
[Unit]
Description=Concourse web server

[Service]
User=concourse
Group=concourse
Restart=on-failure
ExecStart=/bin/bash -c "/run/current-system/sw/bin/concourse web \
  --basic-auth-username=myuser \
  --basic-auth-password=mypassword \
  --session-signing-key=/etc/concourse/session_signing_key \
  --tsa-host-key=/etc/concourse/worker_key \
  --tsa-authorized-keys=/etc/concourse/authorized_worker_keys \
  --tsa-external-url=http://ci.example.com:8080 \
  --postgres-data-source=postgres://myuser:mypassword@localhost:5432/atc \
  --add-local-user=myuser:mypassword \
  2>&1 | tee /var/log/concourse/web.log"

[Install]
WantedBy=multi-user.target

This code creates a Concourse web service that listens on http://ci.example.com:8080 and authenticates users myuser and mypassword.

  1. Create a Concourse worker initialization file (concourse-worker.service) in the /etc/systemd/system directory by running the following command:
sudo nano /etc/systemd/system/concourse-worker.service
  1. In the file, paste the following code block:
[Unit]
Description=Concourse worker

[Service]
User=concourse
Group=concourse
Restart=on-failure
ExecStart=/bin/bash -c "/run/current-system/sw/bin/concourse worker \
  --work-dir=/var/lib/concourse/worker \
  --tsa-host=127.0.0.1 \
  --tsa-public-key=/etc/concourse/worker_key.pub \
  --tsa-worker-private-key=/etc/concourse/worker_key \
  --baggageclaim-driver=aufs \
  --privileged \
  2>&1 | tee /var/log/concourse/worker.log"

[Install]
WantedBy=multi-user.target
  1. Change ownership of the /var/lib/concourse directory and its subdirectories to the concourse user by running the following command:
sudo chown concourse:concourse -R /var/lib/concourse
  1. Start and enable the Concourse web and worker services by running the following command:
sudo systemctl start concourse-web.service
sudo systemctl start concourse-worker.service
sudo systemctl enable concourse-web.service
sudo systemctl enable concourse-worker.service
  1. Verify that Concourse is working by opening a web browser and navigating to the URL http://ci.example.com:8080. You should see the Concourse user interface.

Congratulations! You have successfully installed Concourse 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!