'';
dest = "buildbot/${project.name}/webhook-httpd-include";
}
+ {
+ permissions = "0600";
+ user = "buildbot";
+ group = "buildbot";
+ dest = "buildbot/${project.name}/environment_file";
+ text = let
+ project_env = with lib.attrsets;
+ mapAttrs' (k: v: nameValuePair "BUILDBOT_${k}" v) project.environment //
+ mapAttrs' (k: v: nameValuePair "BUILDBOT_PATH_${k}" (v pkgs)) (attrByPath ["builderPaths"] {} project) //
+ { BUILDBOT_PROJECT_DIR = ./projects + "/${project.name}"; };
+ in builtins.concatStringsSep "\n"
+ (lib.mapAttrsToList (envK: envV: "${envK}=${envV}") project_env);
+ }
]
) config.myEnv.buildbot.projects
)
paths = [
"/var/secrets/buildbot/ldap"
"/var/secrets/buildbot/ssh_key"
+ "/var/secrets/buildbot/${project.name}/environment_file"
] ++ lib.attrsets.mapAttrsToList (k: v: "/var/secrets/buildbot/${project.name}/${k}") project.secrets;
}) config.myEnv.buildbot.projects;
${buildbot}/bin/buildbot upgrade-master ${varDir}/${project.name}
'';
environment = let
- project_env = with lib.attrsets;
- mapAttrs' (k: v: nameValuePair "BUILDBOT_${k}" v) project.environment //
- mapAttrs' (k: v: nameValuePair "BUILDBOT_PATH_${k}" (v pkgs)) (attrByPath ["builderPaths"] {} project) //
- { BUILDBOT_PROJECT_DIR = ./projects + "/${project.name}"; };
buildbot_config = pkgs.python3Packages.buildPythonPackage (rec {
name = "buildbot_config-${project.name}";
src = ./projects + "/${project.name}";
pkgs.python3Packages.buildbot-worker
buildbot_common buildbot_config
])}/${buildbot.pythonModule.sitePackages}${if project.pythonPathHome then ":${varDir}/${project.name}/.local/${pkgs.python3.pythonForBuild.sitePackages}" else ""}";
- in project_env // { inherit PYTHONPATH HOME; };
+ in { inherit PYTHONPATH HOME; };
serviceConfig = {
Slice = "buildbot.slice";
SupplementaryGroups = "keys";
WorkingDirectory = "${varDir}/${project.name}";
ExecStart = "${buildbot}/bin/buildbot start";
+ EnvironmentFile = "/var/secrets/buildbot/${project.name}/environment_file";
};
}) config.myEnv.buildbot.projects;
};