mirror of
https://gitlab.com/TECHNOFAB/nix-gitlab-ci.git
synced 2025-12-11 17:50:08 +01:00
Allows (advanced) configuration of GitLab CI using Nix.
https://nix-gitlab-ci.projects.tf
|
|
||
|---|---|---|
| lib | ||
| templates | ||
| .envrc | ||
| .gitignore | ||
| .gitlab-ci.yml | ||
| flake.lock | ||
| flake.nix | ||
| gitlab-ci.yml | ||
| README.md | ||
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.3.0
inputs:
# specify inputs here, for example:
image_tag: latest-cachix