Concourse CI overlay and module for Nix
  • Nix 80%
  • Shell 17.3%
  • Python 2.7%
Find a file
2026-04-09 21:29:03 -07:00
module feat(module/worker): Cert directory 2026-03-23 15:59:48 -07:00
package chore: Update to v8.1.1 2026-04-09 21:29:03 -07:00
test fix: Do not use .callPackage for checks 2026-03-23 15:41:12 -07:00
.gitignore build: Add pre-commit 2025-12-28 14:45:14 -08:00
.pre-commit-config.yaml refactor(test): Separate keys 2026-03-15 01:27:11 -07:00
default.nix chore: Update to v7.14.3 2025-12-28 00:08:55 -08:00
flake.lock build: Pin input to 25.11 2026-03-07 14:02:50 -08:00
flake.nix fix: Do not use .callPackage for checks 2026-03-23 15:41:12 -07:00
LICENSE doc: Add Apache 2.0 License 2026-02-28 23:36:41 -08:00
overlay.nix build: Add proxytunnel (a prerequisite for resources) 2026-03-19 23:15:31 -07:00
README.md doc: About resource-types.make 2026-03-23 15:42:32 -07:00

Concourse.nix

Nix module and overlay for Concourse CI.

Installation

This flake provides 3 outputs:

  1. .overlays.default: An overlay for pkgs.concourse and pkgs.fly
  2. .module.web: The web service module
  3. .module.worker: The worker service module

Configuration

For an example, see service integration test. Enable concourse by adding the provided modules in a nixosConfigurations

# Flake
{
  inputs = {
    ...
    concourse = {
      url = "git+https://codeberg.org/aniva/Concourse.nix.git";
      inputs.nixpkgs.follows = "nixpkgs";
    };
  };
}
...

module-overlay = {
  nixpkgs.overlays = [(import package/overlay.nix) inputs.concourse.overlays.default];
};

# nixosConfigurations
imports = [
	inputs.concourse.module.web
	inputs.concourse.module.worker
	module-overlay
]

Then, enable concourse.web or concourse.worker services. The options listed here must be configured for Concourse to run pipelines.

services.concourse.web = {
  enable = true
  ...
  postgres = ...;
  auth = ...;
  network = ...;
  tsa = ...;
  sessionSigningKey = ...;
  environment = {};
}

Configuring the worker is similar

services.concourse.worker = {
  enable = true
  ...
  resourceTypes = with pkgs.concourse.resource-types; [
    registry-image
    git
    time
  ];
  tsa = ...;
  environment = {};
}

Authentication

A web node must declare a method of authentication. Configure authentication using the services.concourse.web.auth.{local,oidc} option or via environment variables.

Resource Types

Every Concourse worker node must advertise a list of resource types which it can deploy. The available resource types are listed in resource-types. In addition to the bundled resource types from Concourse, this flake incorporates 3rd party resource types for the ease of maintenance:

The user can define custom resource types using pkgs.concourse.resource-types.make function, where

pkgs.concourse.resource-types.make {
  type,    # Name of the resource type
  version, # Version
  privileged ? false,
  unique_version_history ? false,
  image,  # A `buildImage` result of the resource
}

The files /opt/resources/{check,in} must be available in the image.

Contributing

All code must be formatted with nix fmt . before checking in. Use the provided development shell and .pre-commit-config.yaml using direnv:

echo "use flake" > .envrc
direnv allow
prek install

When upstream Concourse source receives an update, fetch the new version using

nix run .#update $version

Adopting and Testing Resources

We can adopt unmaintained resources into Concourse.nix and deploy them in lockstep with Concourse itself. This eliminates the difficulty of tracking many resource versions. Adopted resources should go into package/resource-types.

Resources should be tested using the machinery in test/common. This is especially applicable to resources adopted from outside. Refer to the test sin test/resource for examples.