github runners
This commit is contained in:
1 parent
705f2eb4c6
commit
32ea399d89
5 files changed
+89
-1
No files matched your search
@@ -198,6 +198,7 @@
|
|||||||
nbot-goose = ./secrets/nbot-goose.age;
|
nbot-goose = ./secrets/nbot-goose.age;
|
||||||
nbot-cluster = ./secrets/nbot-cluster.age;
|
nbot-cluster = ./secrets/nbot-cluster.age;
|
||||||
nbot-cluster-hl-fws1 = ./secrets/nbot-cluster-hl-fws1.age;
|
nbot-cluster-hl-fws1 = ./secrets/nbot-cluster-hl-fws1.age;
|
||||||
|
github-runner-token-fws1 = ./secrets/github-runner-token-fws1.age;
|
||||||
};
|
};
|
||||||
inherit
|
inherit
|
||||||
hyprlauncher
|
hyprlauncher
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{ ... }:
|
{ ... }:
|
||||||
{
|
{
|
||||||
imports = [ ./nbot.nix ];
|
imports = [ ./nbot.nix ./github-runners.nix ];
|
||||||
|
|
||||||
services.pipewire = {
|
services.pipewire = {
|
||||||
extraConfig.pipewire-pulse."10-raop-discover" = {
|
extraConfig.pipewire-pulse."10-raop-discover" = {
|
||||||
|
|||||||
@@ -0,0 +1,78 @@
|
|||||||
|
{ config, lib, skyg-secrets, ... }:
|
||||||
|
let
|
||||||
|
concurrency = 4;
|
||||||
|
runnerNames = map (i: "runner-${toString i}") (lib.range 1 concurrency);
|
||||||
|
stateVersion = config.system.stateVersion;
|
||||||
|
cache = "/var/cache/github-runners/go";
|
||||||
|
credentials = "/run/github-runner-registration";
|
||||||
|
|
||||||
|
# The same numeric identity owns the bind-mounted caches on the host and in every container.
|
||||||
|
runnerUser = {
|
||||||
|
users.github-runner = {
|
||||||
|
uid = 915;
|
||||||
|
isSystemUser = true;
|
||||||
|
group = "github-runner";
|
||||||
|
};
|
||||||
|
groups.github-runner.gid = 915;
|
||||||
|
};
|
||||||
|
in
|
||||||
|
{
|
||||||
|
age.secrets.github-runner-token-fws1 = {
|
||||||
|
file = skyg-secrets.github-runner-token-fws1;
|
||||||
|
path = "${credentials}/token";
|
||||||
|
# The containers mount this directory and must see token rotations.
|
||||||
|
symlink = false;
|
||||||
|
mode = "0400";
|
||||||
|
};
|
||||||
|
|
||||||
|
users = runnerUser;
|
||||||
|
systemd.tmpfiles.rules = [
|
||||||
|
"d ${credentials} 0700 root root -"
|
||||||
|
"d ${cache} 0755 root root -"
|
||||||
|
"d ${cache}/build 0700 github-runner github-runner -"
|
||||||
|
"d ${cache}/mod 0700 github-runner github-runner -"
|
||||||
|
];
|
||||||
|
|
||||||
|
systemd.services = lib.genAttrs (map (name: "container@${name}") runnerNames) (_: {
|
||||||
|
serviceConfig = {
|
||||||
|
MemoryLow = "4G";
|
||||||
|
MemoryMax = "8G";
|
||||||
|
CPUQuota = "200%";
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
containers = lib.genAttrs runnerNames (name: {
|
||||||
|
autoStart = true;
|
||||||
|
bindMounts = {
|
||||||
|
"${credentials}".isReadOnly = true;
|
||||||
|
"/var/cache/go" = {
|
||||||
|
hostPath = cache;
|
||||||
|
isReadOnly = false;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = { pkgs, ... }: {
|
||||||
|
system.stateVersion = stateVersion;
|
||||||
|
users = runnerUser;
|
||||||
|
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
||||||
|
|
||||||
|
services.github-runners.${name} = {
|
||||||
|
enable = true;
|
||||||
|
inherit name;
|
||||||
|
replace = true;
|
||||||
|
url = "https://github.com/SkyG-Org";
|
||||||
|
tokenFile = "${credentials}/token";
|
||||||
|
user = "github-runner";
|
||||||
|
group = "github-runner";
|
||||||
|
extraLabels = [ "fws1" "nixos" "go" ];
|
||||||
|
extraPackages = [ pkgs.go ];
|
||||||
|
extraEnvironment = {
|
||||||
|
NIX_REMOTE = "daemon";
|
||||||
|
GOCACHE = "/var/cache/go/build";
|
||||||
|
GOMODCACHE = "/var/cache/go/mod";
|
||||||
|
};
|
||||||
|
serviceOverrides.ReadWritePaths = [ "/var/cache/go" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -35,6 +35,8 @@ in
|
|||||||
"secrets/nbot-cluster.age".publicKeys = [ ari fwdesk ];
|
"secrets/nbot-cluster.age".publicKeys = [ ari fwdesk ];
|
||||||
"secrets/nbot-cluster-hl-fws1.age".publicKeys = [ ari fws1 ];
|
"secrets/nbot-cluster-hl-fws1.age".publicKeys = [ ari fws1 ];
|
||||||
|
|
||||||
|
"secrets/github-runner-token-fws1.age".publicKeys = [ ari fws1 ];
|
||||||
|
|
||||||
# Buzz stack env (minipc1)
|
# Buzz stack env (minipc1)
|
||||||
"secrets/buzz-env.age".publicKeys = [ ari minipc1 ];
|
"secrets/buzz-env.age".publicKeys = [ ari minipc1 ];
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
age-encryption.org/v1
|
||||||
|
-> ssh-ed25519 CIR0mA L83QWLnE5GVGD0exCETcRL+nDKb42ItcG3N2cpPaGgs
|
||||||
|
9PiiapcU18WKrwvAqgiZNjuYQEo61sykwVZtvJ8JS+8
|
||||||
|
-> ssh-ed25519 KFBpLw QTpLVyI872MepWcJyeFQBR6RB+xVy9lK28kshgl+IiQ
|
||||||
|
dFKmJDffaC2Ig8fEwb9kJ0tdedK24J/CnjK40Yor5HQ
|
||||||
|
--- WeEsbTKGDvopQNxQpXMCTL4hhqmhljQb7bv5c4oaHXw
|
||||||
|
Bžþoú#”µ×gÆE+‹O…¹^␍ÙÅ,%LO÷¦uàYJÃh‚ø‚ç\É"¹ÑçÞËŠí¥ã
|
||||||
Reference in new issue
Block a user