mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-12 12:45:27 +03:00
nixos/github-runner: use specifier to get abs runtime path
This commit is contained in:
parent
91bf483f87
commit
fcfa809fe6
1 changed files with 6 additions and 5 deletions
|
@ -3,9 +3,10 @@ with lib;
|
||||||
let
|
let
|
||||||
cfg = config.services.github-runner;
|
cfg = config.services.github-runner;
|
||||||
svcName = "github-runner";
|
svcName = "github-runner";
|
||||||
|
systemdUser = "${svcName}-${cfg.name}";
|
||||||
systemdDir = "${svcName}/${cfg.name}";
|
systemdDir = "${svcName}/${cfg.name}";
|
||||||
systemdUser = "${svcName}-${cfg.user}";
|
# %t: Runtime directory root (usually /run); see systemd.unit(5)
|
||||||
runnerRoot = "/run/${systemdDir}"; # RuntimeDirectory=
|
runtimeDir = "%t/${systemdDir}";
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.services.github-runner = {
|
options.services.github-runner = {
|
||||||
|
@ -111,8 +112,8 @@ in
|
||||||
after = [ "network.target" ];
|
after = [ "network.target" ];
|
||||||
|
|
||||||
environment = {
|
environment = {
|
||||||
HOME = runnerRoot;
|
HOME = runtimeDir;
|
||||||
RUNNER_ROOT = runnerRoot;
|
RUNNER_ROOT = runtimeDir;
|
||||||
};
|
};
|
||||||
|
|
||||||
path = (with pkgs; [
|
path = (with pkgs; [
|
||||||
|
@ -241,7 +242,7 @@ in
|
||||||
# Home of persistent runner data, e.g., credentials
|
# Home of persistent runner data, e.g., credentials
|
||||||
StateDirectory = [ systemdDir ];
|
StateDirectory = [ systemdDir ];
|
||||||
StateDirectoryMode = "0700";
|
StateDirectoryMode = "0700";
|
||||||
WorkingDirectory = runnerRoot;
|
WorkingDirectory = runtimeDir;
|
||||||
|
|
||||||
# By default, use a dynamically allocated user
|
# By default, use a dynamically allocated user
|
||||||
DynamicUser = true;
|
DynamicUser = true;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue