args: let # allow passing just pkgs aswell for convenience lib = args.lib or args.pkgs.lib; # makes it optional to pass if it's not explicitly needed pkgs = args.pkgs or (throw "[nix-gitlab-ci] pkgs argument was used but not set, please pass it"); inherit (lib) evalModules trimWith; impl = import ./impl {inherit lib pkgs cilib;}; cilib = { inherit (impl) helpers modules mkPipeline mkJobRun mkJobDeps mkJobPatched; utils = import ./utils.nix {inherit pkgs;}; version = trimWith { start = true; end = true; } (builtins.readFile ./VERSION); mkCI = config: let result = (evalModules { modules = [ cilib.modules.nixCiSubmodule { inherit config; } ]; }).config; # Check all assertions and warnings using NixOS infrastructure, # then return the result with internal module options removed checked = lib.asserts.checkAssertWarn result.assertions result.warnings result; in builtins.removeAttrs checked ["assertions" "warnings" "config"]; }; in cilib