Allows (advanced) configuration of GitLab CI using Nix. https://nix-gitlab-ci.projects.tf
Find a file
2024-01-14 17:17:24 +01: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 chore: initial commit 2024-01-14 16:45:07 +01:00
flake.lock chore: initial commit 2024-01-14 16:45:07 +01:00
flake.nix fix: add when and start_in option 2024-01-14 17:17:24 +01:00
flakeModule.nix fix: add when and start_in option 2024-01-14 17:17:24 +01:00
gitlab-ci.yml chore: initial commit 2024-01-14 16:45:07 +01:00
README.md chore: add README 2024-01-14 17:09:23 +01: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";
  
  outputs = {...}: flake-parts.lib.mkFlake {...} {
    imports = [
      inputs.nix-gitlab-ci.flakeModule
    ];
    ...
    
    perSystem = {...}: {
      ci = {
        stages = ["test"];
        jobs = {
          "test" = {
            stage = "test";
            deps = [pkgs.unixtools.ping];
            script = [
              "ping -c 5 8.8.8.8"
            ];
          };
        };
      };
      ...
    }
  }
}
# .gitlab-ci.yml
include:
  - project: TECHNOFAB/nix-gitlab-ci
    ref: main
    file: gitlab-ci.yml