aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modules/apps/jenkins/default.nix3
-rw-r--r--modules/apps/jenkins/instance.nix13
2 files changed, 15 insertions, 1 deletions
diff --git a/modules/apps/jenkins/default.nix b/modules/apps/jenkins/default.nix
index bd69477..42ae197 100644
--- a/modules/apps/jenkins/default.nix
+++ b/modules/apps/jenkins/default.nix
@@ -87,6 +87,9 @@ let
'') (jobFiles name cfg)
)}
+ mkdir -p secrets
+ echo ${if cfg.master-access-control then "false" else "true"} > secrets/slave-to-master-security-kill-switch
+
if [ -f ${path} ]; then
old=$(cat ${path})
else
diff --git a/modules/apps/jenkins/instance.nix b/modules/apps/jenkins/instance.nix
index 2c01391..6cca8a4 100644
--- a/modules/apps/jenkins/instance.nix
+++ b/modules/apps/jenkins/instance.nix
@@ -9,7 +9,9 @@ let
concatStrings filterAttrs hasSuffix mapAttrsToList mkOption ;
inherit (lib.types)
- addCheck attrsOf either enum int listOf nullOr package path str submodule ;
+ addCheck attrsOf bool either enum int listOf nullOr package path str
+ submodule
+ ;
default = d: t: mkOption { type = t; default = d; };
optional = t: mkOption { type = nullOr t; default = null; };
@@ -51,6 +53,15 @@ in {
default = "/jenkins/${name}";
};
+ master-access-control = mkOption {
+ description = ''
+ Enable Agent -> Master Access Control.
+ See https://wiki.jenkins.io/display/JENKINS/Slave+To+Master+Access+Control
+ '';
+ type = bool;
+ default = true;
+ };
+
jobs = mkOption {
description = ''
Jenkins jobs. Each value is either inline XML text or an XML file.