Skip to content

Commit

Permalink
buildkite-agents: fix module
Browse files Browse the repository at this point in the history
  • Loading branch information
yorickvP committed Oct 14, 2019
1 parent c2ee33c commit a13e14f
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ let

userName = mkOption {
readOnly = true;
default = "buildkite-${name}";
default = "buildkite-agent-${name}";
description = ''
Username of the systemd service this will run as.
'';
Expand Down Expand Up @@ -245,11 +245,11 @@ in {
BUILDKITE_SHELL = cfg.shell;
};

preStart = let

serviceConfig = let
sshDir = "${cfg.statePath}/.ssh";
tagStr = lib.concatStringsSep "," (lib.mapAttrsToList (k: v: "${k}=${v}") cfg.tags);
in
''
preStart = ''
${optionalString (cfg.sshKeyPath != null) ''
mkdir -p "${sshDir}"
chmod 700 "${sshDir}"
Expand All @@ -266,10 +266,10 @@ in {
${cfg.extraConfig}
EOF
${cfg.extraSetup}
'';

serviceConfig =
chown -R $USER $HOME
''; in
{ ExecStart = "${cfg.package}/bin/buildkite-agent start --config ${cfg.statePath}/buildkite-agent.cfg";
ExecStartPre = "+${pkgs.writeShellScript "bk-agent-prestart" preStart}";
User = cfg.userName;
RestartSec = 5;
Restart = "on-failure";
Expand Down

0 comments on commit a13e14f

Please sign in to comment.