mirror of
https://gitlab.com/TECHNOFAB/nix-gitlab-ci.git
synced 2025-12-12 02:00:13 +01:00
chore: slim down job-deps as much as possible
This commit is contained in:
parent
14530f8e9e
commit
8dc2e7d772
1 changed files with 25 additions and 5 deletions
|
|
@ -12,6 +12,15 @@
|
||||||
inherit (lib) isAttrs filterAttrs mapAttrs types mkOption toList;
|
inherit (lib) isAttrs filterAttrs mapAttrs types mkOption toList;
|
||||||
cfg = config.ci.config;
|
cfg = config.ci.config;
|
||||||
|
|
||||||
|
stdenvMinimal = pkgs.stdenvNoCC.override {
|
||||||
|
cc = null;
|
||||||
|
preHook = "";
|
||||||
|
allowedRequisites = null;
|
||||||
|
initialPath = [pkgs.coreutils pkgs.findutils];
|
||||||
|
shell = "/bin/sh";
|
||||||
|
extraNativeBuildInputs = [];
|
||||||
|
};
|
||||||
|
|
||||||
filterAttrsRec = pred: v:
|
filterAttrsRec = pred: v:
|
||||||
if isAttrs v
|
if isAttrs v
|
||||||
then filterAttrs pred (mapAttrs (path: filterAttrsRec pred) v)
|
then filterAttrs pred (mapAttrs (path: filterAttrsRec pred) v)
|
||||||
|
|
@ -209,11 +218,22 @@
|
||||||
);
|
);
|
||||||
in {
|
in {
|
||||||
name = "gitlab-ci:pipeline:${pipeline_name}:job-deps:${key}";
|
name = "gitlab-ci:pipeline:${pipeline_name}:job-deps:${key}";
|
||||||
value = pkgs.writeShellScript "gitlab-ci-job-deps:${key}" ''
|
value = stdenvMinimal.mkDerivation {
|
||||||
export PATH="${lib.makeBinPath job.nix.deps}:$PATH";
|
name = "gitlab-ci-job-deps-${key}";
|
||||||
# variables containing nix derivations:
|
dontUnpack = true;
|
||||||
${variableExports}
|
installPhase = let
|
||||||
'';
|
script = ''
|
||||||
|
export PATH="${lib.makeBinPath job.nix.deps}:$PATH";
|
||||||
|
# variables containing nix derivations:
|
||||||
|
${variableExports}
|
||||||
|
'';
|
||||||
|
in
|
||||||
|
# sh
|
||||||
|
''
|
||||||
|
echo '${script}' > $out
|
||||||
|
chmod +x $out
|
||||||
|
'';
|
||||||
|
};
|
||||||
})
|
})
|
||||||
jobs;
|
jobs;
|
||||||
# allows the user to directly run the script
|
# allows the user to directly run the script
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue