Set runner name to attr name for github-runners.${name}

This commit is contained in:
Tom McLaughlin
2022-10-14 05:31:50 -06:00
parent fc8fdb03a0
commit 2c099d1a14
3 changed files with 13 additions and 7 deletions

View File

@@ -14,7 +14,7 @@ in
{
options.services.github-runners = mkOption {
default = {};
type = with types; attrsOf (submodule { options = import ./github-runner/options.nix args; });
type = with types; attrsOf (submodule { options = import ./github-runner/options.nix (args // { includeNameDefault = false; }); });
example = {
runner1 = {
enable = true;
@@ -36,15 +36,15 @@ in
};
config = {
systemd.services = flip mapAttrs' cfg (n: v:
systemd.services = flip mapAttrs' cfg (name: v:
let
svcName = "github-runner-${n}";
svcName = "github-runner-${name}";
in
nameValuePair svcName
(import ./github-runner/service.nix (args // {
inherit svcName;
cfg = v;
systemdDir = "github-runner/${n}";
cfg = v // { inherit name; };
systemdDir = "github-runner/${name}";
}))
);
};