Allows (advanced) configuration of GitLab CI using Nix. https://nix-gitlab-ci.projects.tf
Find a file
2024-09-11 15:03:43 +00:00
lib feat: add assertion to check if a job's stage exists 2024-09-10 13:07:48 +00:00
templates feat: add CI Component template 2024-09-11 15:03:42 +00:00
.envrc chore: initial commit 2024-01-14 16:45:07 +01:00
.gitignore chore: initial commit 2024-01-14 16:45:07 +01:00
.gitlab-ci.yml feat: add CI Component template 2024-09-11 15:03:42 +00:00
flake.lock feat: split lib and utils into separate flake 2024-07-28 12:51:14 +00:00
flake.nix feat: add support for nix store paths in variables 2024-09-10 12:46:13 +00:00
gitlab-ci.yml feat: add CI Component template 2024-09-11 15:03:42 +00:00
README.md feat: add CI Component template 2024-09-11 15:03:42 +00:00

Nix Gitlab CI

Flake module which allows generating a .gitlab-ci.yml from Nix. This allows easily using any Nix package in CI. Also makes it possible to split CI parts in a separate module which can be imported in multiple projects.

Usage

# flake.nix
{
  ...
  inputs.nix-gitlab-ci.url = "gitlab:TECHNOFAB/nix-gitlab-ci?dir=lib";
  
  outputs = {...}: flake-parts.lib.mkFlake {...} {
    imports = [
      inputs.nix-gitlab-ci.flakeModule
    ];
    ...
    
    perSystem = {pkgs, ...}: {
      ci = {
        stages = ["test"];
        jobs = {
          "test" = {
            stage = "test";
            deps = [pkgs.unixtools.ping];
            script = [
              "ping -c 5 8.8.8.8"
            ];
          };
        };
      };
      ...
    }
  }
}
# .gitlab-ci.yml
include:
  - component: gitlab.com/TECHNOFAB/nix-gitlab-ci/nix-gitlab-ci@0.2.0
    inputs:
      # specify inputs here, for example:
      image_tag: latest-cachix