9 inherit (lib) mkIf mkOption types;
10 cfg = config.services.jenkinsSlave;
11 masterCfg = config.services.jenkins;
15 services.jenkinsSlave = {
17 # * assure the profile of the jenkins user has a JRE and any specified packages. This would
19 # * Optionally configure the node as a jenkins ad-hoc slave. This would imply configuration
20 # properties for the master node.
25 If true the system will be configured to work as a jenkins slave.
26 If the system is also configured to work as a jenkins master then this has no effect.
27 In progress: Currently only assures the jenkins user is configured.
35 User the jenkins slave agent should execute under.
43 If the default slave agent user "jenkins" is configured then this is
44 the primary group of that user.
49 default = "/var/lib/jenkins";
52 The path to use as JENKINS_HOME. If the default user "jenkins" is configured then
53 this is the home of the "jenkins" user.
57 javaPackage = lib.mkPackageOption pkgs "jdk" { };
61 config = mkIf (cfg.enable && !masterCfg.enable) {
62 users.groups = lib.optionalAttrs (cfg.group == "jenkins") {
63 jenkins.gid = config.ids.gids.jenkins;
66 users.users = lib.optionalAttrs (cfg.user == "jenkins") {
68 description = "jenkins user";
72 useDefaultShell = true;
73 uid = config.ids.uids.jenkins;
79 package = cfg.javaPackage;