mirror of
https://github.com/LnL7/nix-darwin.git
synced 2024-12-14 11:57:34 +00:00
Revert "github-runnners: fix workDir missing on reboot"
This reverts commit fe99aa9699
.
This commit is contained in:
parent
72bbc11aed
commit
5c8fb55182
1 changed files with 6 additions and 12 deletions
|
@ -41,7 +41,7 @@ in
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
launchd = mkIf cfg.enable {
|
launchd = mkIf cfg.enable {
|
||||||
text = mkBefore ''
|
text = mkBefore (''
|
||||||
echo >&2 "setting up GitHub Runner '${cfg.name}'..."
|
echo >&2 "setting up GitHub Runner '${cfg.name}'..."
|
||||||
|
|
||||||
${pkgs.coreutils}/bin/mkdir -p -m 0750 ${escapeShellArg (mkStateDir cfg)}
|
${pkgs.coreutils}/bin/mkdir -p -m 0750 ${escapeShellArg (mkStateDir cfg)}
|
||||||
|
@ -49,7 +49,10 @@ in
|
||||||
|
|
||||||
${pkgs.coreutils}/bin/mkdir -p -m 0750 ${escapeShellArg (mkLogDir cfg)}
|
${pkgs.coreutils}/bin/mkdir -p -m 0750 ${escapeShellArg (mkLogDir cfg)}
|
||||||
${pkgs.coreutils}/bin/chown ${user}:${group} ${escapeShellArg (mkLogDir cfg)}
|
${pkgs.coreutils}/bin/chown ${user}:${group} ${escapeShellArg (mkLogDir cfg)}
|
||||||
'';
|
'' + optionalString (cfg.workDir == null) ''
|
||||||
|
${pkgs.coreutils}/bin/mkdir -p -m 0750 ${escapeShellArg (mkWorkDir cfg)}
|
||||||
|
${pkgs.coreutils}/bin/chown ${user}:${group} ${escapeShellArg (mkWorkDir cfg)}
|
||||||
|
'');
|
||||||
};
|
};
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
@ -59,9 +62,6 @@ in
|
||||||
stateDir = mkStateDir cfg;
|
stateDir = mkStateDir cfg;
|
||||||
logDir = mkLogDir cfg;
|
logDir = mkLogDir cfg;
|
||||||
workDir = mkWorkDir cfg;
|
workDir = mkWorkDir cfg;
|
||||||
user = if (cfg.user != null) then cfg.user else "_github-runner";
|
|
||||||
# If both user and group are null then we manage the group, otherwise if only group is null then there's no group
|
|
||||||
group = if (cfg.group != null) then group else if (cfg.user == null) then "_github-runner" else "";
|
|
||||||
in
|
in
|
||||||
nameValuePair
|
nameValuePair
|
||||||
(mkSvcName name)
|
(mkSvcName name)
|
||||||
|
@ -116,12 +116,6 @@ in
|
||||||
''
|
''
|
||||||
echo "Configuring GitHub Actions Runner"
|
echo "Configuring GitHub Actions Runner"
|
||||||
|
|
||||||
${optionalString (cfg.workDir == null) ''
|
|
||||||
# /var/run gets cleared every reboot so we need to create it before starting the service
|
|
||||||
${pkgs.coreutils}/bin/mkdir -p -m 0750 ${escapeShellArg workDir}
|
|
||||||
${pkgs.coreutils}/bin/chown ${user}:${group} ${escapeShellArg workDir}
|
|
||||||
''}
|
|
||||||
|
|
||||||
# Always clean the working directory
|
# Always clean the working directory
|
||||||
${pkgs.findutils}/bin/find ${escapeShellArg workDir} -mindepth 1 -delete
|
${pkgs.findutils}/bin/find ${escapeShellArg workDir} -mindepth 1 -delete
|
||||||
|
|
||||||
|
@ -153,7 +147,7 @@ in
|
||||||
StandardErrorPath = "${logDir}/launchd-stderr.log";
|
StandardErrorPath = "${logDir}/launchd-stderr.log";
|
||||||
StandardOutPath = "${logDir}/launchd-stdout.log";
|
StandardOutPath = "${logDir}/launchd-stdout.log";
|
||||||
ThrottleInterval = 30;
|
ThrottleInterval = 30;
|
||||||
UserName = user;
|
UserName = if (cfg.user != null) then cfg.user else "_github-runner";
|
||||||
WatchPaths = [
|
WatchPaths = [
|
||||||
"/etc/resolv.conf"
|
"/etc/resolv.conf"
|
||||||
"/Library/Preferences/SystemConfiguration/NetworkInterfaces.plist"
|
"/Library/Preferences/SystemConfiguration/NetworkInterfaces.plist"
|
||||||
|
|
Loading…
Reference in a new issue