switch to native nix gitea action
All checks were successful
build / test (push) Successful in 11s

gitea: check runner label
This commit is contained in:
Jörg Thalheim 2023-07-13 12:01:23 +02:00
parent 52c4cdb006
commit 3247ce8ccb
2 changed files with 52 additions and 13 deletions

View File

@ -4,7 +4,7 @@ let
inherit (self.packages.${pkgs.hostPlatform.system}) actions-runner;
in
{
systemd.services.gitea-actions-runner-nix-image = {
systemd.services.gitea-runner-nix-image = {
wantedBy = [ "multi-user.target" ];
script = ''
${lib.getExe pkgs.podman} load --input=${actions-runner}
@ -14,7 +14,7 @@ in
RemainAfterExit = true;
};
};
systemd.services.gitea-actions-runner-nix-token = {
systemd.services.gitea-runner-nix-token = {
wantedBy = [ "multi-user.target" ];
after = [ "gitea.service" ];
environment = {
@ -41,15 +41,40 @@ in
systemd.services.gitea-runner-nix = {
after = [
"gitea-actions-runner-nix-token.service"
"gitea-actions-runner-nix-image.service"
"gitea-runner-nix-token.service"
"gitea-runner-nix-image.service"
];
requires = [
"gitea-actions-runner-nix-token.service"
"gitea-actions-runner-nix-image.service"
"gitea-runner-nix-token.service"
"gitea-runner-nix-image.service"
];
# TODO: systemd confinment
#serviceConfig = {
# Environment = [
# "NIX_REMOTE=daemon"
# "PAGER=cat"
# ];
# BindPaths = [
# "/nix/var/nix/daemon-socket/socket"
# "/run/nscd/socket"
# "/var/lib/drone"
# ];
#};
};
#services.gitea-actions-runner.instances.nix-container = {
# enable = true;
# name = "nix-runner";
# # take the git root url from the gitea config
# # only possible if you've also configured your gitea though the same nix config
# # otherwise you need to set it manually
# url = config.services.gitea.settings.server.ROOT_URL;
# # use your favourite nix secret manager to get a path for this
# tokenFile = "/var/lib/gitea-actions-runner/token";
# labels = [
# "nix:docker://${actions-runner.imageName}"
# ];
#};
services.gitea-actions-runner.instances.nix = {
enable = true;
name = "nix-runner";
@ -59,8 +84,22 @@ in
url = config.services.gitea.settings.server.ROOT_URL;
# use your favourite nix secret manager to get a path for this
tokenFile = "/var/lib/gitea-actions-runner/token";
labels = [
"nix:docker://${actions-runner.imageName}"
labels = [ "nix:host" ];
hostPackages = with pkgs; [
bash
coreutils
curl
gawk
gitMinimal
gnused
jq
nixUnstable
nodejs
wget
gnutar
bash
config.nix.package
gzip
];
};
}

File diff suppressed because one or more lines are too long