Allows (advanced) configuration of GitLab CI using Nix. https://nix-gitlab-ci.projects.tf
Find a file
2024-03-26 17:49:57 +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 fix: remove extra - 2024-03-26 17:49:57 +01:00
flake.lock feat: caching support 2024-03-17 15:44:22 +00:00
flake.nix fix(module): fix before_script not getting appended if it exists 2024-03-17 21:10:10 +01:00
flakeModule.nix fix: allow rules to contain attrs 2024-03-23 21:09:05 +01:00
gitlab-ci.yml chore: update gitlab-ci.yml and only load job deps if name was passed to setup_nix_ci 2024-03-17 18:16:34 +01:00
README.md chore: add README 2024-01-14 17:09:23 +01:00
utils.nix chore(utils): fix before_script getting overwritten and add collapsible sections 2024-03-17 18:26:45 +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