From 1b963cb64182ef40d4f4db68a80938728496565a Mon Sep 17 00:00:00 2001 From: technofab Date: Sun, 14 Jan 2024 17:09:23 +0100 Subject: [PATCH] chore: add README --- README.md | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..98b6611 --- /dev/null +++ b/README.md @@ -0,0 +1,46 @@ +# 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 +```nix +# 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" + ]; + }; + }; + }; + ... + } + } +} +``` +```yaml +# .gitlab-ci.yml +include: + - project: TECHNOFAB/nix-gitlab-ci + ref: main + file: gitlab-ci.yml +```